-
Notifications
You must be signed in to change notification settings - Fork 220
CORS-2467: dns: azure: use azidentity with an adapter #846
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
CORS-2467: dns: azure: use azidentity with an adapter #846
Conversation
14e683d to
8e2fe2e
Compare
|
/retitle dns: azure: use azidentity with an adapter |
|
Fixed a typo |
|
Context for this change: https://issues.redhat.com/browse/CORS-2467 |
|
/retitle CORS-2467: dns: azure: use azidentity with an adapter |
| switch config.Environment { | ||
| case azure.ChinaCloud: | ||
| cloudConfig = cloud.AzureChina | ||
| // GermanCloud was closed on Oct 29, 2021 |
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.
Do we have any CI jobs that still expect the GermanCloud region/zone to be present?
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 didn't find anything in openshift/release.
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.
But I can un-comment it if you think it's safer.
pkg/dns/azure/client/auth.go
Outdated
|
|
||
| scope := config.Environment.TokenAudience | ||
| if !strings.HasPrefix(scope, "/.default") { | ||
| if !strings.HasSuffix(scope, "/.default") { |
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.
Can we create a unit test case at all -- something that would have caught this change up front?
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.
A unit test for getAuthorizerForResource or do you mean to extract this part out into a function and write some unit tests for that?
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.
A bit of both; if we had a test (or had written a test) would we have discovered the need to use HasSuffix (over HasPrefix) because the test would have failed upfront.
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.
Done
| config.Environment.ActiveDirectoryEndpoint, config.TenantID) | ||
| var cloudConfig cloud.Configuration | ||
| switch config.Environment { | ||
| case azure.ChinaCloud: |
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.
Is there a reason this logic flow differs from https://github.com/r4f4/installer/blob/897b6226e87ec5c9e25c0c952b7f6a301204fe67/pkg/asset/installconfig/azure/session.go#L73-L89? The default here is AzureStackCloud, but the default in openshift/installer is AzurePublic.
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.
No particular reason other than I was changing the Installer code a lot during my testing of AzureStack and figuring out how to get it to work. I can change this to make it like the Installer's if you prefer.
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 have no preference, just wanted to make sure there it isn't supposed to be exactly the same. As long as it works as expected.
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.
Hmm, sorry. I've done quite a few of these so I'm getting them mixed up. In this case there was a simple reason for the swap of Public <-> Stack: autorest doesn't define azure.StackCloud [1]. In the installer, we have our own definition for the cloud environments [2]. So to get around that, I've left StackCloud as the last branch.
[1] https://github.com/Azure/go-autorest/blob/main/autorest/azure/environments.go#L34-L41
[2] https://github.com/openshift/installer/blob/master/pkg/types/azure/platform.go#L95-L110
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.
Okay seems reasonable, thanks.
|
/hold |
|
/lgtm |
|
my lgtm didn't get applied |
|
@r4f4 I think we need a bug like https://issues.redhat.com/browse/OCPBUGS-4541 for this. Would you mind making it? |
|
/retitle OCPBUGS-6863: dns: azure: use azidentity with an adapter |
|
@r4f4: This pull request references Jira Issue OCPBUGS-6863, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
/jira refresh |
|
@r4f4, can you rebase this PR again? |
70089bd to
ad45e7d
Compare
|
Rebased to fix merge conflicts. |
|
/label px-approved |
|
/label qe-approved |
|
@lihongan: The label(s) DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
/label qe-approved |
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Miciah The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
Looks good to me, but we are going to wait on #890 to get merged, which will most likely cause a rebase, and we can proceed from there. |
|
/label docs-approved |
ADAL will be deprecated in Dec 2022. Let's move to azidentity with an adapter so the new authentication can work the V1 clients.
ad45e7d to
82c6757
Compare
|
/retest-required |
|
@r4f4: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
|
/lgtm |
Similar work to what I've been doing for the openshift-installer openshift/installer#6003
Marking as WIP while I figure out why it's not working with AzureStack.