Skip to content

Commit

Permalink
use UsesWorkloadIdentity() helper function instead of bespoke check
Browse files Browse the repository at this point in the history
  • Loading branch information
yithian committed Aug 6, 2024
1 parent 2cea8eb commit d5f333c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/cluster/denyassignment.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func (m *manager) createOrUpdateDenyAssignment(ctx context.Context) error {
}

// needed for AdminUpdate so it would not block other steps
if m.doc.OpenShiftCluster.Properties.ServicePrincipalProfile == nil && m.doc.OpenShiftCluster.Properties.PlatformWorkloadIdentityProfile == nil {
if !m.doc.OpenShiftCluster.UsesWorkloadIdentity() && m.doc.OpenShiftCluster.Properties.ServicePrincipalProfile.SPObjectID == "" {
m.log.Print("skipping createOrUpdateDenyAssignment: ServicePrincipalProfile and PlatformWorkloadIdentityProfile are empty")
return nil
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/cluster/deploybaseresources_additional.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (

func (m *manager) denyAssignment() *arm.Resource {
excludePrincipals := []mgmtauthorization.Principal{}
if m.doc.OpenShiftCluster.Properties.PlatformWorkloadIdentityProfile != nil && m.doc.OpenShiftCluster.Properties.ServicePrincipalProfile == nil {
if m.doc.OpenShiftCluster.UsesWorkloadIdentity() {
for _, identity := range m.doc.OpenShiftCluster.Properties.PlatformWorkloadIdentityProfile.PlatformWorkloadIdentities {
excludePrincipals = append(excludePrincipals, mgmtauthorization.Principal{
ID: &identity.ObjectID,
Expand Down

0 comments on commit d5f333c

Please sign in to comment.