Skip to content

Validate Fleet extension types client-side - #10401

Open
Britania Rodriguez Reyes (britaniar) wants to merge 11 commits into
Azure:mainfrom
britaniar:britaniar-add-fleet-cli-support
Open

Britania Rodriguez Reyes (britaniar) wants to merge 11 commits into
Azure:mainfrom
britaniar:britaniar-add-fleet-cli-support

Conversation

@britaniar

@britaniar Britania Rodriguez Reyes (britaniar) commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

Fleet extension operations currently rely on the service to reject unsupported extension types. Since Fleet presently supports only microsoft.flux, fail fast in the CLI before sending ARM requests when another extension type is supplied.

Changes

  • Adds microsoft.flux as the supported Fleet extension type constant.
  • Validates extension types case-insensitively for Fleet operations where the type is supplied or available:
    • az k8s-extension create
    • az k8s-extension update using the existing resource's extension type
    • az k8s-extension extension-types list-versions-by-location
    • az k8s-extension extension-types show-by-cluster
    • az k8s-extension extension-types list-versions-by-cluster
    • az k8s-extension extension-types show-version-by-cluster
    • Deprecated aliases routed through the same handlers.
  • Raises InvalidArgumentValueError before invoking a mutating or discovery ARM request for unsupported types.
  • Keeps resource show/list/delete available because they do not accept an extension type; delete intentionally remains a cleanup path for unsupported or legacy resources.
  • Normalizes cluster and extension type values at call sites before validation.
  • Adds focused tests for all guarded operations, case-insensitive Flux acceptance, and unrestricted deletion.
  • Fixes an upstream Python 3.14 pylint warning by making the ChaosStudio platform identity helper's two-item return shape explicit.
  • Bumps k8s-extension to 1.9.3 and updates the changelog.

Example

az k8s-extension create \
  --resource-group fleet-rg \
  --cluster-name fleet-1 \
  --cluster-type fleets \
  --name extension-1 \
  --extension-type contoso.extension

Extension type 'contoso.extension' is not supported for cluster type 'fleets'. The supported extension type is 'microsoft.flux'.

Tests

  • azdev test test_fleet_support --series — 11 tests and 4 subtests passed
  • python -m pytest src/k8s-extension/azext_k8s_extension/tests/latest/test_chaos_studio.py -q — 30 tests and 24 subtests passed
  • azdev linter k8s-extension — passed
  • azdev style k8s-extension — pylint and flake8 passed
  • git diff --check — passed

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Use the 2026-06-01 Fleet ARM API for parent resource lookup per review feedback.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Keep the existing or-separated wording while adding Fleet resources.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Record create, show, list, and delete requests against a hubful staging Fleet.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Preserve the upstream 1.9.0 release and publish Fleet support as 1.9.1.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Reject Fleet extension types other than microsoft.flux before sending an ARM request.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Apply the microsoft.flux guard to every extension-type operation that accepts Fleet context.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@britaniar Britania Rodriguez Reyes (britaniar) changed the title Validate Fleet extension type on create Validate Fleet extension types client-side Sep 28, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@yonzhan

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).

Preserve upstream 1.9.2 and publish Fleet extension validation as 1.9.3.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Return an explicit two-item tuple so Python 3.14 pylint can verify all identity unpacking sites.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Comment thread src/k8s-extension/azext_k8s_extension/custom.py Outdated
Comment thread src/k8s-extension/azext_k8s_extension/custom.py Outdated
Comment thread src/k8s-extension/azext_k8s_extension/custom.py
Normalize validation inputs, guard Fleet updates, and preserve delete as a cleanup path for unsupported resources.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Auto-Assign Auto assign by bot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants