mirror of
https://github.com/fluxcd/flagger.git
synced 2026-04-15 06:57:34 +00:00
fix the incorrect primary label value
This commit is contained in:
@@ -215,6 +215,7 @@ func (c *DaemonSetController) createPrimaryDaemonSet(cd *flaggerv1.Canary) error
|
||||
}
|
||||
|
||||
label, labelValue, err := c.getSelectorLabel(canaryDae)
|
||||
primaryLabelValue := fmt.Sprintf("%s-primary", labelValue);
|
||||
if err != nil {
|
||||
return fmt.Errorf("getSelectorLabel failed: %w", err)
|
||||
}
|
||||
@@ -240,7 +241,7 @@ func (c *DaemonSetController) createPrimaryDaemonSet(cd *flaggerv1.Canary) error
|
||||
Name: primaryName,
|
||||
Namespace: cd.Namespace,
|
||||
Labels: map[string]string{
|
||||
label: labelValue,
|
||||
label: primaryLabelValue,
|
||||
},
|
||||
OwnerReferences: []metav1.OwnerReference{
|
||||
*metav1.NewControllerRef(cd, schema.GroupVersionKind{
|
||||
@@ -256,12 +257,12 @@ func (c *DaemonSetController) createPrimaryDaemonSet(cd *flaggerv1.Canary) error
|
||||
UpdateStrategy: canaryDae.Spec.UpdateStrategy,
|
||||
Selector: &metav1.LabelSelector{
|
||||
MatchLabels: map[string]string{
|
||||
label: labelValue,
|
||||
label: primaryLabelValue,
|
||||
},
|
||||
},
|
||||
Template: corev1.PodTemplateSpec{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Labels: makePrimaryLabels(canaryDae.Spec.Template.Labels, labelValue, label),
|
||||
Labels: makePrimaryLabels(canaryDae.Spec.Template.Labels, primaryLabelValue, label),
|
||||
Annotations: annotations,
|
||||
},
|
||||
// update spec with the primary secrets and config maps
|
||||
|
||||
@@ -211,6 +211,7 @@ func (c *DeploymentController) createPrimaryDeployment(cd *flaggerv1.Canary) err
|
||||
}
|
||||
|
||||
label, labelValue, err := c.getSelectorLabel(canaryDep)
|
||||
primaryLabelValue := fmt.Sprintf("%s-primary", labelValue);
|
||||
if err != nil {
|
||||
return fmt.Errorf("getSelectorLabel failed: %w", err)
|
||||
}
|
||||
@@ -241,7 +242,7 @@ func (c *DeploymentController) createPrimaryDeployment(cd *flaggerv1.Canary) err
|
||||
Name: primaryName,
|
||||
Namespace: cd.Namespace,
|
||||
Labels: map[string]string{
|
||||
label: labelValue,
|
||||
label: primaryLabelValue,
|
||||
},
|
||||
OwnerReferences: []metav1.OwnerReference{
|
||||
*metav1.NewControllerRef(cd, schema.GroupVersionKind{
|
||||
@@ -259,12 +260,12 @@ func (c *DeploymentController) createPrimaryDeployment(cd *flaggerv1.Canary) err
|
||||
Strategy: canaryDep.Spec.Strategy,
|
||||
Selector: &metav1.LabelSelector{
|
||||
MatchLabels: map[string]string{
|
||||
label: labelValue,
|
||||
label: primaryLabelValue,
|
||||
},
|
||||
},
|
||||
Template: corev1.PodTemplateSpec{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Labels: makePrimaryLabels(canaryDep.Spec.Template.Labels, primaryName, label),
|
||||
Labels: makePrimaryLabels(canaryDep.Spec.Template.Labels, primaryLabelValue, label),
|
||||
Annotations: annotations,
|
||||
},
|
||||
// update spec with the primary secrets and config maps
|
||||
|
||||
Reference in New Issue
Block a user