Skip to content
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

Azure gov client changes #1249

Merged
merged 3 commits into from
Feb 16, 2022
Merged

Azure gov client changes #1249

merged 3 commits into from
Feb 16, 2022

Conversation

bathina2
Copy link
Contributor

@bathina2 bathina2 commented Feb 16, 2022

Change Overview

The following PR takes the environment name config value and uses it to set the other environment variables. It also allows the other provided config values to override these.

We also need to uses the WithBaseURI versions of calls to create clients. This will ensure the client points to the right endpoint.

Pull request type

Please check the type of change your PR introduces:

  • 🚧 Work in Progress
  • 🌈 Refactoring (no functional changes, no api changes)
  • 🐹 Trivial/Minor
  • 🐛 Bugfix
  • 🌻 Feature
  • 🗺️ Documentation
  • 🤖 Test

Issues

  • #XXX

Test Plan

  • 💪 Manual
  • ⚡ Unit test
  • 💚 E2E

Copy link
Contributor

@onkarbhat onkarbhat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Minor comment about a unit test.

@@ -118,12 +116,12 @@ func getAuthorizer(env azure.Environment, config map[string]string) (*autorest.B
}

credConfig := auth.NewClientCredentialsConfig(clientID, clientSecret, tenantID)
if aDDEndpoint, ok := config[blockstorage.AzureActiveDirEndpoint]; ok {
credConfig.AADEndpoint = aDDEndpoint
if credConfig.AADEndpoint, ok = config[blockstorage.AzureActiveDirEndpoint]; !ok {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add unit tests to verify this logic where we default to env.Something if ok is false, and verify that we use the config passed in config[some field] when ok is true ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea I'm trying to find a way to unit test this

@bathina2 bathina2 added the kueue label Feb 16, 2022
@mergify mergify bot merged commit 393d6c6 into master Feb 16, 2022
@mergify mergify bot deleted the azure_gov_client branch February 16, 2022 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants