Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
b7b0aae4
Unverified
Commit
b7b0aae4
authored
Oct 27, 2018
by
k8s-ci-robot
Committed by
GitHub
Oct 27, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #70031 from nrfox/requeue-on-error
Sample Controller: requeue work item on syncHandler error
parents
a3eebe9a
8f86654b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
controller.go
staging/src/k8s.io/sample-controller/controller.go
+3
-1
No files found.
staging/src/k8s.io/sample-controller/controller.go
View file @
b7b0aae4
...
...
@@ -219,7 +219,9 @@ func (c *Controller) processNextWorkItem() bool {
// Run the syncHandler, passing it the namespace/name string of the
// Foo resource to be synced.
if
err
:=
c
.
syncHandler
(
key
);
err
!=
nil
{
return
fmt
.
Errorf
(
"error syncing '%s': %s"
,
key
,
err
.
Error
())
// Put the item back on the workqueue to handle any transient errors.
c
.
workqueue
.
AddRateLimited
(
key
)
return
fmt
.
Errorf
(
"error syncing '%s': %s, requeuing"
,
key
,
err
.
Error
())
}
// Finally, if no error occurs we Forget this item so it does not
// get queued again until another change happens.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment