-
Notifications
You must be signed in to change notification settings - Fork 41
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
Use correct cloud environment in azcore client #3799
Conversation
7764f12
to
cb21f55
Compare
Does the PR have any schema changes?Looking good! No breaking changes found. |
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.
Thanks for adding the tests, lgtm!
One possible typo.
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.
Looks good to me!
envName := a.Environment | ||
env, err := azureEnv.EnvironmentFromName(envName) | ||
if err != nil { | ||
env, err = azureEnv.EnvironmentFromName(fmt.Sprintf("AZURE%sCLOUD", envName)) |
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.
It seems like they're planning to deprecate that format to some extent. They have a //TODO: deprecate
comment next to AZUREUSGOVERNMENTCLOUD
. https://github.com/Azure/go-autorest/blob/f7ea664c9cff3a5257b6dbc4402acadfd8be79f1/autorest/azure/environments.go#L38C3-L39
I only found Azure/go-autorest#624 which seems to allude to them not being able to change it any time soon
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're actually going to remove this whole code soon-ish, since Autorest is deprecated.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3799 +/- ##
=======================================
Coverage 56.99% 57.00%
=======================================
Files 78 78
Lines 12029 12035 +6
=======================================
+ Hits 6856 6860 +4
- Misses 4674 4675 +1
- Partials 499 500 +1 ☔ View full report in Codecov by Sentry. |
This PR has been shipped in release v2.78.0. |
When instantiating the new azcore-based Azure client, the cloud environment (public, usgov, etc.) was looked up in a wrong way. Since it defaults to "public", it didn't error and worked for most users. This PR refactors and adds more tests for more solid coverage.
Fixes #3795.