-
Notifications
You must be signed in to change notification settings - Fork 174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix unexpected workload identity update in workload identity clusters #3973
base: master
Are you sure you want to change the base?
Conversation
pkg/util/platformworkloadidentity/platformworkloadidentityrolesbyversion.go
Show resolved
Hide resolved
6ebcba3
to
00903b2
Compare
00903b2
to
88b34b0
Compare
/azp run ci |
Azure Pipelines successfully started running 1 pipeline(s). |
Please rebase pull request. |
…reate/update flows
…dentityRoleSets
88b34b0
to
3d66fea
Compare
if oc.UsesWorkloadIdentity() { | ||
if err := f.validatePlatformWorkloadIdentities(oc); err != nil { | ||
return api.ValidationResult{ | ||
Status: api.ValidationStatusFailed, | ||
Error: &api.CloudErrorBody{ | ||
Code: api.CloudErrorCodeInvalidParameter, | ||
Message: err.Error(), | ||
}, | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a nice to have, since we only expect one return here, is it not possible to simplify to just one "if" condition or create a guard clause instead of nesting another "if" condition?
e.g. if oc.UsesWorkloadIdentity() && f.validatePlatformWorkloadIdentities(oc) != nil
Which issue this PR addresses:
Fixes ARO-12514
What this PR does / why we need it:
Test plan for issue:
[x] Unit tests added/updated for the above implementation
[x] Create/Update MIWI cluster in local
[x] CI
[x] e2e
Is there any documentation that needs to be updated for this PR?
Not yet.
How do you know this will function as expected in production?
Feature is not in production yet.