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
0867e250
Commit
0867e250
authored
Mar 01, 2016
by
Brian Grant
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #22326 from janetkuo/only-increase-revision
RS revision number should only be updated when necessary
parents
4b213ed2
67bfe5d7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
deployment_controller.go
pkg/controller/deployment/deployment_controller.go
+3
-3
No files found.
pkg/controller/deployment/deployment_controller.go
View file @
0867e250
...
@@ -758,7 +758,7 @@ func setNewReplicaSetAnnotations(deployment *extensions.Deployment, rs *extensio
...
@@ -758,7 +758,7 @@ func setNewReplicaSetAnnotations(deployment *extensions.Deployment, rs *extensio
if
rs
.
Annotations
==
nil
{
if
rs
.
Annotations
==
nil
{
rs
.
Annotations
=
make
(
map
[
string
]
string
)
rs
.
Annotations
=
make
(
map
[
string
]
string
)
}
}
if
rs
.
Annotations
[
deploymentutil
.
RevisionAnnotation
]
!=
newRevision
{
if
rs
.
Annotations
[
deploymentutil
.
RevisionAnnotation
]
<
newRevision
{
rs
.
Annotations
[
deploymentutil
.
RevisionAnnotation
]
=
newRevision
rs
.
Annotations
[
deploymentutil
.
RevisionAnnotation
]
=
newRevision
annotationChanged
=
true
annotationChanged
=
true
glog
.
V
(
4
)
.
Infof
(
"updating replica set %q's revision to %s - %+v
\n
"
,
rs
.
Name
,
newRevision
,
rs
)
glog
.
V
(
4
)
.
Infof
(
"updating replica set %q's revision to %s - %+v
\n
"
,
rs
.
Name
,
newRevision
,
rs
)
...
@@ -774,10 +774,10 @@ func copyDeploymentAnnotationsToReplicaSet(deployment *extensions.Deployment, rs
...
@@ -774,10 +774,10 @@ func copyDeploymentAnnotationsToReplicaSet(deployment *extensions.Deployment, rs
rs
.
Annotations
=
make
(
map
[
string
]
string
)
rs
.
Annotations
=
make
(
map
[
string
]
string
)
}
}
for
k
,
v
:=
range
deployment
.
Annotations
{
for
k
,
v
:=
range
deployment
.
Annotations
{
// Skip apply annotations
// Skip apply annotations
and revision annotations
// TODO: How to decide which annotations should / should not be copied?
// TODO: How to decide which annotations should / should not be copied?
// See https://github.com/kubernetes/kubernetes/pull/20035#issuecomment-179558615
// See https://github.com/kubernetes/kubernetes/pull/20035#issuecomment-179558615
if
k
==
kubectl
.
LastAppliedConfigAnnotation
||
rs
.
Annotations
[
k
]
==
v
{
if
k
==
kubectl
.
LastAppliedConfigAnnotation
||
k
==
deploymentutil
.
RevisionAnnotation
||
rs
.
Annotations
[
k
]
==
v
{
continue
continue
}
}
rs
.
Annotations
[
k
]
=
v
rs
.
Annotations
[
k
]
=
v
...
...
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