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
3ed8426a
Commit
3ed8426a
authored
Feb 24, 2016
by
Janet Kuo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
When calculating pod template hash, don't include the hash label
parent
96908d6d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
deployment.go
pkg/util/deployment/deployment.go
+6
-4
No files found.
pkg/util/deployment/deployment.go
View file @
3ed8426a
...
...
@@ -176,14 +176,16 @@ func rsAndPodsWithHashKeySynced(deployment extensions.Deployment, c clientset.In
func
addHashKeyToRSAndPods
(
deployment
extensions
.
Deployment
,
c
clientset
.
Interface
,
rs
extensions
.
ReplicaSet
,
getPodList
podListFunc
)
(
updatedRS
*
extensions
.
ReplicaSet
,
err
error
)
{
updatedRS
=
&
rs
// If the rs already has the new hash label in its selector, it's done syncing
if
labelsutil
.
SelectorHasLabel
(
rs
.
Spec
.
Selector
,
extensions
.
DefaultDeploymentUniqueLabelKey
)
{
return
}
namespace
:=
deployment
.
Namespace
meta
:=
rs
.
Spec
.
Template
.
ObjectMeta
meta
.
Labels
=
labelsutil
.
CloneAndRemoveLabel
(
meta
.
Labels
,
extensions
.
DefaultDeploymentUniqueLabelKey
)
hash
:=
fmt
.
Sprintf
(
"%d"
,
podutil
.
GetPodTemplateSpecHash
(
api
.
PodTemplateSpec
{
ObjectMeta
:
rs
.
Spec
.
Template
.
ObjectM
eta
,
ObjectMeta
:
m
eta
,
Spec
:
rs
.
Spec
.
Template
.
Spec
,
}))
if
labelsutil
.
SelectorHasLabel
(
rs
.
Spec
.
Selector
,
extensions
.
DefaultDeploymentUniqueLabelKey
)
{
return
}
// 1. Add hash template label to the rs. This ensures that any newly created pods will have the new label.
if
len
(
updatedRS
.
Spec
.
Template
.
Labels
[
extensions
.
DefaultDeploymentUniqueLabelKey
])
==
0
{
updatedRS
,
err
=
updateRSWithRetries
(
c
.
Extensions
()
.
ReplicaSets
(
namespace
),
updatedRS
,
func
(
updated
*
extensions
.
ReplicaSet
)
{
...
...
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