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

update connectedk8s for ARM metadata 2022-09-01 #6328

Merged
merged 1 commit into from
Aug 3, 2023

Conversation

TheOnlyWei
Copy link
Contributor

@TheOnlyWei TheOnlyWei commented May 26, 2023

This PR adds ability to fetch new properties from 2022-09-01 ARM metadata in an on-premises environment that is currently in preview.

Related command

az connectedk8s

General Guidelines

  • Have you run azdev style <YOUR_EXT> locally? (pip install azdev required)
  • Have you run python scripts/ci/test_index.py -q locally?

IMPORTANT: I ran "azdev style azext_connectedk8s", but there are preexisting formatting errors unrelated to my change. I assumption is the project never followed the style guides to begin with. If the style guide should be followed, I am not going to fix those issues in this PR as there are many of them and likely not related to my changes.

For new extensions:

About Extension Publish

There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update src/index.json automatically.
You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify src/index.json.

@ghost ghost added Connected Kubernetes Auto-Assign Auto assign by bot labels May 26, 2023
@ghost ghost requested a review from zhoxing-ms May 26, 2023 01:53
@yonzhan
Copy link
Collaborator

yonzhan commented May 26, 2023

Thank you for your contribution! We will review the pull request and get back to you soon.

@ghost ghost requested review from jsntcy and yonzhan May 26, 2023 01:53
@ghost ghost assigned zhoxing-ms May 26, 2023
@ghost ghost requested a review from yanzhudd May 26, 2023 01:53
@TheOnlyWei TheOnlyWei marked this pull request as ready for review June 10, 2023 00:24
dp_endpoint_dogfood, release_train_dogfood = validate_env_file_dogfood(values_file, values_file_provided)
config_dp_endpoint, release_train_custom = validate_env_file_dogfood(values_file, values_file_provided)
# Get the values or endpoints required for retreiving the Helm registry URL.
if "dataplaneEndpoints" in metadata:
Copy link
Member

Choose a reason for hiding this comment

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

For Context, we added dataplane endpoints in ARM metadata response for the api version 2022-09-01 with this PR
https://msazure.visualstudio.com/DefaultCollection/One/_git/AzureUX-ARM/pullrequest/6838164 (internal)

Copy link
Member

Choose a reason for hiding this comment

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

The dataplaneEndpoints values are not populated for the azure clouds at the moment, however we initialize it in our configs for the disconnected scenarios so that the correct endpoint values are returened.
In future Azure clouds could make use of these fields as well

Copy link
Member

@bganapa bganapa left a comment

Choose a reason for hiding this comment

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

minor comments

active_directory = metadata["authentication"]["loginEndpoint"]
cmd_helm_install.extend(
[
"--set", "systemDefaultValues.azureResourceManagerEndpoint={}".format(resource_manager),
Copy link
Member

@bganapa bganapa Jun 22, 2023

Choose a reason for hiding this comment

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

just for reviewers, These are all the Helm overrides needed for disconnecte, all of these agent overrides are already merged in upstream ClusterConfigurationAgents repo

@TheOnlyWei TheOnlyWei changed the title update connectedk8s for ARM metadata 2022-09-01 [DO NOT MERGE] update connectedk8s for ARM metadata 2022-09-01 Jun 22, 2023
@TheOnlyWei TheOnlyWei force-pushed the update-metadata-2022-09-01 branch 3 times, most recently from e95f1cf to 04d67a2 Compare June 22, 2023 23:45
@TheOnlyWei TheOnlyWei changed the title [DO NOT MERGE] update connectedk8s for ARM metadata 2022-09-01 update connectedk8s for ARM metadata 2022-09-01 Jun 29, 2023
@zhoxing-ms
Copy link
Contributor

Could you please add some tests for this PR change?

@TheOnlyWei
Copy link
Contributor Author

TheOnlyWei commented Jun 30, 2023

Hi @zhoxing-ms the changes are for an on-premise environment and the tests only have access to Azure Cloud, so it is currently not possible to test the new endpoints without the on-premise environment. We already have internal tests for the on-premise environment that uses this updated code.

@zhoxing-ms
Copy link
Contributor

@akashkeshari Could you please help review this PR again?

.gitignore Outdated
Comment on lines 1 to 3
# Ignore test data files
**/connectedk8s/azext_connectedk8s/tests/latest/data/

Copy link
Contributor

Choose a reason for hiding this comment

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

Why do you need to modify this file?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Otherwise, you will commit a bunch of test files if you run the Azure Cloud tests.

Copy link
Contributor

Choose a reason for hiding this comment

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

In fact, we do upload some files used for testing into /connectedk8s/azext_connectedk8s/tests/latest/data/, such as https://github.com/Azure/azure-cli/tree/dev/src/azure-cli/azure/cli/command_modules/resource/tests/latest/data

Copy link
Contributor Author

@TheOnlyWei TheOnlyWei Aug 3, 2023

Choose a reason for hiding this comment

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

Those files I mentioned are autogenerated intermediate files from the test and were not committed before this PR, so I didn't see a reason to commit it for this PR. I don't think those files are supposed to be committed, but there was no gitignore option, so I decided to add it as a fix.

Copy link
Contributor

@zhoxing-ms zhoxing-ms Aug 3, 2023

Choose a reason for hiding this comment

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

OK, got it. Please add this line to the end of the file instead of the beginning.

# Ignore test data files

In addition, please provide a more detailed explanation in the comment

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can move it to the end of the file, but is a more detailed description required? I feel like you're supposed to have generalized descriptions so other teams can put their own test data under the same gitignore comment.

Copy link
Contributor

@zhoxing-ms zhoxing-ms Aug 3, 2023

Choose a reason for hiding this comment

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

In fact, the files in the xxx/tests/latest/data/ directory of other module are useful files that will be used for testing, they need to be added to the source code. Therefore, the ignore logic of connectedk8s module is unique at present, so I suggest making a more detailed explanation

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay, it seems the tests are not supposed to be using tests/latest/data to dump one-time-use test output. I will remove the git ignore.

@azure-client-tools-bot-prd
Copy link

️✔️Azure CLI Extensions Breaking Change Test
️✔️Non Breaking Changes

@zhoxing-ms zhoxing-ms merged commit f2aa72a into Azure:main Aug 3, 2023
14 checks passed
@azclibot
Copy link
Collaborator

azclibot commented Aug 3, 2023

[Release] Update index.json for extension [ connectedk8s ] : https://dev.azure.com/azclitools/internal/_build/results?buildId=79071&view=results

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.

6 participants