Skip to content

Commit 8142a99

Browse files
authored
Merge branch 'argoproj-labs:master' into agent-service
2 parents 62f651b + ec9f0aa commit 8142a99

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

controllers/argocd/rolebinding.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ func newRoleBindingWithNameForApplicationSourceNamespaces(namespace string, cr *
342342
roleBinding := newRoleBindingForSupportNamespaces(cr, namespace)
343343

344344
labels := roleBinding.Labels
345-
labels[common.ArgoCDKeyName] = roleBinding.Name
345+
labels[common.ArgoCDKeyName] = cr.Name
346346
roleBinding.Labels = labels
347347

348348
return roleBinding

controllers/argocd/rolebinding_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,3 +477,9 @@ func TestTruncateWithHashUniqueness(t *testing.T) {
477477
assert.LessOrEqual(t, len(result), maxLabelLength, "Result should not exceed maxLabelLength")
478478
}
479479
}
480+
481+
func Test_newRoleBindingWithNameForApplicationSourceNamespaces(t *testing.T) {
482+
cr := makeTestArgoCD()
483+
roleBinding := newRoleBindingWithNameForApplicationSourceNamespaces("test", cr)
484+
assert.Equal(t, roleBinding.Labels["app.kubernetes.io/name"], "argocd")
485+
}

0 commit comments

Comments
 (0)