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-configuration] Release v1.5.0 with updated api-version to 2022-03-01 for GA #4587

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
160 commits
Select commit Hold shift + click to select a range
828f9d3
Create pull.yml
jonathan-innis Mar 10, 2021
1436bfc
Update pull.yml
jonathan-innis Mar 10, 2021
6cffd96
Update azure-pipelines.yml
jonathan-innis Mar 10, 2021
db0f4bd
Initial commit of k8s-extension
jonathan-innis Mar 10, 2021
4293a80
Update CODEOWNERS
jonathan-innis Mar 10, 2021
1b39860
Update azure-pipelines.yml
jonathan-innis Mar 10, 2021
eba804c
Create pull.yml
jonathan-innis Mar 10, 2021
acc9c7e
Update pull.yml
jonathan-innis Mar 10, 2021
6507446
Update pull.yml
jonathan-innis Mar 10, 2021
a0761d9
Update pipelines file
jonathan-innis Mar 10, 2021
4c4ea52
Update k8s-configuration name
jonathan-innis Mar 10, 2021
007e0d3
Update test script params
jonathan-innis Mar 10, 2021
f461b7f
Update pipeline file
jonathan-innis Mar 10, 2021
556f545
Remove codeowners
jonathan-innis Mar 10, 2021
3e2ea64
Update pipelines file
jonathan-innis Mar 10, 2021
9bbc0e4
Update CODEOWNERS
jonathan-innis Mar 10, 2021
8d46cbc
Update private preview pipelines
jonathan-innis Mar 11, 2021
6c3ba41
Remove open service mesh from public release
jonathan-innis Mar 11, 2021
a98e996
Merge pull request #6 from Azure/master
jonathan-innis Mar 11, 2021
43c6796
Update pipeline files
jonathan-innis Mar 11, 2021
c88876f
Update custom pipelines files
jonathan-innis Mar 11, 2021
ea8aa7d
Add publish step to k8s-configuration
jonathan-innis Mar 11, 2021
f9874d6
Update pipeline to publish extension
jonathan-innis Mar 11, 2021
009a83e
Update public extension pipeline
jonathan-innis Mar 12, 2021
8e058c5
Change condition variable
jonathan-innis Mar 12, 2021
664009c
Update pipeline naming
jonathan-innis Mar 12, 2021
dea40c1
Add version to public preview/private preview
jonathan-innis Mar 12, 2021
f56d86a
Merge branch 'master' of https://github.com/Azure/azure-cli-extension…
Mar 12, 2021
69269e0
Merge branch 'master' of https://github.com/Azure/azure-cli-extension…
jonathan-innis Mar 12, 2021
e81e010
Update pipelines
jonathan-innis Mar 12, 2021
9621a48
Add different testing based on private branch
jonathan-innis Mar 12, 2021
862a035
Add annotations to extension model
jonathan-innis Mar 12, 2021
e1c3d12
Update k8s-custom-pipelines.yml
jonathan-innis Mar 15, 2021
3e309bf
Update SDKs with Updated Swagger Spec for 2020-07-01-preview (#13)
jonathan-innis Mar 16, 2021
1df2ef5
remove py2 bdist support
jonathan-innis Mar 16, 2021
054a903
Add custom table formatting
jonathan-innis Mar 16, 2021
b298252
Remove unnecessary files
jonathan-innis Mar 16, 2021
afb4046
Fix style issues
jonathan-innis Mar 16, 2021
49b7eac
Merge branch 'master' of https://github.com/Azure/azure-cli-extension…
Mar 17, 2021
a13304d
Merge branch 'master' of https://github.com/Azure/azure-cli-extension…
Mar 17, 2021
f8ebe35
Merge branch 'master' of https://github.com/Azure/azure-cli-extension…
Mar 17, 2021
aa078b0
Merge branch 'release' into k8s-extension/public
jonathan-innis Mar 17, 2021
21dff06
Fix branch based on comments
jonathan-innis Mar 17, 2021
93919f2
Update identity piece manually
jonathan-innis Mar 17, 2021
a88127a
Merge branch 'k8s-extension/public' of github.com:AzureArcForKubernet…
jonathan-innis Mar 17, 2021
7e40b3a
Don't handle defaults at the CLI level
jonathan-innis Mar 17, 2021
2bf32ac
Merge branch 'release' of https://github.com/AzureArcForKubernetes/az…
Mar 17, 2021
483202c
Merge branch 'master' of https://github.com/Azure/azure-cli-extension…
Mar 17, 2021
d1befa8
Remove defaults from CLI client
jonathan-innis Mar 17, 2021
c7bd93f
Merge branch 'release' into k8s-extension/public
jonathan-innis Mar 17, 2021
076827c
Check null target namespace with namespace scope
jonathan-innis Mar 17, 2021
550eea1
Update style
jonathan-innis Mar 17, 2021
1a17f1b
Merge branch 'k8s-extension/public' of github.com:AzureArcForKubernet…
jonathan-innis Mar 17, 2021
fbab3be
Add cassandra operator and location to model
jonathan-innis Mar 17, 2021
a70b73d
Merge branch 'release' of https://github.com/AzureArcForKubernetes/az…
Mar 18, 2021
9aade9f
Stage Public Version of k8s-extension 0.2.0 for official release (#15)
jonathan-innis Mar 18, 2021
7f79cfb
Remove custom pipelines file
jonathan-innis Mar 18, 2021
1337996
Merge branch 'release' of https://github.com/AzureArcForKubernetes/az…
Mar 19, 2021
34be63a
Merge branch 'release' into k8s-configuration
jonathan-innis Mar 19, 2021
f6e68e9
Merge branch 'master' of https://github.com/Azure/azure-cli-extension…
Mar 20, 2021
113fde8
Merge branch 'release' of https://github.com/AzureArcForKubernetes/az…
Mar 20, 2021
f57af40
Merge branch 'release' of https://github.com/AzureArcForKubernetes/az…
Mar 20, 2021
e75f329
Merge branch 'master' of https://github.com/Azure/azure-cli-extension…
Mar 23, 2021
5668c54
Merge branch 'release' of https://github.com/AzureArcForKubernetes/az…
Mar 23, 2021
a47b63a
Merge branch 'release' of https://github.com/AzureArcForKubernetes/az…
Mar 23, 2021
6c4e0e6
Merge branch 'master' of https://github.com/Azure/azure-cli-extension…
Mar 24, 2021
9ec9b44
Merge branch 'release' of https://github.com/AzureArcForKubernetes/az…
Mar 24, 2021
bb88024
Merge branch 'release' of https://github.com/AzureArcForKubernetes/az…
Mar 24, 2021
9f06b49
Update extension description, remove private const
jonathan-innis Mar 24, 2021
a063594
Merge branch 'release' into k8s-extension/public
jonathan-innis Mar 24, 2021
eb4c58b
Update pipeline file
jonathan-innis Mar 24, 2021
20d809c
Merge branch 'master' of https://github.com/Azure/azure-cli-extension…
Mar 25, 2021
ff96aee
Merge branch 'release' of https://github.com/AzureArcForKubernetes/az…
Mar 25, 2021
9524cda
Merge branch 'release' of https://github.com/AzureArcForKubernetes/az…
Mar 25, 2021
16489b8
Merge branch 'master' of https://github.com/Azure/azure-cli-extension…
Mar 26, 2021
ddefae2
Merge branch 'release' of https://github.com/AzureArcForKubernetes/az…
Mar 26, 2021
ee395f2
Merge branch 'release' of https://github.com/AzureArcForKubernetes/az…
Mar 26, 2021
fbd331c
Merge branch 'master' of https://github.com/Azure/azure-cli-extension…
Mar 27, 2021
12dab3d
Merge branch 'release' of https://github.com/AzureArcForKubernetes/az…
Mar 27, 2021
9c86220
Merge branch 'release' of https://github.com/AzureArcForKubernetes/az…
Mar 27, 2021
89828c5
Merge branch 'master' of https://github.com/Azure/azure-cli-extension…
Mar 31, 2021
bd90584
Merge branch 'release' of https://github.com/AzureArcForKubernetes/az…
Mar 31, 2021
bed066c
Merge branch 'release' of https://github.com/AzureArcForKubernetes/az…
Mar 31, 2021
8011213
Merge branch 'master' of https://github.com/Azure/azure-cli-extension…
Apr 1, 2021
491c1e5
Merge branch 'release' of https://github.com/AzureArcForKubernetes/az…
Apr 1, 2021
4e93618
Merge branch 'release' of https://github.com/AzureArcForKubernetes/az…
Apr 1, 2021
cfd267d
Merge branch 'master' of https://github.com/Azure/azure-cli-extension…
Apr 2, 2021
b9d1778
Merge branch 'release' of https://github.com/AzureArcForKubernetes/az…
Apr 2, 2021
01867ad
Merge branch 'release' of https://github.com/AzureArcForKubernetes/az…
Apr 2, 2021
7a07d52
Disable check ref docs
jonathan-innis Apr 2, 2021
3290f6e
Disable refs docs
jonathan-innis Apr 2, 2021
22c8e92
Update to include better create warning logs and remove update contex…
jonathan-innis Apr 2, 2021
12212f1
Merge branch 'master' of https://github.com/Azure/azure-cli-extension…
Apr 3, 2021
010e9a8
Merge branch 'release' of https://github.com/AzureArcForKubernetes/az…
Apr 3, 2021
4b623b0
Merge branch 'release' of https://github.com/AzureArcForKubernetes/az…
Apr 3, 2021
6bbf418
Merge branch 'master' of https://github.com/Azure/azure-cli-extension…
Apr 11, 2021
c012f56
Merge branch 'master' of https://github.com/Azure/azure-cli-extension…
Apr 11, 2021
df82dd8
Fix k8s-extension conflict with private version
jonathan-innis Apr 14, 2021
0228851
Fix style errors
jonathan-innis Apr 14, 2021
db4c5b2
Fix filename
jonathan-innis Apr 14, 2021
f1287fe
Merge branch 'master' of https://github.com/Azure/azure-cli-extension…
Apr 18, 2021
2971d69
Merge branch 'master' of https://github.com/Azure/azure-cli-extension…
Apr 18, 2021
5077192
add customization for microsoft.azureml.kubernetes (#23)
yuyue9284 Apr 23, 2021
be9e7c3
Merge branch 'master' of https://github.com/Azure/azure-cli-extension…
Apr 25, 2021
dc0c178
Merge branch 'master' of https://github.com/Azure/azure-cli-extension…
Apr 25, 2021
3d15151
Add E2E Testing from Separate branch into internal code (#26)
jonathan-innis Apr 26, 2021
1ded405
Inference CLI validation for Scoring FE (#24)
liakaz Apr 27, 2021
53303d5
legal warning added (#27)
liakaz Apr 27, 2021
3370264
Remove deprecated method logger.warn
jonathan-innis Apr 27, 2021
4c66aef
Update k8s-custom-pipelines.yml for Azure Pipelines
jonathan-innis Apr 27, 2021
e8651f2
Update k8s-custom-pipelines.yml for Azure Pipelines
jonathan-innis Apr 27, 2021
9de1e4e
Add Azure Defender to E2E testing (#28)
jonathan-innis Apr 28, 2021
9c0317d
Add configuration testing
jonathan-innis Apr 28, 2021
4c21482
Fix pipeline failures
jonathan-innis Apr 28, 2021
3e2fb15
Make test script more intuitive
jonathan-innis Apr 29, 2021
4dca64d
Remove parameter from testing
jonathan-innis Apr 29, 2021
4fac0ec
Merge
jonathan-innis Apr 29, 2021
8bc4b2f
Add some debug
jonathan-innis Apr 29, 2021
c93e958
Fix wrong location for k8s config whl
jonathan-innis Apr 29, 2021
56e4115
Merge branch 'k8s-extension/public' into k8s-configuration
jonathan-innis Apr 29, 2021
7adb3b5
Merge branch 'master' of https://github.com/Azure/azure-cli-extension…
jonathan-innis May 3, 2021
fa1e31a
Fix pip install upgrade issue
jonathan-innis May 6, 2021
201c63c
Fix pip install upgrade issue
jonathan-innis May 6, 2021
3a14e45
Merge branch 'k8s-configuration' of github.com:AzureArcForKubernetes/…
jonathan-innis May 6, 2021
1e127fb
Merge branch 'main' of https://github.com/Azure/azure-cli-extensions …
jonathan-innis Jun 28, 2021
c3f7628
Add Check for Provider Registration and Refactor (#19)
jonathan-innis Jun 28, 2021
391f592
Merge branch 'main' of https://github.com/Azure/azure-cli-extensions …
jonathan-innis Jul 19, 2021
1bc3aa4
Testing increase to ubuntu-latest
jonathan-innis Jul 19, 2021
fd97374
Update k8s-configuration Models to Track2 (#63)
jonathan-innis Jul 20, 2021
e3c3e7a
Merge branch 'Azure:main' into k8s-configuration
jonathan-innis Jul 20, 2021
6b2f7dc
Merge branch 'main' of https://github.com/Azure/azure-cli-extensions …
jonathan-innis Aug 27, 2021
3b5c2eb
Upgrade helm operator chart version (#75)
jonathan-innis Aug 31, 2021
dd1d1fb
Merge branch 'main' of https://github.com/Azure/azure-cli-extensions …
jonathan-innis Sep 7, 2021
37bb7c0
Merge branch 'main' of https://github.com/Azure/azure-cli-extensions …
jonathan-innis Sep 20, 2021
e542474
Pin helm version
jonathan-innis Sep 20, 2021
65d9554
Bump version
jonathan-innis Oct 12, 2021
8f622c6
Migrate pipeline (#90)
jonathan-innis Nov 9, 2021
d011762
Disable updates on configuration tests (#89)
jonathan-innis Nov 10, 2021
5482780
Release k8s-configuration v1.2.0 for Flux v2 Public Preview (#86)
jonathan-innis Nov 12, 2021
77d9b19
Merge branch 'main' of https://github.com/Azure/azure-cli-extensions …
jonathan-innis Nov 12, 2021
9051a75
Fix filepath suggestion from CLI team
jonathan-innis Nov 15, 2021
1ba6a35
Fix unneeded file edit
jonathan-innis Nov 15, 2021
1258fb4
Add a Deployed Object List to the Flux CLI (#91)
jonathan-innis Nov 29, 2021
0892f52
Bump version
jonathan-innis Nov 29, 2021
9a953a2
Merge branch 'main' of https://github.com/Azure/azure-cli-extensions …
jonathan-innis Nov 29, 2021
5f7e128
Update deployed object format (#93)
jonathan-innis Nov 30, 2021
235065f
Fix help text for consistency
jonathan-innis Nov 30, 2021
8aedb4e
Enable Bucket Support in the CLI (#92)
jonathan-innis Dec 9, 2021
e6f28f7
Bucket Testing for E2E Testing (#96)
jonathan-innis Dec 10, 2021
603dec5
Merge branch 'main' of https://github.com/Azure/azure-cli-extensions …
jonathan-innis Jan 3, 2022
c07cf2f
Bump version
jonathan-innis Jan 3, 2022
77a958d
Fix help text and parameter naming for bucket (#100)
jonathan-innis Jan 15, 2022
8e772b2
Merge branch 'main' of https://github.com/Azure/azure-cli-extensions …
jonathan-innis Jan 15, 2022
d64797b
Fix default help text for parameters (#101)
jonathan-innis Jan 17, 2022
5f7930d
Edit history with breaking change
jonathan-innis Jan 18, 2022
9e78a18
Prepare GA FluxConfiguration 2022-03-01 (#103)
jonathan-innis Mar 24, 2022
1483d5d
Merge branch 'main' of https://github.com/Azure/azure-cli-extensions …
jonathan-innis Mar 28, 2022
bad3392
Update changelog
jonathan-innis Mar 28, 2022
fb0beab
Make dependencies none when not specified
jonathan-innis Mar 29, 2022
68a9411
Remove unneeded files
jonathan-innis Mar 30, 2022
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
Prev Previous commit
Next Next commit
Initial commit of k8s-extension
  • Loading branch information
jonathan-innis committed Mar 10, 2021
commit db0f4bd7b188c2aa1388ed9366994e5508061483
83 changes: 83 additions & 0 deletions src/k8s-extension/HISTORY.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
.. :changelog:

Release History
===============

0.1.0
++++++++++++++++++
* Initial release.

0.1.1
++++++++++++++++++
* Add support for microsoft-azure-defender extension type

0.1.2
++++++++++++++++++

* Add support for Arc Appliance cluster type

0.1.3
++++++++++++++++++

* Customization for microsoft.openservicemesh

0.1PP.4
++++++++++++++++++

* Refactor for clear separation of extension-type specific customizations
* Introduce new versioning scheme to allow Preview releases by Partners

0.1PP.5
++++++++++++++++++

* OpenServiceMesh customization.
* If Version is passed in, accept None for AutoUpgradeMinorVersion, and not require it to be False.

0.1PP.6
++++++++++++++++++

* OpenServiceMesh customization.
* Scope is always cluster. Version is mandatory for staging and pilot release-trains.

0.1PP.7
++++++++++++++++++

* Fix clusterType of Microsoft.ResourceConnector resource

0.1PP.8
++++++++++++++++++

* Update clusterType validation to allow 'appliances'
* Update identity creation to use the appropriate parent resource's type and api-version
* Throw error if cluster type is not one of the 3 supported types

0.1PP.9
++++++++++++++++++

* Rename azuremonitor-containers extension type to microsoft.azuremonitor.containers

0.1PP.10
++++++++++++++++++

* Add azuremonitor-containers back with alternative microsoft.azuremonitor.containers

0.1PP.11
++++++++++++++++++

* Add shorter aliases for long parameter names

0.1PP.12
++++++++++++++++++

* Remove support for azuremonitor-containers extension type naming

0.1PP.13
++++++++++++++++++

* Move CLI errors to non-deprecated error types
* Remove support for update

0.1PP.14
++++++++++++++++++

* Update help text, group CLI arguments
5 changes: 5 additions & 0 deletions src/k8s-extension/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Microsoft Azure CLI 'k8s-extension' Extension
=============================================

This package is for the 'k8s-extension' extension.
i.e. 'az k8s-extension'
32 changes: 32 additions & 0 deletions src/k8s-extension/azext_k8s_extension/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------

from azure.cli.core import AzCommandsLoader

from azext_k8s_extension._help import helps # pylint: disable=unused-import


class K8sExtensionCommandsLoader(AzCommandsLoader):

def __init__(self, cli_ctx=None):
from azure.cli.core.commands import CliCommandType
from azext_k8s_extension._client_factory import cf_k8s_extension
k8s_extension_custom = CliCommandType(
operations_tmpl='azext_k8s_extension.custom#{}',
client_factory=cf_k8s_extension)
super(K8sExtensionCommandsLoader, self).__init__(cli_ctx=cli_ctx,
custom_command_type=k8s_extension_custom)

def load_command_table(self, args):
from azext_k8s_extension.commands import load_command_table
load_command_table(self, args)
return self.command_table

def load_arguments(self, command):
from azext_k8s_extension._params import load_arguments
load_arguments(self, command)


COMMAND_LOADER_CLS = K8sExtensionCommandsLoader
31 changes: 31 additions & 0 deletions src/k8s-extension/azext_k8s_extension/_client_factory.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------

from azure.cli.core.commands.client_factory import get_mgmt_service_client
from azure.cli.core.profiles import ResourceType


def cf_k8s_extension(cli_ctx, *_):
from azext_k8s_extension.vendored_sdks import K8sExtensionClient
return get_mgmt_service_client(cli_ctx, K8sExtensionClient)


def cf_k8s_extension_operation(cli_ctx, _):
return cf_k8s_extension(cli_ctx).k8s_extensions


def cf_resource_groups(cli_ctx, subscription_id=None):
return get_mgmt_service_client(cli_ctx, ResourceType.MGMT_RESOURCE_RESOURCES,
subscription_id=subscription_id).resource_groups


def cf_resources(cli_ctx, subscription_id=None):
return get_mgmt_service_client(cli_ctx, ResourceType.MGMT_RESOURCE_RESOURCES,
subscription_id=subscription_id).resources


def cf_log_analytics(cli_ctx, subscription_id=None):
from azure.mgmt.loganalytics import LogAnalyticsManagementClient # pylint: disable=no-name-in-module
return get_mgmt_service_client(cli_ctx, LogAnalyticsManagementClient, subscription_id=subscription_id)
38 changes: 38 additions & 0 deletions src/k8s-extension/azext_k8s_extension/_help.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# coding=utf-8
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------

from knack.help_files import helps # pylint: disable=unused-import


helps['k8s-extension'] = """
type: group
short-summary: Commands to manage K8s-extensions.
"""

helps['k8s-extension create'] = """
type: command
short-summary: Create a K8s-extension.
"""

helps['k8s-extension list'] = """
type: command
short-summary: List K8s-extensions.
"""

helps['k8s-extension delete'] = """
type: command
short-summary: Delete a K8s-extension.
"""

helps['k8s-extension show'] = """
type: command
short-summary: Show details of a K8s-extension.
"""

helps['k8s-extension update'] = """
type: command
short-summary: Update a K8s-extension.
"""
73 changes: 73 additions & 0 deletions src/k8s-extension/azext_k8s_extension/_params.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------

from azure.cli.core.commands.parameters import (
get_enum_type,
get_three_state_flag,
tags_type
)
from azure.cli.core.commands.validators import get_default_location_from_resource_group

from azext_k8s_extension.action import (
AddConfigurationSettings,
AddConfigurationProtectedSettings
)


def load_arguments(self, _):
with self.argument_context('k8s-extension') as c:
c.argument('tags', tags_type)
c.argument('location',
validator=get_default_location_from_resource_group)
c.argument('name',
options_list=['--name', '-n'],
help='Name of the extension instance')
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']),
help='Specify Arc clusters or AKS managed clusters or Arc appliances.')
c.argument('scope',
arg_type=get_enum_type(['cluster', 'namespace']),
help='Specify the extension scope.')
c.argument('auto_upgrade_minor_version',
arg_group="Version",
options_list=['--auto-upgrade-minor-version', '--auto-upgrade'],
arg_type=get_three_state_flag(),
help='Automatically upgrade minor version of the extension instance.')
c.argument('version',
arg_group="Version",
help='Specify the version to install for the extension instance if'
' --auto-upgrade-minor-version is not enabled.')
c.argument('configuration_settings',
arg_group="Configuration",
options_list=['--configuration-settings', '--config'],
action=AddConfigurationSettings,
nargs='+',
help='Configuration Settings as key=value pair. Repeat parameter for each setting')
c.argument('configuration_protected_settings',
arg_group="Configuration",
options_list=['--configuration-protected-settings', '--config-protected'],
action=AddConfigurationProtectedSettings,
nargs='+',
help='Configuration Protected Settings as key=value pair. Repeat parameter for each setting')
c.argument('configuration_settings_file',
arg_group="Configuration",
options_list=['--configuration-settings-file', '--config-file'],
help='JSON file path for configuration-settings')
c.argument('configuration_protected_settings_file',
arg_group="Configuration",
options_list=['--configuration-protected-settings-file', '--config-protected-file'],
help='JSON file path for configuration-protected-settings')
c.argument('release_namespace',
help='Specify the namespace to install the extension release.')
c.argument('release_train',
help='Specify the release train for the extension type.')
c.argument('target_namespace',
help='Specify the target namespace to install to for the extension instance. This'
' parameter is required if extension scope is set to \'namespace\'')
21 changes: 21 additions & 0 deletions src/k8s-extension/azext_k8s_extension/_validators.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------


def example_name_or_id_validator(cmd, namespace):
# Example of a storage account name or ID validator.
# See: https://github.com/Azure/azure-cli/blob/dev/doc/authoring_command_modules/authoring_commands.md#supporting-name-or-id-parameters # pylint: disable=line-too-long

from azure.cli.core.commands.client_factory import get_subscription_id
from msrestazure.tools import is_valid_resource_id, resource_id
if namespace.storage_account:
if not is_valid_resource_id(namespace.RESOURCE):
namespace.storage_account = resource_id(
subscription=get_subscription_id(cmd.cli_ctx),
resource_group=namespace.resource_group_name,
namespace='Microsoft.Storage',
type='storageAccounts',
name=namespace.storage_account
)
37 changes: 37 additions & 0 deletions src/k8s-extension/azext_k8s_extension/action.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------

import argparse
from azure.cli.core.azclierror import ArgumentUsageError


# pylint: disable=protected-access, too-few-public-methods
class AddConfigurationSettings(argparse._AppendAction):

def __call__(self, parser, namespace, values, option_string=None):
settings = {}
for item in values:
try:
key, value = item.split('=', 1)
settings[key] = value
except ValueError:
raise ArgumentUsageError('Usage error: {} configuration_setting_key=configuration_setting_value'.
format(option_string))
super(AddConfigurationSettings, self).__call__(parser, namespace, settings, option_string)


# pylint: disable=protected-access, too-few-public-methods
class AddConfigurationProtectedSettings(argparse._AppendAction):

def __call__(self, parser, namespace, values, option_string=None):
prot_settings = {}
for item in values:
try:
key, value = item.split('=', 1)
prot_settings[key] = value
except ValueError:
raise ArgumentUsageError('Usage error: {} configuration_protected_setting_key='
'configuration_protected_setting_value'.format(option_string))
super(AddConfigurationProtectedSettings, self).__call__(parser, namespace, prot_settings, option_string)
4 changes: 4 additions & 0 deletions src/k8s-extension/azext_k8s_extension/azext_metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"azext.isPreview": true,
"azext.minCliCoreVersion": "2.15.0"
}
24 changes: 24 additions & 0 deletions src/k8s-extension/azext_k8s_extension/commands.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------

# pylint: disable=line-too-long
from azure.cli.core.commands import CliCommandType
from azext_k8s_extension._client_factory import (cf_k8s_extension, cf_k8s_extension_operation)


def load_command_table(self, _):

k8s_extension_sdk = CliCommandType(
operations_tmpl='azext_k8s_extension.vendored_sdks.operations#K8sExtensionsOperations.{}',
client_factory=cf_k8s_extension)

with self.command_group('k8s-extension', k8s_extension_sdk, client_factory=cf_k8s_extension_operation,
is_preview=True) \
as g:
g.custom_command('create', 'create_k8s_extension')
g.custom_command('update', 'update_k8s_extension')
g.custom_command('delete', 'delete_k8s_extension', confirmation=True)
g.custom_command('list', 'list_k8s_extension')
g.custom_show_command('show', 'show_k8s_extension')
Loading