Safe encode template hash value to make it consistent with resource name

This commit is contained in:
Janet Kuo
2018-07-11 17:01:38 -07:00
parent 24ee75e265
commit 666a41c2ea
10 changed files with 23 additions and 20 deletions

View File

@@ -167,7 +167,7 @@ func newPod(podName string, nodeName string, label map[string]string, ds *apps.D
var podSpec v1.PodSpec
// Copy pod spec from DaemonSet template, or use a default one if DaemonSet is nil
if ds != nil {
hash := fmt.Sprint(controller.ComputeHash(&ds.Spec.Template, ds.Status.CollisionCount))
hash := controller.ComputeHash(&ds.Spec.Template, ds.Status.CollisionCount)
newLabels = labelsutil.CloneAndAddLabel(label, apps.DefaultDaemonSetUniqueLabelKey, hash)
podSpec = ds.Spec.Template.Spec
} else {