Skip to content

Commit

Permalink
Merge pull request #12 from openshift-kni/fix_rb
Browse files Browse the repository at this point in the history
manifests: fix rolebinding
  • Loading branch information
Tal-or authored Jul 2, 2023
2 parents 08645e0 + 605ad7f commit 7469c12
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/manifests/manifests.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ func updateServiceAccountInfo(mf *Manifests) {

mf.DS.Spec.Template.Spec.ServiceAccountName = saName
mf.RB.Subjects[0].Namespace = saNS
mf.RB.Subjects[0].Name = saNS
mf.RB.Subjects[0].Name = saName

sa := saName
if saNS != "" {
Expand Down
6 changes: 6 additions & 0 deletions pkg/manifests/manifests_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,4 +140,10 @@ func TestGet(t *testing.T) {
if mf.DS.Name != "foo" {
t.Errorf("%q object name should be equal to foo", mf.DS.Kind)
}
if mf.RB.Subjects[0].Name != mf.SA.Name {
t.Errorf("%q -> subject[0] -> name should be equal to %s", mf.RB.Kind, mf.SA.Name)
}
if mf.RB.Subjects[0].Namespace != mf.SA.Namespace {
t.Errorf("%q -> subject[0] -> namespace should be equal to %s", mf.RB.Kind, mf.SA.Namespace)
}
}

0 comments on commit 7469c12

Please sign in to comment.