-
Notifications
You must be signed in to change notification settings - Fork 431
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
Replace more usages of go-autorest #4775
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4775 +/- ##
==========================================
+ Coverage 62.35% 62.44% +0.08%
==========================================
Files 196 196
Lines 16192 16140 -52
==========================================
- Hits 10097 10079 -18
+ Misses 5362 5328 -34
Partials 733 733 ☔ View full report in Codecov by Sentry. |
@@ -40,7 +37,6 @@ const AzureSecretKey = "clientSecret" | |||
|
|||
// CredentialsProvider defines the behavior for azure identity based credential providers. | |||
type CredentialsProvider interface { | |||
GetAuthorizer(ctx context.Context, tokenCredential azcore.TokenCredential, tokenAudience string) (autorest.Authorizer, 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.
My dumb grep also shows this which isn't strictly related I don't think, but is also unused AFAICT:
cluster-api-provider-azure/util/azure/azure.go
Lines 75 to 76 in d139d07
// GetAuthorizer returns an autorest.Authorizer-compatible object from MSAL. | |
func GetAuthorizer(settings auth.EnvironmentSettings) (autorest.Authorizer, 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.
also this?
func getCloudConfig(environment azureautorest.Environment) cloud.Configuration { |
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.
Your dumb grep is smarter than I was--thanks! Love to remove dead code.
@@ -47,23 +45,23 @@ func (c *AzureClients) CloudEnvironment() string { | |||
|
|||
// TenantID returns the Azure tenant id the controller runs in. | |||
func (c *AzureClients) TenantID() string { | |||
return c.Values[auth.TenantID] | |||
return c.Values["AZURE_TENANT_ID"] |
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.
I feel like I should technically point out that constants for these would be good, but since the SDK doesn't even expose these that I can find, I'm not gonna push to do that here.
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, it's frustrating that there aren't any constants for these in the SDK. We could define them locally, but I didn't see a good common package to house them at first glance.
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
/approve
/hold for squash
LGTM label has been added. Git tree hash: 9b9f80b62c13dfd7b68315770c619194e5dc3623
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: nojnhuh 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 |
cd515ec
to
b6e2153
Compare
/hold cancel Rebased. |
/lgtm |
LGTM label has been added. Git tree hash: d842a13ecf820af08f49e3ff900cf163c596a0c5
|
github issue + transient regional capacity issue: |
/retest |
/kind cleanup
What this PR does / why we need it:
Replaces several usages of the deprecated Azure/go-autorest library.
Which issue(s) this PR fixes:
Refs #2974
Special notes for your reviewer:
There's more to do still, but this moves the ball forward.
TODOs:
Release note: