Skip to content

Commit

Permalink
Fix cluster namespace label to avoid conflict with propagator
Browse files Browse the repository at this point in the history
Signed-off-by: Will Kutler <wkutler@redhat.com>
  • Loading branch information
willkutler committed Mar 13, 2023
1 parent 78a1dfa commit 2c8fb86
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions controllers/templatesync/template_sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -504,8 +504,8 @@ func (r *PolicyReconciler) Reconcile(ctx context.Context, request reconcile.Requ

labels["cluster-name"] = instance.GetLabels()[common.ClusterNameLabel]
labels[common.ClusterNameLabel] = instance.GetLabels()[common.ClusterNameLabel]
labels["cluster-namespace"] = instance.GetLabels()[common.ClusterNamespaceLabel]
labels[common.ClusterNamespaceLabel] = instance.GetLabels()[common.ClusterNamespaceLabel]
labels["cluster-namespace"] = r.ClusterNamespace
labels[common.ClusterNamespaceLabel] = r.ClusterNamespace

// Set label to identify parent policy for this template object
labels[utils.ParentPolicyLabel] = instance.GetName()
Expand Down Expand Up @@ -840,11 +840,11 @@ func (r *PolicyReconciler) setDefaultTemplateLabels(instance *policiesv1.Policy,
}

desiredLabels := map[string]string{
parentPolicyLabel: instance.GetName(),
utils.ParentPolicyLabel: instance.GetName(),
"cluster-name": instance.GetLabels()[common.ClusterNameLabel],
common.ClusterNameLabel: instance.GetLabels()[common.ClusterNameLabel],
"cluster-namespace": r.ClusterNamespace,
common.ClusterNamespaceLabel: instance.GetLabels()[common.ClusterNamespaceLabel],
common.ClusterNamespaceLabel: r.ClusterNamespace,
}

for key, label := range desiredLabels {
Expand Down

0 comments on commit 2c8fb86

Please sign in to comment.