Update the re-fetched pod with deployment labels.

This commit is contained in:
Prashanth Balasubramanian
2016-03-01 11:47:53 -08:00
parent 577eb94c68
commit b9eb552e07

View File

@@ -248,8 +248,8 @@ func labelPodsWithHash(podList *api.PodList, c clientset.Interface, namespace, h
for _, pod := range podList.Items {
// Only label the pod that doesn't already have the new hash
if pod.Labels[extensions.DefaultDeploymentUniqueLabelKey] != hash {
if _, err := updatePodWithRetries(c.Core().Pods(namespace), &pod, func(updated *api.Pod) {
pod.Labels = labelsutil.AddLabel(pod.Labels, extensions.DefaultDeploymentUniqueLabelKey, hash)
if _, err := updatePodWithRetries(c.Core().Pods(namespace), &pod, func(podToUpdate *api.Pod) {
podToUpdate.Labels = labelsutil.AddLabel(podToUpdate.Labels, extensions.DefaultDeploymentUniqueLabelKey, hash)
}); err != nil {
return err
}