Skip to content

Commit

Permalink
Add FPSP to MIWI deny assignment ExcludePrincipals
Browse files Browse the repository at this point in the history
  • Loading branch information
kimorris27 authored and cadenmarchese committed Dec 2, 2024
1 parent 51df910 commit 90981dd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions pkg/cluster/deploybaseresources_additional.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ func (m *manager) denyAssignment() *arm.Resource {
Type: to.StringPtr(string(mgmtauthorization.ServicePrincipal)),
})
}
excludePrincipals = append(excludePrincipals, mgmtauthorization.Principal{
ID: ptr.To(m.fpServicePrincipalID),
Type: ptr.To(string(mgmtauthorization.ServicePrincipal)),
})
} else {
excludePrincipals = append(excludePrincipals, mgmtauthorization.Principal{
ID: &m.doc.OpenShiftCluster.Properties.ServicePrincipalProfile.SPObjectID,
Expand Down
7 changes: 6 additions & 1 deletion pkg/cluster/deploybaseresources_additional_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ import (

func TestDenyAssignment(t *testing.T) {
m := &manager{
log: logrus.NewEntry(logrus.StandardLogger()),
log: logrus.NewEntry(logrus.StandardLogger()),
fpServicePrincipalID: "77777777-7777-7777-7777-777777777777",
}

tests := []struct {
Expand Down Expand Up @@ -86,6 +87,10 @@ func TestDenyAssignment(t *testing.T) {
ID: to.StringPtr("88888888-8888-8888-8888-888888888888"),
Type: to.StringPtr(string(mgmtauthorization.ServicePrincipal)),
},
{
ID: to.StringPtr("77777777-7777-7777-7777-777777777777"),
Type: to.StringPtr(string(mgmtauthorization.ServicePrincipal)),
},
},
},
}
Expand Down

0 comments on commit 90981dd

Please sign in to comment.