Skip to content

Quality improvements for az aks extension and az aks extension type command groups #8794

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

Merged
merged 179 commits into from
May 30, 2025

Conversation

sophsoph321
Copy link
Contributor

This PR contains the following improvements for the az aks extension and az aks extension type command groups:

  1. Error message for az aks extension create command when the extension type is not in the allowed list of core extensions has been generalized to fit various scenarios
  2. Adds filter for az aks extension show command to check whether the core extension is in the allowed list of core extensions
  3. For the az aks extension type command group, we return a validation error if the user didn't specify a location, or any cluster details (i.e. resource group name and cluster name)

This checklist is used to make sure that common guidelines for a pull request are followed.

Related command

General Guidelines

  • [x ] Have you run azdev style <YOUR_EXT> locally? (pip install azdev required)
  • [ x] Have you run python scripts/ci/test_index.py -q locally? (pip install wheel==0.30.0 required)
  • My extension version conforms to the Extension version schema

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.

@@ -16176,4 +16176,4 @@ def test_aks_loadbalancer_commands(
# self.cmd(
Copy link
Member

Choose a reason for hiding this comment

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

please remove self.cmd('extension add -n k8s-extension') from the init function.

Copy link
Member

Choose a reason for hiding this comment

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

Also, for cases where you need to install an extension, I recommend marking them as @live_only() and you can remove the corresponding recording file

Copy link
Member

@matthchr matthchr left a comment

Choose a reason for hiding this comment

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

I think the _backup.yaml files aren't intentionally added?

@github-actions github-actions bot added the release-version-block Updates do not qualify release version rules. NOTE: please do not edit it manually. label May 29, 2025
@github-actions github-actions bot removed the release-version-block Updates do not qualify release version rules. NOTE: please do not edit it manually. label May 29, 2025
@zhoxing-ms zhoxing-ms merged commit 764556b into Azure:main May 30, 2025
24 checks passed
@azclibot
Copy link
Collaborator

[Release] Update index.json for extension [ aks-preview-18.0.0b6 ] : https://dev.azure.com/msazure/One/_build/results?buildId=125793617&view=results

bavneetsingh16 pushed a commit to AzureArcForKubernetes/k8s-extension that referenced this pull request May 30, 2025
…ommand groups (Azure#8794)

* add troubleshoot command under connectedk8s

* resolve check issues

* fix final new line

* add back troubleshoot params

* implement helm version and permission checks

* add aks extension and aks extension type cli groups

* fix pylint

* POC for extensions

* fix formatting

* add test and revert connectedk8s changes

* remove newline from readme

* fix linter issue

* fix faulty examples

* fix linting issues

* fix parse issue

* fix

* fix help.py

* fix more pylint issues

* fix params

* fix parameter issue

* fix the over indent

* fix pylint issue

* resolve pylinter issue

* remove location

* remove location

* add extension type

* remove unrecognized parameter

* add comma

* fix invalid naming convensitons

* fix pylinter issue

* remove duplicate functions from k8sextension

* add check for allowed extensions

* revise tests

* fix indentation issue

* fix trailing whitespace

* cmmit

* add params

* change

* fix format.py

* remove aks group

* fix format.py

* add library func for params

* add const

* remove libraries

* update format.py

* remove libraries from format.py

* add check for allow list of extensions

* add history.rst

* fix unit test

* fix style in help.py

* fix extension type test

* add cassete file

* add modified tests

* add cmd for patching the k8s extension

* fix cassette file

* add update

* fix PR comments in format, help.py

* fix style

* fix action.py

* fix style

* add newline in params.py

* update extension type command

* fix pylint indentation

* fix cli examples

* add resource group name as param

* add resource group param

* add autoupgrade as description

* fix autoupgrade param

* add abreviation

* fix option list

* add autoupgrade

* change autoupgrade order

* add description for config settings

* specify additional parameters

* add examples for aks extension API

* rerun pylinter

* rerun pipeline

* fix style and pylint issue

* add location param in help.py

* add region as param

* run new command with style and linter

* add command group

* make parameters optional

* use custom show command

* rerun style check

* fix style

* fix unexpected spaces

* remove extra show extension type commands

* fix params in extension types api

* add show version command

* fix style

* fix extension list version command

* fix style and linting issue

* fix aks test cases

* print allowed list of extensions

* fix help.py description

* fix pylinting issue

* fix style issue

* fix style issue

* add new cassette files

* commit action.py

* add backup scenario

* add extension type version API commands

* fix help.py examples

* fix help.py

* fix version summary

* remove print statement

* add version show

* add custom helper function

* fix new line issue

* remove show-version and list-versions

* fix style issue

* fix style issue

* fix style issue

* location of extension

* fix pylinting issue

* fix location flag

* Update src/aks-preview/azext_aks_preview/tests/latest/test_aks_commands.py

Co-authored-by: Matthew Christopher <[email protected]>

* Update src/aks-preview/azext_aks_preview/tests/latest/test_aks_commands.py

Co-authored-by: Matthew Christopher <[email protected]>

* add extension type filtering for core extensions

* remove 3 properties

* fix style

* add missing custom functions

* upload cassette files

* change pending version

* modify casette files

* add k8s extension firewall

* add latest cassette files

* remove secrets from test case

* register extension types feature

* add a wait period for the feature to register

* update version in setup.py

* fix cassette files

* update history.rst

* commit

* add validation

* update cassette files

* update history.rst

* fix style issue in helpers.py

* change api version

* update casset files with correct API verisons

* address PR comments

* update setup.py

* remove extra test files

* update casette files

* make tests live only

* fix style issue

* fix setup.py

* fix history.rst

* fix style

* fix failed test case

* fix syntax error

* update failed test

* fix

* fix recording

* revert yaml changes

* fix put call API

* update api verisons

* update api version

---------

Co-authored-by: Sophie Zhao <[email protected]>
Co-authored-by: Matthew Christopher <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AKS Auto-Assign Auto assign by bot
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants