mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-14 13:45:06 +00:00
Update the re-fetched pod with deployment labels.
This commit is contained in:
@@ -248,8 +248,8 @@ func labelPodsWithHash(podList *api.PodList, c clientset.Interface, namespace, h
|
|||||||
for _, pod := range podList.Items {
|
for _, pod := range podList.Items {
|
||||||
// Only label the pod that doesn't already have the new hash
|
// Only label the pod that doesn't already have the new hash
|
||||||
if pod.Labels[extensions.DefaultDeploymentUniqueLabelKey] != hash {
|
if pod.Labels[extensions.DefaultDeploymentUniqueLabelKey] != hash {
|
||||||
if _, err := updatePodWithRetries(c.Core().Pods(namespace), &pod, func(updated *api.Pod) {
|
if _, err := updatePodWithRetries(c.Core().Pods(namespace), &pod, func(podToUpdate *api.Pod) {
|
||||||
pod.Labels = labelsutil.AddLabel(pod.Labels, extensions.DefaultDeploymentUniqueLabelKey, hash)
|
podToUpdate.Labels = labelsutil.AddLabel(podToUpdate.Labels, extensions.DefaultDeploymentUniqueLabelKey, hash)
|
||||||
}); err != nil {
|
}); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user