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
026638af
Commit
026638af
authored
Apr 28, 2017
by
zhangxiaoyu-zidif
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stateful_pod_control.go: format the code
parent
acca01bc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
8 deletions
+5
-8
stateful_pod_control.go
pkg/controller/statefulset/stateful_pod_control.go
+5
-8
No files found.
pkg/controller/statefulset/stateful_pod_control.go
View file @
026638af
...
...
@@ -112,18 +112,17 @@ func (spc *realStatefulPodControl) UpdateStatefulPod(set *apps.StatefulSet, pod
return
err
}
}
// if the Pod is not dirty do nothing
// if the Pod is not dirty
,
do nothing
if
consistent
{
return
nil
}
attemptedUpdate
=
true
// commit the update, retrying on conflicts
_
,
e
rr
:=
spc
.
client
.
Core
()
.
Pods
(
set
.
Namespace
)
.
Update
(
pod
)
if
e
rr
==
nil
{
_
,
updateE
rr
:=
spc
.
client
.
Core
()
.
Pods
(
set
.
Namespace
)
.
Update
(
pod
)
if
updateE
rr
==
nil
{
return
nil
}
updateErr
:=
err
if
updated
,
err
:=
spc
.
podLister
.
Pods
(
set
.
Namespace
)
.
Get
(
pod
.
Name
);
err
==
nil
{
// make a copy so we don't mutate the shared cache
...
...
@@ -154,13 +153,11 @@ func (spc *realStatefulPodControl) UpdateStatefulSetStatus(set *apps.StatefulSet
return
retry
.
RetryOnConflict
(
retry
.
DefaultBackoff
,
func
()
error
{
set
.
Status
.
Replicas
=
replicas
set
.
Status
.
ObservedGeneration
=
&
generation
_
,
e
rr
:=
spc
.
client
.
Apps
()
.
StatefulSets
(
set
.
Namespace
)
.
UpdateStatus
(
set
)
if
e
rr
==
nil
{
_
,
updateE
rr
:=
spc
.
client
.
Apps
()
.
StatefulSets
(
set
.
Namespace
)
.
UpdateStatus
(
set
)
if
updateE
rr
==
nil
{
return
nil
}
updateErr
:=
err
if
updated
,
err
:=
spc
.
setLister
.
StatefulSets
(
set
.
Namespace
)
.
Get
(
set
.
Name
);
err
==
nil
{
// make a copy so we don't mutate the shared cache
if
copy
,
err
:=
scheme
.
Scheme
.
DeepCopy
(
updated
);
err
==
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