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

fix(azure): sovereign cloud support #3942

Merged

Conversation

jbpaux
Copy link
Contributor

@jbpaux jbpaux commented Sep 18, 2023

Description

The old implementation allowed use of alternative Azure Clouds (Azure China, Azure Gov etc.)
With the changes to the new SDK, the other clouds were partially implemented : the authentication to the other clouds was working but the calls to the management endpoints to create/delete records was only targeting public Azure Cloud.
This PR aims to fix this bug.
To test it, an access to an sovereign cloud is required. The requestor who filled the issue has access to one and validated the fix.

Fixes #3927

Checklist

  • Unit tests updated
  • End user documentation updated

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Sep 18, 2023
@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Sep 18, 2023
@k8s-ci-robot
Copy link
Contributor

Hi @jbpaux. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Sep 18, 2023
@johngmyers
Copy link
Contributor

Would it make sense to extract the construction of the arm.ClientOptions into a method?
/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Sep 19, 2023
@miwithro
Copy link

@johngmyers @njuettner can we get this over the finish line. This is blocking some gov customers.

@mloiseleur
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 26, 2023
@mloiseleur
Copy link
Contributor

/retitle fix(azure): sovereign cloud support

@k8s-ci-robot k8s-ci-robot changed the title fix(azure) sovereign cloud support fix(azure): sovereign cloud support Sep 26, 2023
@jbpaux
Copy link
Contributor Author

jbpaux commented Sep 26, 2023

Would it make sense to extract the construction of the arm.ClientOptions into a method?

It's doable. Maybe the getCloud method can be refactored as getClientOptions but I don't see a lot of added value.

@johngmyers
Copy link
Contributor

The structure of the initialization is weird and complicated. Both providers call getCredentials() which itself calls getCloudConfiguration(). Then in this PR they copy-paste identical code to call getCloudConfiguration() a second time and construct a ClientOptions.

Would it not make sense to have getCredentials() also return a ClientOptions?

@jbpaux
Copy link
Contributor Author

jbpaux commented Sep 27, 2023

I agree for the first part, the getCloudConfiguration should be call once, we define the environment once and we shouldn't have to call it again but I don't think getCredentials should also take care of creation of the ClientOptions as it's a bit out of its responsibility.

What do you think ?

@johngmyers
Copy link
Contributor

I think it's okay to expand the responsibility of getCredentials

@jhongturney
Copy link

Will this be going into a release soon? We were going from 0.13.4 to 0.13.6 to address a vulnerability, but the issue with sovereign clouds is preventing us.

Signed-off-by: jbpaux <9682558+jbpaux@users.noreply.github.com>
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 29, 2023
@jbpaux
Copy link
Contributor Author

jbpaux commented Sep 29, 2023

I think it's okay to expand the responsibility of getCredentials

ok, done in latest commit

Will this be going into a release soon? We were going from 0.13.4 to 0.13.6 to address a vulnerability, but the issue with sovereign clouds is preventing us.

it must be merged first in master then in a few month a new release will be out. So in the meantime you'll have to either use master image or a custom made image with this fix included

@mloiseleur
Copy link
Contributor

I'm unsure why you didn't use the client factory, but the code looks good.
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 2, 2023
@Raffo
Copy link
Contributor

Raffo commented Oct 7, 2023

Hey @jbpaux , can you address @mloiseleur's comment. The implementation looks good enough to me, but I'm not too familiar with azure sdk, so I'd love to get that comment answered.

@jhongturney this is on my radar, so it will be merged soon. that said, it's right that there won't be a new released right away. You can consider using an image from the master branch if you need it sooner than released.

@jbpaux
Copy link
Contributor Author

jbpaux commented Oct 7, 2023

I didn't use the client factory as the initial implementation didn't use it either. I didn't tought it was worth switching to it for only 2 clients. If it's really wanted I can rerefactor to use it but I think it's good enough :)

@Raffo
Copy link
Contributor

Raffo commented Oct 7, 2023

@mloiseleur given that you mention that, what do you think? For me it's okay like this.

@mloiseleur
Copy link
Contributor

Yes, it's okay for me like this too.

@johngmyers
Copy link
Contributor

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: johngmyers

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 8, 2023
@k8s-ci-robot k8s-ci-robot merged commit a429215 into kubernetes-sigs:master Oct 8, 2023
14 checks passed
@nbjohnson
Copy link

Great to see this fix got merged. When can we expect to see a tagged release version with this included? This fixed a bug that is currently completely breaking externaldns for us

@jbpaux jbpaux deleted the fix/azure-sovereign-clouds branch October 11, 2023 07:24
@Raffo
Copy link
Contributor

Raffo commented Oct 11, 2023

@nbjohnson we still have to plan a release. I think towards the end of October is realistic. In the meantime you can use one of the images built from master.

@nbjohnson
Copy link

nbjohnson commented Nov 1, 2023

@Raffo Just want to check again now that we have reached November what the status of a new tagged release with this fix. We need to deploy with a tagged release with this critical fix. We look forward for a release, Thanks!

@Raffo
Copy link
Contributor

Raffo commented Nov 1, 2023

We talked about it and it's planned, I need to get the time to do it, likely next week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Azure provider no longer supports Sovereign clouds
8 participants