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
e9d8d0f5
Commit
e9d8d0f5
authored
Apr 01, 2019
by
Humble Chirammal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove some unwanted code blocks in controller_utils.go
Signed-off-by:
Humble Chirammal
<
hchiramm@redhat.com
>
parent
fd98e7ab
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
12 deletions
+13
-12
controller_utils.go
pkg/controller/controller_utils.go
+13
-12
No files found.
pkg/controller/controller_utils.go
View file @
e9d8d0f5
...
@@ -160,11 +160,11 @@ type ControllerExpectations struct {
...
@@ -160,11 +160,11 @@ type ControllerExpectations struct {
// GetExpectations returns the ControlleeExpectations of the given controller.
// GetExpectations returns the ControlleeExpectations of the given controller.
func
(
r
*
ControllerExpectations
)
GetExpectations
(
controllerKey
string
)
(
*
ControlleeExpectations
,
bool
,
error
)
{
func
(
r
*
ControllerExpectations
)
GetExpectations
(
controllerKey
string
)
(
*
ControlleeExpectations
,
bool
,
error
)
{
if
exp
,
exists
,
err
:=
r
.
GetByKey
(
controllerKey
);
err
==
nil
&&
exists
{
exp
,
exists
,
err
:=
r
.
GetByKey
(
controllerKey
)
if
err
==
nil
&&
exists
{
return
exp
.
(
*
ControlleeExpectations
),
true
,
nil
return
exp
.
(
*
ControlleeExpectations
),
true
,
nil
}
else
{
return
nil
,
false
,
err
}
}
return
nil
,
false
,
err
}
}
// DeleteExpectations deletes the expectations of the given controller from the TTLStore.
// DeleteExpectations deletes the expectations of the given controller from the TTLStore.
...
@@ -576,18 +576,19 @@ func (r RealPodControl) createPods(nodeName, namespace string, template *v1.PodT
...
@@ -576,18 +576,19 @@ func (r RealPodControl) createPods(nodeName, namespace string, template *v1.PodT
if
labels
.
Set
(
pod
.
Labels
)
.
AsSelectorPreValidated
()
.
Empty
()
{
if
labels
.
Set
(
pod
.
Labels
)
.
AsSelectorPreValidated
()
.
Empty
()
{
return
fmt
.
Errorf
(
"unable to create pods, no labels"
)
return
fmt
.
Errorf
(
"unable to create pods, no labels"
)
}
}
if
newPod
,
err
:=
r
.
KubeClient
.
CoreV1
()
.
Pods
(
namespace
)
.
Create
(
pod
);
err
!=
nil
{
newPod
,
err
:=
r
.
KubeClient
.
CoreV1
()
.
Pods
(
namespace
)
.
Create
(
pod
)
if
err
!=
nil
{
r
.
Recorder
.
Eventf
(
object
,
v1
.
EventTypeWarning
,
FailedCreatePodReason
,
"Error creating: %v"
,
err
)
r
.
Recorder
.
Eventf
(
object
,
v1
.
EventTypeWarning
,
FailedCreatePodReason
,
"Error creating: %v"
,
err
)
return
err
return
err
}
else
{
accessor
,
err
:=
meta
.
Accessor
(
object
)
if
err
!=
nil
{
klog
.
Errorf
(
"parentObject does not have ObjectMeta, %v"
,
err
)
return
nil
}
klog
.
V
(
4
)
.
Infof
(
"Controller %v created pod %v"
,
accessor
.
GetName
(),
newPod
.
Name
)
r
.
Recorder
.
Eventf
(
object
,
v1
.
EventTypeNormal
,
SuccessfulCreatePodReason
,
"Created pod: %v"
,
newPod
.
Name
)
}
}
accessor
,
err
:=
meta
.
Accessor
(
object
)
if
err
!=
nil
{
klog
.
Errorf
(
"parentObject does not have ObjectMeta, %v"
,
err
)
return
nil
}
klog
.
V
(
4
)
.
Infof
(
"Controller %v created pod %v"
,
accessor
.
GetName
(),
newPod
.
Name
)
r
.
Recorder
.
Eventf
(
object
,
v1
.
EventTypeNormal
,
SuccessfulCreatePodReason
,
"Created pod: %v"
,
newPod
.
Name
)
return
nil
return
nil
}
}
...
...
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