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
9b87046c
Unverified
Commit
9b87046c
authored
Feb 21, 2019
by
Kubernetes Prow Robot
Committed by
GitHub
Feb 21, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #74126 from danielqsj/cu
correct error string according to golang best practice
parents
62ba0222
6edde10f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
controller_utils.go
pkg/controller/controller_utils.go
+8
-8
No files found.
pkg/controller/controller_utils.go
View file @
9b87046c
...
...
@@ -126,7 +126,7 @@ var ExpKeyFunc = func(obj interface{}) (string, error) {
if
e
,
ok
:=
obj
.
(
*
ControlleeExpectations
);
ok
{
return
e
.
key
,
nil
}
return
""
,
fmt
.
Errorf
(
"
C
ould not find key for obj %#v"
,
obj
)
return
""
,
fmt
.
Errorf
(
"
c
ould not find key for obj %#v"
,
obj
)
}
// ControllerExpectationsInterface is an interface that allows users to set and wait on expectations.
...
...
@@ -291,7 +291,7 @@ var UIDSetKeyFunc = func(obj interface{}) (string, error) {
if
u
,
ok
:=
obj
.
(
*
UIDSet
);
ok
{
return
u
.
key
,
nil
}
return
""
,
fmt
.
Errorf
(
"
C
ould not find key for obj %#v"
,
obj
)
return
""
,
fmt
.
Errorf
(
"
c
ould not find key for obj %#v"
,
obj
)
}
// UIDSet holds a key and a set of UIDs. Used by the
...
...
@@ -627,7 +627,7 @@ func (f *FakePodControl) CreatePods(namespace string, spec *v1.PodTemplateSpec,
defer
f
.
Unlock
()
f
.
CreateCallCount
++
if
f
.
CreateLimit
!=
0
&&
f
.
CreateCallCount
>
f
.
CreateLimit
{
return
fmt
.
Errorf
(
"
N
ot creating pod, limit %d already reached (create call %d)"
,
f
.
CreateLimit
,
f
.
CreateCallCount
)
return
fmt
.
Errorf
(
"
n
ot creating pod, limit %d already reached (create call %d)"
,
f
.
CreateLimit
,
f
.
CreateCallCount
)
}
f
.
Templates
=
append
(
f
.
Templates
,
*
spec
)
if
f
.
Err
!=
nil
{
...
...
@@ -641,7 +641,7 @@ func (f *FakePodControl) CreatePodsWithControllerRef(namespace string, spec *v1.
defer
f
.
Unlock
()
f
.
CreateCallCount
++
if
f
.
CreateLimit
!=
0
&&
f
.
CreateCallCount
>
f
.
CreateLimit
{
return
fmt
.
Errorf
(
"
N
ot creating pod, limit %d already reached (create call %d)"
,
f
.
CreateLimit
,
f
.
CreateCallCount
)
return
fmt
.
Errorf
(
"
n
ot creating pod, limit %d already reached (create call %d)"
,
f
.
CreateLimit
,
f
.
CreateCallCount
)
}
f
.
Templates
=
append
(
f
.
Templates
,
*
spec
)
f
.
ControllerRefs
=
append
(
f
.
ControllerRefs
,
*
controllerRef
)
...
...
@@ -656,7 +656,7 @@ func (f *FakePodControl) CreatePodsOnNode(nodeName, namespace string, template *
defer
f
.
Unlock
()
f
.
CreateCallCount
++
if
f
.
CreateLimit
!=
0
&&
f
.
CreateCallCount
>
f
.
CreateLimit
{
return
fmt
.
Errorf
(
"
N
ot creating pod, limit %d already reached (create call %d)"
,
f
.
CreateLimit
,
f
.
CreateCallCount
)
return
fmt
.
Errorf
(
"
n
ot creating pod, limit %d already reached (create call %d)"
,
f
.
CreateLimit
,
f
.
CreateCallCount
)
}
f
.
Templates
=
append
(
f
.
Templates
,
*
template
)
f
.
ControllerRefs
=
append
(
f
.
ControllerRefs
,
*
controllerRef
)
...
...
@@ -920,7 +920,7 @@ func AddOrUpdateTaintOnNode(c clientset.Interface, nodeName string, taints ...*v
for
_
,
taint
:=
range
taints
{
curNewNode
,
ok
,
err
:=
taintutils
.
AddOrUpdateTaint
(
oldNodeCopy
,
taint
)
if
err
!=
nil
{
return
fmt
.
Errorf
(
"
Failed to update taint of node!
"
)
return
fmt
.
Errorf
(
"
failed to update taint of node
"
)
}
updated
=
updated
||
ok
newNode
=
curNewNode
...
...
@@ -977,7 +977,7 @@ func RemoveTaintOffNode(c clientset.Interface, nodeName string, node *v1.Node, t
for
_
,
taint
:=
range
taints
{
curNewNode
,
ok
,
err
:=
taintutils
.
RemoveTaint
(
oldNodeCopy
,
taint
)
if
err
!=
nil
{
return
fmt
.
Errorf
(
"
Failed to remove taint of node!
"
)
return
fmt
.
Errorf
(
"
failed to remove taint of node
"
)
}
updated
=
updated
||
ok
newNode
=
curNewNode
...
...
@@ -1021,7 +1021,7 @@ func WaitForCacheSync(controllerName string, stopCh <-chan struct{}, cacheSyncs
klog
.
Infof
(
"Waiting for caches to sync for %s controller"
,
controllerName
)
if
!
cache
.
WaitForCacheSync
(
stopCh
,
cacheSyncs
...
)
{
utilruntime
.
HandleError
(
fmt
.
Errorf
(
"
U
nable to sync caches for %s controller"
,
controllerName
))
utilruntime
.
HandleError
(
fmt
.
Errorf
(
"
u
nable to sync caches for %s controller"
,
controllerName
))
return
false
}
...
...
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