-
Notifications
You must be signed in to change notification settings - Fork 430
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
Validate providerID for user-assigned IDs in webhook #3618
Validate providerID for user-assigned IDs in webhook #3618
Conversation
} | ||
for _, identity := range userAssignedIdentities { | ||
if identity.ProviderID != "" { | ||
if _, err := arm.ParseResourceID(strings.TrimPrefix(identity.ProviderID, "azure://")); err != nil { |
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.
We can't use the azure.ParseResourceID()
func added in #3616 because it would cause a circular import 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.
The azure.go file itself doesn't import the api
package, I wonder if we should move all azure "util" functions to its own package so we can use the same logic in both places
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.
@mboersma thoughts on this?
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.
Yes, I actually tried moving the ParseResourceID()
function to util/azure
and that would work. I'll try to update this PR later today.
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #3618 +/- ##
==========================================
- Coverage 53.73% 53.62% -0.11%
==========================================
Files 185 185
Lines 18589 18554 -35
==========================================
- Hits 9988 9949 -39
- Misses 8059 8063 +4
Partials 542 542
☔ View full report in Codecov by Sentry. |
/lgtm |
LGTM label has been added. Git tree hash: 8530d3e60adc4844637313779ba212f8aec239a9
|
/milestone v1.10 |
0451032
to
d7a5b34
Compare
/hold I rebased this on #3612 so moving Edit: re-rebased, but kept as two commits for now, pending review. |
d7a5b34
to
ddd2641
Compare
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.
/lgtm
LGTM label has been added. Git tree hash: d8769afe6e58020cde9d2fecd67043f8d8a62add
|
ddd2641
to
8e39922
Compare
/hold cancel |
/lgtm |
LGTM label has been added. Git tree hash: a1fb2c71aaf86ad764fbe2d9b5c870c132e168c3
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: CecileRobertMichon The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind bug
What this PR does / why we need it:
Adds
ProviderID
to the validation of user-assigned identities called by the AzureMachine webhook. Also movesParseResourceID()
toutil/azure
to avoid circular import errors.Which issue(s) this PR fixes:
Inspired by this comment.
Refs #3597
Special notes for your reviewer:
TODOs:
Release note: