mirror of
https://github.com/fluxcd/flagger.git
synced 2026-04-15 06:57:34 +00:00
fix incorrect primary label value during promotion
This commit is contained in:
@@ -108,6 +108,7 @@ func (c *DaemonSetController) Promote(cd *flaggerv1.Canary) error {
|
||||
}
|
||||
|
||||
label, labelValue, err := c.getSelectorLabel(canary)
|
||||
primaryLabelValue := fmt.Sprintf("%s-primary", labelValue);
|
||||
if err != nil {
|
||||
return fmt.Errorf("getSelectorLabel failed: %w", err)
|
||||
}
|
||||
@@ -146,7 +147,7 @@ func (c *DaemonSetController) Promote(cd *flaggerv1.Canary) error {
|
||||
}
|
||||
|
||||
primaryCopy.Spec.Template.Annotations = annotations
|
||||
primaryCopy.Spec.Template.Labels = makePrimaryLabels(canary.Spec.Template.Labels, labelValue, label)
|
||||
primaryCopy.Spec.Template.Labels = makePrimaryLabels(canary.Spec.Template.Labels, primaryLabelValue, label)
|
||||
|
||||
// apply update
|
||||
_, err = c.kubeClient.AppsV1().DaemonSets(cd.Namespace).Update(context.TODO(), primaryCopy, metav1.UpdateOptions{})
|
||||
|
||||
@@ -73,6 +73,7 @@ func (c *DeploymentController) Promote(cd *flaggerv1.Canary) error {
|
||||
}
|
||||
|
||||
label, labelValue, err := c.getSelectorLabel(canary)
|
||||
primaryLabelValue := fmt.Sprintf("%s-primary", labelValue);
|
||||
if err != nil {
|
||||
return fmt.Errorf("getSelectorLabel failed: %w", err)
|
||||
}
|
||||
@@ -107,7 +108,7 @@ func (c *DeploymentController) Promote(cd *flaggerv1.Canary) error {
|
||||
}
|
||||
|
||||
primaryCopy.Spec.Template.Annotations = annotations
|
||||
primaryCopy.Spec.Template.Labels = makePrimaryLabels(canary.Spec.Template.Labels, labelValue, label)
|
||||
primaryCopy.Spec.Template.Labels = makePrimaryLabels(canary.Spec.Template.Labels, primaryLabelValue, label)
|
||||
|
||||
// apply update
|
||||
_, err = c.kubeClient.AppsV1().Deployments(cd.Namespace).Update(context.TODO(), primaryCopy, metav1.UpdateOptions{})
|
||||
|
||||
Reference in New Issue
Block a user