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

K8s extension/release 1.5.0 #6779

Merged
merged 132 commits into from
Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
132 commits
Select commit Hold shift + click to select a range
3cc8452
Kubernetes Data Protection Extension CLI (#173)
Miraj50 Aug 25, 2022
6c56613
{AKS - ARC} fix: Update DCR creation to Clusters resource group inste…
bragi92 Sep 28, 2022
083ed6d
Add self-signed cert to fix PR gate for azureml extension
Sep 27, 2022
0a6208d
adding the api version to the operation definition in the client factory
deeksha345 Sep 29, 2022
2121a2e
Merge pull request #181 from AzureArcForKubernetes/deesharma/exttypes
deeksha345 Sep 29, 2022
9c6835c
bump k8s-extension version to 1.3.6
deeksha345 Sep 29, 2022
1aaef92
Merge pull request #182 from AzureArcForKubernetes/release-1.3.6
deeksha345 Sep 29, 2022
700bee5
adding tests for all 4 extension types calls
deeksha345 Sep 30, 2022
efd86d4
adding to test config file
deeksha345 Sep 30, 2022
8dcef49
updating the api version for extension types to be the correct versio…
deeksha345 Sep 30, 2022
2ecb63a
add test case for flux extension (#184)
bavneetsingh16 Oct 3, 2022
f1c9348
Merge branch 'k8s-extension/public' into deesharma/exttypestests
deeksha345 Oct 5, 2022
5c57791
Merge pull request #183 from AzureArcForKubernetes/deesharma/exttypes…
deeksha345 Oct 5, 2022
84dcc92
Merge branch 'main' of https://github.com/Azure/azure-cli-extensions …
deeksha345 Oct 5, 2022
4ae3aa6
bump k8s-extension version to 1.3.6
deeksha345 Oct 5, 2022
0213a71
bump k8s-extension version to 1.3.6
deeksha345 Oct 6, 2022
a2a8be4
Merge pull request #186 from AzureArcForKubernetes/release-1.3.6
deeksha345 Oct 6, 2022
ef3e79f
adding upstream test for extension types
deeksha345 Oct 17, 2022
eeadb2b
Merge pull request #189 from AzureArcForKubernetes/deesharma/addingex…
deeksha345 Oct 17, 2022
0378ecf
Merge branch 'main' of https://github.com/Azure/azure-cli-extensions …
deeksha345 Oct 17, 2022
929928f
updating history.rst
deeksha345 Oct 17, 2022
374edcf
Merge pull request #190 from AzureArcForKubernetes/release-1.3.6
deeksha345 Oct 18, 2022
5b6b4dc
Merge branch 'main' of https://github.com/Azure/azure-cli-extensions …
deeksha345 Oct 18, 2022
e95cd6e
Merge branch 'k8s-extension/public' into release-1.3.6
deeksha345 Oct 18, 2022
477613d
Merge pull request #191 from AzureArcForKubernetes/release-1.3.6
deeksha345 Oct 18, 2022
cbd30bf
[Dapr] Prompt user for existing Dapr installation during extension cr…
shubham1172 Nov 10, 2022
5d8592e
Merge branch 'main' of github.com:Azure/azure-cli-extensions into rel…
Nov 15, 2022
155fb01
bump k8s-extension version to 1.3.7
Nov 15, 2022
0d74a15
Merge branch 'main' of github.com:Azure/azure-cli-extensions into rel…
Nov 16, 2022
c88e8ef
Merge branch 'main' of github.com:Azure/azure-cli-extensions into rel…
Nov 18, 2022
464cca7
Merge pull request #196 from AzureArcForKubernetes/release-1.3.7
bavneetsingh16 Nov 18, 2022
0487616
[Dapr] Disable applying CRDs during a downgrade (#193)
shubham1172 Nov 28, 2022
d54d6ab
ContainerInsights extension - Add dataCollectionSettings configurati…
ganga1980 Dec 2, 2022
b2f1319
Upgrade Python version from 3.6 to 3.7 (#203)
NarayanThiru Dec 15, 2022
ee8a070
[Dapr] Do not apply CRD hook when version is unchanged or auto-upgrad…
shubham1172 Dec 16, 2022
e054268
add dummy key for amalogs as well
Dec 29, 2022
4a6fcdb
Merge branch 'k8s-extension/public' into user/amagraw/fix-bug/rename
pfrcks Dec 30, 2022
9b65294
Merge pull request #207 from pfrcks/user/amagraw/fix-bug/rename
deeksha345 Dec 30, 2022
887661d
Merge branch 'main' of https://github.com/Azure/azure-cli-extensions …
deeksha345 Jan 12, 2023
beffb3f
bump k8s-extension version to 1.3.8
deeksha345 Jan 12, 2023
f6e39ca
Merge branch 'k8s-extension/public' into release-1.3.8
deeksha345 Jan 12, 2023
6015026
Adding GA api version 2022-11-01 exposing isSystemExtension and suppo…
Nov 18, 2022
97c808f
Seperate args for plan name, product and publisher
Dec 13, 2022
d35686c
Merge branch 'main' of https://github.com/Azure/azure-cli-extensions …
deeksha345 Jan 13, 2023
c6d351f
Merge branch 'release-1.3.8' of https://github.com/AzureArcForKuberne…
deeksha345 Jan 13, 2023
0cd6017
Merge branch 'main' of https://github.com/Azure/azure-cli-extensions …
deeksha345 Jan 18, 2023
1b51c5e
updating cassete file
Jan 12, 2023
c1f8614
Merge branch 'main' of https://github.com/Azure/azure-cli-extensions …
deeksha345 Jan 19, 2023
2ff27e9
Merge pull request #199 from AzureArcForKubernetes/ariflakhani/2022-1…
Arif-lakhani Jan 20, 2023
e10938b
Merge branch 'main' of https://github.com/Azure/azure-cli-extensions …
deeksha345 Jan 23, 2023
2fb41e7
Merge branch 'k8s-extension/public' into release-1.3.8
deeksha345 Jan 23, 2023
8a48eea
updating HISTORY.rst
deeksha345 Jan 23, 2023
601d4c7
Merge branch 'main' of https://github.com/Azure/azure-cli-extensions …
deeksha345 Jan 23, 2023
8319907
Merge pull request #209 from AzureArcForKubernetes/release-1.3.8
deeksha345 Jan 23, 2023
942738f
Deprecate longer parameter names when accepting config settings (#213)
Arif-lakhani Jan 31, 2023
f122f93
merge from upstream branch
Jan 31, 2023
9aa7d3d
Release 1.3.9
Jan 31, 2023
398f140
Merge pull request #214 from AzureArcForKubernetes/release/1.3.9
Arif-lakhani Jan 31, 2023
2473565
make containerinsights dcr name consistent (#211)
ganga1980 Feb 2, 2023
0845f61
[Dapr] Update version comparison logic to use semver based comparison…
shubham1172 Feb 17, 2023
ffb8a95
bump k8s-extension version to 1.4.0 (#220)
bavneetsingh16 Feb 17, 2023
c957325
Revert "bump k8s-extension version to 1.4.0 (#220)" (#222)
bavneetsingh16 Feb 17, 2023
9c0c41a
Merge branch 'main' of github.com:Azure/azure-cli-extensions into new…
Feb 18, 2023
de4f530
[k8s-extension] Update extension CLI to v1.4.0
Feb 18, 2023
e67bfda
Merge pull request #223 from AzureArcForKubernetes/new_release
bavneetsingh16 Feb 18, 2023
b0ee4c2
sync with upstream cli repo
Mar 22, 2023
4ced5e8
update release history
Mar 22, 2023
f30b5c9
fix openservice mesh cli testcase issue
Mar 22, 2023
03d9b63
Merge pull request #225 from AzureArcForKubernetes/sync_cli_upstream
bavneetsingh16 Mar 22, 2023
e09dcc6
Zetia/fix ssl secret flag (#224)
zetiaatgithub Mar 22, 2023
db556d2
feat: public preview support for microsoft.azuremonitor.containers.me…
bragi92 May 19, 2023
87a25a8
Merge branch 'main' of github.com:Azure/azure-cli-extensions into rel…
May 19, 2023
3a154e9
Merge pull request #229 from AzureArcForKubernetes/release-1.4.1
bavneetsingh16 May 20, 2023
4f2b74c
remove redundant extension test (#230)
bavneetsingh16 May 20, 2023
6e583a9
ci MSI default for arc cluster (#231)
wanlonghenry May 31, 2023
b295046
Merge branch 'main' of github.com:Azure/azure-cli-extensions into rel…
Jun 23, 2023
029ce31
bump k8s-extension version to 1.4.2
Jun 23, 2023
30a373b
Merge pull request #235 from AzureArcForKubernetes/release-1.4.2
bavneetsingh16 Jun 23, 2023
dfd1139
ContainerInsights extension - Extend dataCollectionSettings config se…
ganga1980 Jun 30, 2023
a33424b
Generated files for 2023-05-01-preview
Jun 30, 2023
a7fa6eb
Support for 2023-05-01-preview
Jul 5, 2023
290f24c
Rename get to show
Jul 5, 2023
4f6da18
Added ExtensionType api test cases
Jul 17, 2023
5ff7d66
ContainerInsights extension - Extend dataCollectionSettings with cont…
wanlonghenry Jul 18, 2023
57679f8
Fix for Liniting issues
Jul 19, 2023
9beb747
Fixing test cases
Jul 19, 2023
1f7b9ce
comment failing test cases
Jul 24, 2023
42d8b15
[k8s-extension] add kind tag in DCR creation (#240)
wanlonghenry Jul 25, 2023
e9aebbc
Use semver package (#241)
shubham1172 Jul 28, 2023
e36dfad
bump k8s-extension version to 1.4.3
Jul 28, 2023
2561f35
Merge pull request #243 from AzureArcForKubernetes/release-1.4.3
bavneetsingh16 Jul 28, 2023
3a2d4a8
Reverting commented test cases
Jul 25, 2023
4fa705d
Add support to skip provisioning of prerequisites for Azure Monitor K…
ms-hujia Aug 1, 2023
980d53b
{ARC} fix: update logic to sanitize cluster name for dc* objects (#242)
bragi92 Aug 1, 2023
29f1210
Fix osm-arc version check for CI tags (#244)
nshankar13 Aug 2, 2023
f230c8e
New cassette file
Aug 3, 2023
5091eaa
Remove unused propeties from table format
Aug 3, 2023
c2ac205
Merge branch 'k8s-extension/public' into arif/2021_05_01_preview
Arif-lakhani Aug 3, 2023
a122362
Merge pull request #236 from AzureArcForKubernetes/arif/2021_05_01_pr…
Arif-lakhani Aug 10, 2023
740fa4d
Merge branch 'main' of github.com:Azure/azure-cli-extensions into rel…
Aug 11, 2023
5ac1d97
bump k8s-extension version 1.4.3
Aug 11, 2023
e1250ee
Merge pull request #246 from AzureArcForKubernetes/release-new-1.4.3
bavneetsingh16 Aug 11, 2023
8df0be1
Add old commands back with deprecated status
Aug 11, 2023
aebbef4
Fix linting issues
Aug 14, 2023
a74f76d
Merge pull request #247 from AzureArcForKubernetes/ariflakhani/deprecate
Arif-lakhani Aug 14, 2023
9f8159c
Reverting changes for extensions type api
Aug 22, 2023
7166e84
change the location for test runs and arc clusters
Aug 23, 2023
6be2701
Merge pull request #249 from AzureArcForKubernetes/revertextensionstype
Arif-lakhani Aug 23, 2023
584815d
[k8s-extension] create new cli release - v1.4.3 (#250)
bavneetsingh16 Aug 23, 2023
aa77ff2
Revert "[k8s-extension] create new cli release - v1.4.3 (#250)" (#251)
bavneetsingh16 Aug 23, 2023
7944db5
Merge branch 'main' of github.com:Azure/azure-cli-extensions into new…
Aug 23, 2023
96beb6f
[k8s-extension] Update extension CLI to v1.4.3
Aug 23, 2023
b79d107
Merge pull request #253 from AzureArcForKubernetes/new_cli-1.4.3
bavneetsingh16 Aug 24, 2023
7786f2a
Drop relay sdk (#254)
necusjz Sep 1, 2023
af2d1b9
bump k8s-extension version to 1.4.4
Sep 1, 2023
ef01ddd
update readme
Sep 1, 2023
35d9eba
Merge pull request #255 from AzureArcForKubernetes/release-1.4.4
bavneetsingh16 Sep 1, 2023
2c4c1de
remove useless snippets (#256)
necusjz Sep 2, 2023
1fef154
Add generated files for 2023-05-01
Sep 18, 2023
9902d52
Update extensionsType api to 2023-05-01-preview
Sep 18, 2023
a64f0e4
Merge pull request #258 from AzureArcForKubernetes/2023-05-01
Arif-lakhani Sep 18, 2023
bf020ff
Update OSM-Arc version check for beta and CI tags (#257)
nshankar13 Sep 19, 2023
c4adf5f
Merge branch 'main' of github.com:Azure/azure-cli-extensions into rel…
Sep 19, 2023
57db317
bump k8s-extension version to 1.5.0
Sep 19, 2023
5268aa9
Merge pull request #259 from AzureArcForKubernetes/release-1.4.6
bavneetsingh16 Sep 20, 2023
6adb8f6
add deprecated params for extension types
Sep 20, 2023
259feec
Merge pull request #260 from AzureArcForKubernetes/DeprecatedParams
Arif-lakhani Sep 20, 2023
cb846e7
Add breaking change details to the history
Sep 25, 2023
1575dbf
Merge pull request #261 from AzureArcForKubernetes/DeprecatedParams
Arif-lakhani Sep 25, 2023
41f9f93
use the recomended param for flag
Sep 27, 2023
29ad71d
Merge pull request #262 from AzureArcForKubernetes/DeprecatedParams
Arif-lakhani Sep 27, 2023
ed41084
[k8s-extension] Update extension CLI to v1.5.0
Sep 20, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/k8s-extension/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
Release History
===============

1.5.0
++++++++++++++++++
* add support for extensionsType api
* Breaking change introduced with API version 2023-05-01 adds validation will begin rejecting calls (PUT and PATCH) that provide a version for the extension and also set autoUpgradeMinorVersion to true
* microsoft.openservicemesh: Update OSM-Arc version check for beta and CI tags

1.4.5
++++++++++++++++++
* fix bugs while dropping 'azure-mgmt-relay'
Expand Down
16 changes: 2 additions & 14 deletions src/k8s-extension/azext_k8s_extension/_client_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,8 @@ def cf_k8s_extension_operation(cli_ctx, *_):
return cf_k8s_extension(cli_ctx).extensions


def cf_k8s_cluster_extension_types_operation(cli_ctx, *_):
return cf_k8s_extension(cli_ctx, api_version=consts.EXTENSION_TYPE_API_VERSION).cluster_extension_types


def cf_k8s_cluster_extension_type_operation(cli_ctx, *_):
return cf_k8s_extension(cli_ctx, api_version=consts.EXTENSION_TYPE_API_VERSION).cluster_extension_type


def cf_k8s_location_extension_types_operation(cli_ctx, *_):
return cf_k8s_extension(cli_ctx, api_version=consts.EXTENSION_TYPE_API_VERSION).location_extension_types


def cf_k8s_extension_type_versions_operation(cli_ctx, *_):
return cf_k8s_extension(cli_ctx, api_version=consts.EXTENSION_TYPE_API_VERSION).extension_type_versions
def cf_k8s_extension_types(cli_ctx, *_):
return cf_k8s_extension(cli_ctx, api_version=consts.EXTENSION_TYPE_API_VERSION).extension_types


def cf_resource_groups(cli_ctx, subscription_id=None):
Expand Down
32 changes: 17 additions & 15 deletions src/k8s-extension/azext_k8s_extension/_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,23 +34,26 @@ def __get_table_row(result):


def k8s_extension_types_list_table_format(results):
return [__get_extension_type_table_row(result, False) for result in results]
return [__get_extension_type_table_row(result) for result in results]


def k8s_extension_type_show_table_format(result):
return __get_extension_type_table_row(result, True)
return __get_extension_type_table_row(result)


def __get_extension_type_table_row(result, showReleaseTrains):
def __get_extension_type_table_row(result):
# Populate the values to be returned if they are not undefined
clusterTypes = ', '.join(result['clusterTypes'])
clusterTypes = ''
if result['properties']['supportedClusterTypes'] is not None:
clusterTypes = ', '.join(result['properties']['supportedClusterTypes'])

name = result['name']
defaultScope, allowMultipleInstances, defaultReleaseNamespace = '', '', ''
if result['supportedScopes']:
defaultScope = result['supportedScopes']['defaultScope']
if result['supportedScopes']['clusterScopeSettings']:
allowMultipleInstances = result['supportedScopes']['clusterScopeSettings']['allowMultipleInstances']
defaultReleaseNamespace = result['supportedScopes']['clusterScopeSettings']['defaultReleaseNamespace']
if result['properties']['supportedScopes']:
defaultScope = result['properties']['supportedScopes']['defaultScope']
if result['properties']['supportedScopes']['clusterScopeSettings'] is not None:
allowMultipleInstances = result['properties']['supportedScopes']['clusterScopeSettings']['allowMultipleInstances']
defaultReleaseNamespace = result['properties']['supportedScopes']['clusterScopeSettings']['defaultReleaseNamespace']

retVal = OrderedDict([
('name', name),
Expand All @@ -59,9 +62,6 @@ def __get_extension_type_table_row(result, showReleaseTrains):
('allowMultipleInstances', allowMultipleInstances),
('defaultReleaseNamespace', defaultReleaseNamespace)
])
if showReleaseTrains:
releaseTrains = ', '.join(result['releaseTrains'])
retVal['releaseTrains'] = releaseTrains

return retVal

Expand All @@ -70,9 +70,11 @@ def k8s_extension_type_versions_list_table_format(results):
return [__get_extension_type_versions_table_row(result) for result in results]


def k8s_extension_type_version_show_table_format(results):
return __get_extension_type_versions_table_row(results)


def __get_extension_type_versions_table_row(result):
versions = ", ".join(result['versions'])
return OrderedDict([
('releaseTrain', result['releaseTrain']),
('versions', versions)
('versions', result['properties']['version'])
])
72 changes: 55 additions & 17 deletions src/k8s-extension/azext_k8s_extension/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,41 +83,79 @@
short-summary: Commands to discover Kubernetes Extension Types.
"""

helps[f'{consts.EXTENSION_NAME} extension-types list'] = f"""
helps[f'{consts.EXTENSION_NAME} extension-types show-by-cluster'] = f"""
type: command
short-summary: List Kubernetes Extension Types.
short-summary: Show properties for a Cluster Extension Type for an existing cluster. The properties used for filtering include type of cluster (managed, connected, etc), kubernetes version, location of the cluster.
examples:
- name: List Kubernetes Extension Types
- name: Show properties for a Cluster Extension Type for an existing cluster
text: |-
az {consts.EXTENSION_NAME} extension-types list --resource-group my-resource-group \
az {consts.EXTENSION_NAME} extension-types show-by-cluster --resource-group my-resource-group \
--cluster-name mycluster --cluster-type connectedClusters --extension-type microsoft.openservicemesh
"""

helps[f'{consts.EXTENSION_NAME} extension-types show-by-location'] = f"""
type: command
short-summary: Show properties for a Cluster Extension Type in a region.
examples:
- name: Show properties for a Cluster Extension Type in a region
text: |-
az {consts.EXTENSION_NAME} extension-types show-by-location --location eastus --extension-type microsoft.openservicemesh
"""

helps[f'{consts.EXTENSION_NAME} extension-types show-version-by-cluster'] = f"""
type: command
short-summary: Show properties associated with a Cluster Extension Type version for an existing cluster. The properties used for filtering include type of cluster (managed, connected, etc), kubernetes version, location of the cluster.
examples:
- name: Show properties associated with a Cluster Extension Type version for an existing cluster
text: |-
az {consts.EXTENSION_NAME} extension-types show-version-by-cluster --resource-group my-resource-group \
--cluster-name mycluster --cluster-type connectedClusters --extension-type microsoft.openservicemesh --version 1.0.0
"""

helps[f'{consts.EXTENSION_NAME} extension-types show-version-by-location'] = f"""
type: command
short-summary: Show properties associated with a Cluster Extension Type version in a region.
examples:
- name: Show properties associated with a Cluster Extension Type version in a region.
text: |-
az {consts.EXTENSION_NAME} extension-types show-version-by-location --location eastus --extension-type microsoft.openservicemesh \
--version 1.0.0
"""

helps[f'{consts.EXTENSION_NAME} extension-types list-by-cluster'] = f"""
type: command
short-summary: List available Cluster Extension Types for an existing cluster. The properties used for filtering include type of cluster (managed, connected, etc), kubernetes version, location of the cluster.
examples:
- name: List available Cluster Extension Types for an existing cluster
text: |-
az {consts.EXTENSION_NAME} extension-types list-by-cluster --resource-group my-resource-group \
--cluster-name mycluster --cluster-type connectedClusters
"""

helps[f'{consts.EXTENSION_NAME} extension-types list-by-location'] = f"""
type: command
short-summary: List available Kubernetes Extension Types in a specified region.
short-summary: List available Cluster Extension Types in a region.
examples:
- name: List Kubernetes Extension Types by location
- name: List available Cluster Extension Types in a region
text: |-
az {consts.EXTENSION_NAME} extension-types list-by-location --location eastus2euap
az {consts.EXTENSION_NAME} extension-types list-by-location --location eastus
"""

helps[f'{consts.EXTENSION_NAME} extension-types show'] = f"""
helps[f'{consts.EXTENSION_NAME} extension-types list-versions-by-cluster'] = f"""
type: command
short-summary: Show properties for a Kubernetes Extension Type.
short-summary: List available versions for a Cluster Extension Type for a given cluster. The properties used for filtering include type of cluster (managed, connected, etc), kubernetes version, location of the cluster.
examples:
- name: Show Kubernetes Extension Type
- name: List available versions for a Cluster Extension Type for a given cluster
text: |-
az {consts.EXTENSION_NAME} extension-types show --resource-group my-resource-group \
--cluster-name mycluster --cluster-type connectedClusters --extension-type cassandradatacenteroperator
az {consts.EXTENSION_NAME} extension-types list-versions-by-cluster --resource-group my-resource-group \
--cluster-name mycluster --cluster-type connectedClusters --extension-type microsoft.flux
"""

helps[f'{consts.EXTENSION_NAME} extension-types list-versions'] = f"""
helps[f'{consts.EXTENSION_NAME} extension-types list-versions-by-location'] = f"""
type: command
short-summary: List available versions for a Kubernetes Extension Type.
short-summary: List available versions for a Cluster Extension Type versions in a region.
examples:
- name: List versions for an Extension Type
- name: List available versions for a Cluster Extension Type versions in a region
text: |-
az {consts.EXTENSION_NAME} extension-types list-versions --location eastus2euap \
--extension-type cassandradatacenteroperator
az {consts.EXTENSION_NAME} extension-types list-versions-by-location --location eastus --extension-type microsoft.flux
"""
41 changes: 22 additions & 19 deletions src/k8s-extension/azext_k8s_extension/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,32 +99,35 @@ def load_arguments(self, _):
c.argument('force',
help='Specify whether to force delete the extension from the cluster.')

with self.argument_context(f"{consts.EXTENSION_NAME} extension-types list") as c:
with self.argument_context(f"{consts.EXTENSION_NAME} extension-types") as c:
c.argument('cluster_name',
options_list=['--cluster-name', '-c'],
help='Name of the Kubernetes cluster')
c.argument('cluster_type',
arg_type=get_enum_type(['connectedClusters', 'managedClusters', 'appliances']),
options_list=['--cluster-type', '-t'],
help='Specify Arc clusters or AKS managed clusters or Arc appliances.')

with self.argument_context(f"{consts.EXTENSION_NAME} extension-types list-by-location") as c:
c.argument('location',
validator=get_default_location_from_resource_group)

with self.argument_context(f"{consts.EXTENSION_NAME} extension-types show") as c:
c.argument('extension_type',
help='Name of the extension type.')
c.argument('cluster_name',
options_list=['--cluster-name', '-c'],
help='Name of the Kubernetes cluster')
c.argument('cluster_type',
arg_type=get_enum_type(['connectedClusters', 'managedClusters', 'appliances']),
options_list=['--cluster-type', '-t'],
help='Specify Arc clusters or AKS managed clusters or Arc appliances.')

with self.argument_context(f"{consts.EXTENSION_NAME} extension-types list-versions") as c:
c.argument('extension_type',
help='Name of the extension type.')
c.argument('location',
validator=get_default_location_from_resource_group)
validator=get_default_location_from_resource_group,
help='Name of the location. Values from: `az account list-locations`')
c.argument('version',
help='Version for the extension type.')
c.argument('plan_name',
arg_group="Marketplace",
options_list=['--plan-name'],
help='The plan name is referring to the Marketplace Plan ID of the extension.')
c.argument('plan_product',
arg_group="Marketplace",
options_list=['--plan-product'],
help='The plan product is referring to the Marketplace Product ID of the extension.')
c.argument('plan_publisher',
arg_group="Marketplace",
options_list=['--plan-publisher'],
help='The plan publisher is referring to the Marketplace Publisher ID of the extension')
c.argument('major_version',
help='Filter results by only the major version of an extension type. For example if 1 is specified, all versions with major version 1 (1.1, 1.1.2) will be shown. The default value is None')
c.argument('show_latest',
arg_type=get_three_state_flag(),
help='Filter results by only the latest version. For example, if this flag is used the latest version of the extensionType will be shown.')
41 changes: 18 additions & 23 deletions src/k8s-extension/azext_k8s_extension/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

# pylint: disable=line-too-long
from azure.cli.core.commands import CliCommandType, client_factory
from ._client_factory import (cf_k8s_extension, cf_k8s_extension_operation, cf_k8s_cluster_extension_types_operation, cf_k8s_cluster_extension_type_operation, cf_k8s_location_extension_types_operation, cf_k8s_extension_type_versions_operation)
from ._format import k8s_extension_list_table_format, k8s_extension_show_table_format, k8s_extension_types_list_table_format, k8s_extension_type_versions_list_table_format, k8s_extension_type_show_table_format
from ._client_factory import (cf_k8s_extension, cf_k8s_extension_operation, cf_k8s_extension_types)
from ._format import k8s_extension_list_table_format, k8s_extension_show_table_format, k8s_extension_types_list_table_format, k8s_extension_type_versions_list_table_format, k8s_extension_type_show_table_format, k8s_extension_type_version_show_table_format
from . import consts


Expand All @@ -27,28 +27,23 @@ def load_command_table(self, _):
# Subgroup - k8s-extension extension-types
k8s_cluster_extension_type_sdk = CliCommandType(
operations_tmpl=consts.EXTENSION_PACKAGE_NAME + '.vendored_sdks.operations#ClusterExtensionTypeOperations.{}',
client_factory=cf_k8s_cluster_extension_type_operation)
with self.command_group(consts.EXTENSION_NAME + " extension-types", k8s_cluster_extension_type_sdk, client_factory=cf_k8s_cluster_extension_type_operation, is_preview=True) \
client_factory=cf_k8s_extension_types)
with self.command_group(consts.EXTENSION_NAME + " extension-types", k8s_cluster_extension_type_sdk, client_factory=cf_k8s_extension_types, is_preview=True) \
as g:
g.custom_show_command('show', 'show_k8s_cluster_extension_type', table_transformer=k8s_extension_type_show_table_format)
g.custom_command('list-by-location', 'list_extension_types_by_location', table_transformer=k8s_extension_types_list_table_format)
g.custom_command('show-by-location', 'show_extension_type_by_location', table_transformer=k8s_extension_type_show_table_format)

k8s_cluster_extension_types_sdk = CliCommandType(
operations_tmpl=consts.EXTENSION_PACKAGE_NAME + '.vendored_sdks.operations.#ClusterExtensionTypesOperations.{}',
client_factory=cf_k8s_cluster_extension_types_operation)
with self.command_group(consts.EXTENSION_NAME + " extension-types", k8s_cluster_extension_types_sdk, client_factory=cf_k8s_cluster_extension_types_operation, is_preview=True) \
as g:
g.custom_command('list', 'list_k8s_cluster_extension_types', table_transformer=k8s_extension_types_list_table_format)
g.custom_command('list-versions-by-location', 'list_extension_type_versions_by_location', table_transformer=k8s_extension_type_versions_list_table_format)
g.custom_command('show-version-by-location', 'show_extension_type_version_by_location', table_transformer=k8s_extension_type_version_show_table_format)

k8s_location_extension_types_sdk = CliCommandType(
operations_tmpl=consts.EXTENSION_PACKAGE_NAME + '.vendored_sdks.operations.#LocationExtensionTypesOperations.{}',
client_factory=cf_k8s_location_extension_types_operation)
with self.command_group(consts.EXTENSION_NAME + " extension-types", k8s_location_extension_types_sdk, client_factory=cf_k8s_location_extension_types_operation, is_preview=True) \
as g:
g.custom_command('list-by-location', 'list_k8s_location_extension_types', table_transformer=k8s_extension_types_list_table_format)
g.custom_command('list-by-cluster', 'list_extension_types_by_cluster', table_transformer=k8s_extension_types_list_table_format)
g.custom_command('show-by-cluster', 'show_extension_type_by_cluster', table_transformer=k8s_extension_type_show_table_format)

k8s_extension_type_versions_sdk = CliCommandType(
operations_tmpl=consts.EXTENSION_PACKAGE_NAME + '.vendored_sdks.operations.#ExtensionTypeVersionsOperations.{}',
client_factory=cf_k8s_extension_type_versions_operation)
with self.command_group(consts.EXTENSION_NAME + " extension-types", k8s_extension_type_versions_sdk, client_factory=cf_k8s_extension_type_versions_operation, is_preview=True) \
as g:
g.custom_command('list-versions', 'list_k8s_extension_type_versions', table_transformer=k8s_extension_type_versions_list_table_format)
g.custom_command('list-versions-by-cluster', 'list_extension_type_versions_by_cluster', table_transformer=k8s_extension_type_versions_list_table_format)
g.custom_command('show-version-by-cluster', 'show_extension_type_version_by_cluster', table_transformer=k8s_extension_type_version_show_table_format)

g.custom_show_command('show', 'show_extension_type_by_location', deprecate_info=g.deprecate(redirect='az k8s-extension extension-types show-by-cluster', hide=True), table_transformer=k8s_extension_type_show_table_format)

g.custom_command('list', 'list_extension_types_by_cluster', deprecate_info=g.deprecate(redirect='az k8s-extension extension-types list-by-cluster', hide=True), table_transformer=k8s_extension_types_list_table_format)

g.custom_command('list-versions', 'list_extension_type_versions_by_cluster', deprecate_info=g.deprecate(redirect='az k8s-extension extension-types list-versions-by-cluster', hide=True), table_transformer=k8s_extension_type_versions_list_table_format)
2 changes: 1 addition & 1 deletion src/k8s-extension/azext_k8s_extension/consts.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@
APPLIANCE_API_VERSION = "2021-10-31-preview"
HYBRIDCONTAINERSERVICE_API_VERSION = "2022-05-01-preview"

EXTENSION_TYPE_API_VERSION = "2022-01-15-preview"
EXTENSION_TYPE_API_VERSION = "2023-05-01-preview"
Loading