Skip to content

Commit 1c35ced

Browse files
jonathan-innisyuyue9284Yue Yuliakaznshankar13
authored
[k8s-extension] Release v0.7.0 (#3838)
* Create pull.yml * Update pull.yml * Update azure-pipelines.yml * Initial commit of k8s-extension * Update pipelines file * Update CODEOWNERS * Update private preview pipelines * Remove open service mesh from public release * Update pipeline files * Update public extension pipeline * Change condition variable * Add version to public preview/private preview * Update pipelines * Add different testing based on private branch * Add annotations to extension model * Update k8s-custom-pipelines.yml * Update SDKs with Updated Swagger Spec for 2020-07-01-preview (#13) * Update sdks with updated swagger spec * Update version and history rst * Reorder release history timeline * Fix ExtensionInstanceForCreate for import * remove py2 bdist support * Add custom table formatting * Remove unnecessary files * Fix style issues * Fix branch based on comments * Update identity piece manually * Don't handle defaults at the CLI level * Remove defaults from CLI client * Check null target namespace with namespace scope * Update style * Add cassandra operator and location to model * Stage Public Version of k8s-extension 0.2.0 for official release (#15) * Create pull.yml * Update pull.yml * Update azure-pipelines.yml * Initial commit of k8s-extension * Update pipelines file * Update CODEOWNERS * Update private preview pipelines * Remove open service mesh from public release * Update pipeline files * Update public extension pipeline * Change condition variable * Add version to public preview/private preview * Update pipelines * Add different testing based on private branch * Add annotations to extension model * Update k8s-custom-pipelines.yml * Update SDKs with Updated Swagger Spec for 2020-07-01-preview (#13) * Update sdks with updated swagger spec * Update version and history rst * Reorder release history timeline * Fix ExtensionInstanceForCreate for import * remove py2 bdist support * Add custom table formatting * Remove unnecessary files * Fix style issues * Fix branch based on comments * Update identity piece manually * Don't handle defaults at the CLI level * Remove defaults from CLI client * Check null target namespace with namespace scope * Update style * Add cassandra operator and location to model Co-authored-by: [email protected] <Action - Fork Sync> * Remove custom pipelines file * Update extension description, remove private const * Update pipeline file * Disable refs docs * Update to include better create warning logs and remove update context (#20) * Update to include better create warning logs and remove update context * Remove help text for update * Fix spelling error * Update message * Fix k8s-extension conflict with private version * Fix style errors * Fix filename * add customization for microsoft.azureml.kubernetes (#23) * add customization for microsoft.azureml.kubernetes * Update release history Co-authored-by: Yue Yu <[email protected]> Co-authored-by: jonathan-innis <[email protected]> * Add E2E Testing from Separate branch into internal code (#26) * Add internal e2e testing * Change to testing folder * Inference CLI validation for Scoring FE (#24) * cli validation starter * added the call to the fe validation function * nodeport validation not required * test fix Co-authored-by: Jonathan Innis <[email protected]> * legal warning added (#27) * Remove deprecated method logger.warn * Update k8s-custom-pipelines.yml for Azure Pipelines * Update k8s-custom-pipelines.yml for Azure Pipelines * Add Azure Defender to E2E testing (#28) * Add azure defender testing to e2e * Remove the debug flag * Add configuration testing * Fix pipeline failures * Make test script more intuitive * Remove parameter from testing * Fix wrong location for k8s config whl * Fix pip upgrade issue * Fix pip install upgrade issue * Fix pip install issue * delete resurce in testcase (#29) Co-authored-by: Yue Yu <[email protected]> Co-authored-by: Jonathan Innis <[email protected]> * Check Provider is Registered with Subscription Before Making Requests (#18) * Add check for KubernetesConfiguration * Disable pylint and rename * Update provider registration link * Update version * Remove extra blank line * Fix bug in import * only validate scoring fe when inference is enabled (#31) * only validate scoring fe when inference is enabled * Fix versioning Co-authored-by: Yue Yu <[email protected]> Co-authored-by: jonathan-innis <[email protected]> * Provider registration case insensitive * do not validate against scoring fe if inference is not enabled. (#33) * do not validate against scoring fe if inference is not enabled. * add inference enabled scenario * refine * increase sleeping time * fix Co-authored-by: Yue Yu <[email protected]> Co-authored-by: Jonathan Innis <[email protected]> * Add OSM as Public Preview Extension (#34) * Add OSM as public preview extension * Add osm testing * Add release train to tests * Fix failing osm test * Upgrade pip in integration testing * Remove ununsed import * Fix release train check in update * Parallelize E2E Testing (#36) * Add OSM as public preview extension * Add osm testing * Update test logic to parallelize * Fix test success checking * Parallelize extension testing * Better error checking logic * Fix azureml deletion * Fix private build (#40) * change amlk8s to amlarc (#42) Co-authored-by: Yue Yu <[email protected]> * Servicebus client model changes (#44) * Servicebus client model changes * Fix testing script * Update history file and pipeline * Update min cli core version for track 2 updates * Read SSL cert and key from files (#38) * first sketch of the change fixes removed extra blank lines changes regarding param renaming added ssl tests added more detail to the unit test additional import moved pem files out of public folder fixed import chenged import changed import unit tests fix unit test fix fixed unit tests fixed unit test unit test fix changes int test cert and key * test protected config * fix test typo * temporary changes reverted * fixing tests * fixed file paths * removed accidentally added file * changes according to review comments * more changes according to review comments * changes according to review comments Co-authored-by: Jonathan Innis <[email protected]> * Upgrade release version * Liakaz/inference read ssl from file (#47) * first sketch of the change fixes removed extra blank lines changes regarding param renaming added ssl tests added more detail to the unit test additional import moved pem files out of public folder fixed import chenged import changed import unit tests fix unit test fix fixed unit tests fixed unit test unit test fix changes int test cert and key * test protected config * fix test typo * temporary changes reverted * fixing tests * fixed file paths * removed accidentally added file * changes according to review comments * more changes according to review comments * changes according to review comments * fixed decode error * renamed the experimental param Co-authored-by: Jonathan Innis <[email protected]> * Fix style issues (#51) * Fixed scoring fe related extension param names (#49) * fixed scoring fe related extension params * bug fix and style fixes * variable rename * fixed the error type * set cluster to prod by default * Add distro validation for osm-arc (#50) * Add distro validation for osm-arc * fixed indentation * Fix linting * Resolve comments * Add unit test * fix lint Co-authored-by: Jonathan Innis <[email protected]> * Add distro validation for osm-arc (#50) * Add distro validation for osm-arc * fixed indentation * Fix linting * Resolve comments * Add unit test * fix lint Co-authored-by: Jonathan Innis <[email protected]> * Add distro validation for osm-arc (#53) removed release-train logic * Add Custom Delete Logic for Partners (#54) * Add custom delete logic * Fix failing unit tests * Add warning message when deleting amlarc extension (#55) * add warning message * fix indentation * Update release version * Remove Pyhelm from OSM customization (#58) * Fix OSM pyhelm bug * Debug bootstrap error * Update release message * Remove pyhelm dependency * Update tests to only check extensionconfig creation (#61) * Update tests to only check extensionconfig creation * Single set of CRUD for AzureML * Debug logs for connectedk8s * Increase open service mesh version number * Update k8s-extension Models to Track2 (#64) * Update k8s-extension models to track2 * Add debug for failed cleanup * Increase version number * Exit 0 on failed cleanup * Fix identity in wrong place in model (#66) * Readd osm-arc distro validation (#62) * Add distro validation for osm-arc removed release-train logic * Readd osm_arc distro validation * Fix style * Rm space * Edit test * Fixed tests and error logic * Remove dependency * Add delete method Co-authored-by: Jonathan Innis <[email protected]> * Don't Send Identity Headers If In DF (#67) * Don't send identity for clusters in dogfood * Add location to model for identity * Add identity validation to testing * Use default extension with identity instead of Cassandra specific (#69) * Remove the identity check for now * Add -t for clusterType parameter (#71) * Adding a flag for AKS to AMLARC migration and set up corresponding FE… (#65) * Adding a flag for AKS to AMLARC migration and set up corresponding FE helm values * Remove one extra line * Adding Scoring FE IS_AKS_MIGRATION check logic for helm values Co-authored-by: Harry Yang <[email protected]> Co-authored-by: Jonathan Innis <[email protected]> * remove version requirement and auto upgrade minor version check (#72) * Custom User Confirmation for Partners (#70) * Custom user confirmation * Check for disable confirm prompty for confirmation * Add yes to delete command * Code cleanup and style fixes (#73) * Enabled identity by default (#74) * Increase version * Remove testing files Co-authored-by: [email protected] <Action - Fork Sync> Co-authored-by: yuyue9284 <[email protected]> Co-authored-by: Yue Yu <[email protected]> Co-authored-by: Lia Kazakova <[email protected]> Co-authored-by: Niranjan Shankar <[email protected]> Co-authored-by: jingyizhu99 <[email protected]> Co-authored-by: Harry Yang <[email protected]> Co-authored-by: Harry Yang <[email protected]> Co-authored-by: Thomas Stringer <[email protected]>
1 parent c76c466 commit 1c35ced

File tree

15 files changed

+104
-165
lines changed

15 files changed

+104
-165
lines changed

src/k8s-extension/HISTORY.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
33
Release History
44
===============
55

6+
0.7.0
7+
++++++++++++++++++
8+
* Enable identity by default for extensions
9+
* Use custom delete confirmation for partners
10+
* microsoft.azureml.kubernetes: Adding a flag for AKS to AMLARC migration and set up corresponding FE helm values
11+
* microsoft.openservicemesh: Remove version requirement and auto upgrade minor version check
12+
* Adds -t as alternative to --cluster-type
13+
614
0.6.1
715
++++++++++++++++++
816
* Remove sending identity for clusters in Dogfood

src/k8s-extension/azext_k8s_extension/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ def __init__(self, cli_ctx=None):
1717
k8s_extension_custom = CliCommandType(
1818
operations_tmpl=consts.EXTENSION_PACKAGE_NAME + '.custom#{}',
1919
client_factory=cf_k8s_extension)
20-
super(K8sExtensionCommandsLoader, self).__init__(cli_ctx=cli_ctx,
21-
custom_command_type=k8s_extension_custom)
20+
super().__init__(cli_ctx=cli_ctx,
21+
custom_command_type=k8s_extension_custom)
2222

2323
def load_command_table(self, args):
2424
from .commands import load_command_table

src/k8s-extension/azext_k8s_extension/_help.py

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,47 @@
1010

1111
helps[f'{consts.EXTENSION_NAME}'] = """
1212
type: group
13-
short-summary: Commands to manage K8s-extensions.
13+
short-summary: Commands to manage Kubernetes Extensions.
1414
"""
1515

16-
helps[f'{consts.EXTENSION_NAME} create'] = """
16+
helps[f'{consts.EXTENSION_NAME} create'] = f"""
1717
type: command
18-
short-summary: Create a K8s-extension.
18+
short-summary: Create a Kubernetes Extension.
19+
examples:
20+
- name: Create a Kubernetes Extension
21+
text: |-
22+
az {consts.EXTENSION_NAME} create --resource-group my-resource-group \\
23+
--cluster-name mycluster --cluster-type connectedClusters \\
24+
--name myextension --extension-type microsoft.openservicemesh \\
25+
--scope cluster --release-train stable
1926
"""
2027

21-
helps[f'{consts.EXTENSION_NAME} list'] = """
28+
helps[f'{consts.EXTENSION_NAME} list'] = f"""
2229
type: command
23-
short-summary: List K8s-extensions.
30+
short-summary: List Kubernetes Extensions.
31+
examples:
32+
- name: List all Kubernetes Extensions on a cluster
33+
text: |-
34+
az {consts.EXTENSION_NAME} list --resource-group my-resource-group \\
35+
--cluster-name mycluster --cluster-type connectedClusters
2436
"""
2537

26-
helps[f'{consts.EXTENSION_NAME} delete'] = """
38+
helps[f'{consts.EXTENSION_NAME} delete'] = f"""
2739
type: command
28-
short-summary: Delete a K8s-extension.
40+
short-summary: Delete a Kubernetes Extension.
41+
examples:
42+
- name: Delete an existing Kubernetes Extension
43+
text: |-
44+
az {consts.EXTENSION_NAME} delete --resource-group my-resource-group \\
45+
--cluster-name mycluster --cluster-type connectedClusters --name myextension
2946
"""
3047

31-
helps[f'{consts.EXTENSION_NAME} show'] = """
48+
helps[f'{consts.EXTENSION_NAME} show'] = f"""
3249
type: command
33-
short-summary: Show details of a K8s-extension.
50+
short-summary: Show a Kubernetes Extension.
51+
examples:
52+
- name: Show details of a Kubernetes Extension
53+
text: |-
54+
az {consts.EXTENSION_NAME} show --resource-group my-resource-group \\
55+
--cluster-name mycluster --cluster-type connectedClusters --name myextension
3456
"""

src/k8s-extension/azext_k8s_extension/_params.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ def load_arguments(self, _):
3232
help='Name of the Kubernetes cluster')
3333
c.argument('cluster_type',
3434
arg_type=get_enum_type(['connectedClusters', 'managedClusters', 'appliances']),
35+
options_list=['--cluster-type', '-t'],
3536
help='Specify Arc clusters or AKS managed clusters or Arc appliances.')
3637
c.argument('scope',
3738
arg_type=get_enum_type(['cluster', 'namespace']),
@@ -73,3 +74,8 @@ def load_arguments(self, _):
7374
c.argument('target_namespace',
7475
help='Specify the target namespace to install to for the extension instance. This'
7576
' parameter is required if extension scope is set to \'namespace\'')
77+
78+
with self.argument_context(f"{consts.EXTENSION_NAME} delete") as c:
79+
c.argument('yes',
80+
options_list=['--yes', '-y'],
81+
help='Ignore confirmation prompts')

src/k8s-extension/azext_k8s_extension/action.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ def __call__(self, parser, namespace, values, option_string=None):
1616
try:
1717
key, value = item.split('=', 1)
1818
settings[key] = value
19-
except ValueError:
19+
except ValueError as ex:
2020
raise ArgumentUsageError('Usage error: {} configuration_setting_key=configuration_setting_value'.
21-
format(option_string))
22-
super(AddConfigurationSettings, self).__call__(parser, namespace, settings, option_string)
21+
format(option_string)) from ex
22+
super().__call__(parser, namespace, settings, option_string)
2323

2424

2525
# pylint: disable=protected-access, too-few-public-methods
@@ -31,7 +31,7 @@ def __call__(self, parser, namespace, values, option_string=None):
3131
try:
3232
key, value = item.split('=', 1)
3333
prot_settings[key] = value
34-
except ValueError:
34+
except ValueError as ex:
3535
raise ArgumentUsageError('Usage error: {} configuration_protected_setting_key='
36-
'configuration_protected_setting_value'.format(option_string))
37-
super(AddConfigurationProtectedSettings, self).__call__(parser, namespace, prot_settings, option_string)
36+
'configuration_protected_setting_value'.format(option_string)) from ex
37+
super().__call__(parser, namespace, prot_settings, option_string)

src/k8s-extension/azext_k8s_extension/commands.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ def load_command_table(self, _):
2020
is_preview=True) \
2121
as g:
2222
g.custom_command('create', 'create_k8s_extension')
23-
g.custom_command('delete', 'delete_k8s_extension', confirmation=True)
23+
g.custom_command('delete', 'delete_k8s_extension')
2424
g.custom_command('list', 'list_k8s_extension', table_transformer=k8s_extension_list_table_format)
2525
g.custom_show_command('show', 'show_k8s_extension', table_transformer=k8s_extension_show_table_format)

src/k8s-extension/azext_k8s_extension/custom.py

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
from .partner_extensions.ContainerInsights import ContainerInsights
1919
from .partner_extensions.AzureDefender import AzureDefender
20-
from .partner_extensions.Cassandra import Cassandra
2120
from .partner_extensions.AzureMLKubernetes import AzureMLKubernetes
2221
from .partner_extensions.OpenServiceMesh import OpenServiceMesh
2322
from .partner_extensions.DefaultExtension import DefaultExtension
@@ -35,7 +34,6 @@ def ExtensionFactory(extension_name):
3534
'microsoft.azuredefender.kubernetes': AzureDefender,
3635
'microsoft.openservicemesh': OpenServiceMesh,
3736
'microsoft.azureml.kubernetes': AzureMLKubernetes,
38-
'cassandradatacentersoperator': Cassandra,
3937
}
4038

4139
# Return the extension if we find it in the map, else return the default
@@ -67,7 +65,8 @@ def show_k8s_extension(client, resource_group_name, cluster_name, name, cluster_
6765
cluster_rp, cluster_type, cluster_name, name)
6866
else:
6967
message = ex.message
70-
raise ResourceNotFoundError(message)
68+
raise ResourceNotFoundError(message) from ex
69+
raise ex
7170

7271

7372
def create_k8s_extension(cmd, client, resource_group_name, cluster_name, name, cluster_type,
@@ -98,7 +97,7 @@ def create_k8s_extension(cmd, client, resource_group_name, cluster_name, name, c
9897
config_protected_settings = {}
9998
# Get Configuration Settings from file
10099
if configuration_settings_file is not None:
101-
config_settings = __get_config_settings_from_file(configuration_settings_file)
100+
config_settings = __read_config_settings_file(configuration_settings_file)
102101

103102
if configuration_settings is not None:
104103
for dicts in configuration_settings:
@@ -107,7 +106,7 @@ def create_k8s_extension(cmd, client, resource_group_name, cluster_name, name, c
107106

108107
# Get Configuration Protected Settings from file
109108
if configuration_protected_settings_file is not None:
110-
config_protected_settings = __get_config_settings_from_file(configuration_protected_settings_file)
109+
config_protected_settings = __read_config_settings_file(configuration_protected_settings_file)
111110

112111
if configuration_protected_settings is not None:
113112
for dicts in configuration_protected_settings:
@@ -191,7 +190,7 @@ def update_k8s_extension(client, resource_group_name, cluster_type, cluster_name
191190
# return client.update(resource_group_name, cluster_rp, cluster_type, cluster_name, name, upd_extension)
192191

193192

194-
def delete_k8s_extension(client, resource_group_name, cluster_name, name, cluster_type):
193+
def delete_k8s_extension(cmd, client, resource_group_name, cluster_name, name, cluster_type, yes=False):
195194
"""Delete an existing Kubernetes Extension.
196195
197196
"""
@@ -201,12 +200,12 @@ def delete_k8s_extension(client, resource_group_name, cluster_name, name, cluste
201200
try:
202201
extension = client.get(resource_group_name, cluster_rp, cluster_type, cluster_name, name)
203202
except HttpResponseError:
204-
logger.warning("No extension with name '%s' found on cluster '%s', so nothing to delete", cluster_name, name)
203+
logger.warning("No extension with name '%s' found on cluster '%s', so nothing to delete", name, cluster_name)
205204
return None
206205
extension_class = ExtensionFactory(extension.extension_type.lower())
207206

208207
# If there is any custom delete logic, this will call the logic
209-
extension_class.Delete(client, resource_group_name, cluster_name, name, cluster_type)
208+
extension_class.Delete(cmd, client, resource_group_name, cluster_name, name, cluster_type, yes)
210209

211210
return client.delete(resource_group_name, cluster_rp, cluster_type, cluster_name, name)
212211

@@ -281,18 +280,15 @@ def __validate_version_and_auto_upgrade(version, auto_upgrade_minor_version):
281280
auto_upgrade_minor_version = False
282281

283282

284-
def __get_config_settings_from_file(file_path):
283+
def __read_config_settings_file(file_path):
285284
try:
286-
config_file = open(file_path,)
287-
settings = json.load(config_file)
288-
except ValueError:
289-
raise Exception("File {} is not a valid JSON file".format(file_path))
290-
291-
files = len(settings)
292-
if files == 0:
293-
raise Exception("File {} is empty".format(file_path))
294-
295-
return settings
285+
with open(file_path, 'r') as f:
286+
settings = json.load(f)
287+
if len(settings) == 0:
288+
raise Exception("File {} is empty".format(file_path))
289+
return settings
290+
except ValueError as ex:
291+
raise Exception("File {} is not a valid JSON file".format(file_path)) from ex
296292

297293

298294
def __is_dogfood_cluster(cmd):

src/k8s-extension/azext_k8s_extension/partner_extensions/AzureDefender.py

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,16 @@
88
from knack.log import get_logger
99

1010
from ..vendored_sdks.models import ExtensionInstance
11-
from ..vendored_sdks.models import ExtensionInstanceUpdate
1211
from ..vendored_sdks.models import ScopeCluster
1312
from ..vendored_sdks.models import Scope
1413

15-
from .PartnerExtensionModel import PartnerExtensionModel
14+
from .DefaultExtension import DefaultExtension
1615
from .ContainerInsights import _get_container_insights_settings
1716

1817
logger = get_logger(__name__)
1918

2019

21-
class AzureDefender(PartnerExtensionModel):
20+
class AzureDefender(DefaultExtension):
2221
def Create(self, cmd, client, resource_group_name, cluster_name, name, cluster_type, extension_type,
2322
scope, auto_upgrade_minor_version, release_train, version, target_namespace,
2423
release_namespace, configuration_settings, configuration_protected_settings,
@@ -59,17 +58,3 @@ def Create(self, cmd, client, resource_group_name, cluster_name, name, cluster_t
5958
configuration_protected_settings=configuration_protected_settings
6059
)
6160
return extension_instance, name, create_identity
62-
63-
def Update(self, extension, auto_upgrade_minor_version, release_train, version):
64-
"""ExtensionType 'microsoft.azuredefender.kubernetes' specific validations & defaults for Update
65-
Must create and return a valid 'ExtensionInstanceUpdate' object.
66-
67-
"""
68-
return ExtensionInstanceUpdate(
69-
auto_upgrade_minor_version=auto_upgrade_minor_version,
70-
release_train=release_train,
71-
version=version
72-
)
73-
74-
def Delete(self, client, resource_group_name, cluster_name, name, cluster_type):
75-
pass

src/k8s-extension/azext_k8s_extension/partner_extensions/AzureMLKubernetes.py

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import copy
1111
from hashlib import md5
1212
from typing import Any, Dict, List, Tuple
13+
from azext_k8s_extension.partner_extensions.DefaultExtension import DefaultExtension
1314

1415
import azure.mgmt.relay
1516
import azure.mgmt.relay.models
@@ -27,10 +28,9 @@
2728
from msrestazure.azure_exceptions import CloudError
2829

2930
from .._client_factory import cf_resources
30-
from .PartnerExtensionModel import PartnerExtensionModel
31+
from .DefaultExtension import DefaultExtension, user_confirmation_factory
3132
from ..vendored_sdks.models import (
3233
ExtensionInstance,
33-
ExtensionInstanceUpdate,
3434
Scope,
3535
ScopeCluster
3636
)
@@ -41,7 +41,7 @@
4141

4242

4343
# pylint: disable=too-many-instance-attributes
44-
class AzureMLKubernetes(PartnerExtensionModel):
44+
class AzureMLKubernetes(DefaultExtension):
4545
def __init__(self):
4646
# constants for configuration settings.
4747
self.DEFAULT_RELEASE_NAMESPACE = 'azureml'
@@ -82,6 +82,9 @@ def __init__(self):
8282
self.privateEndpointNodeport = 'privateEndpointNodeport'
8383
self.inferenceLoadBalancerHA = 'inferenceLoadBalancerHA'
8484

85+
# constants for existing AKS to AMLARC migration
86+
self.IS_AKS_MIGRATION = 'isAKSMigration'
87+
8588
# reference mapping
8689
self.reference_mapping = {
8790
self.RELAY_SERVER_CONNECTION_STRING: [self.RELAY_CONNECTION_STRING_KEY, self.RELAY_CONNECTION_STRING_DEPRECATED_KEY],
@@ -155,18 +158,12 @@ def Create(self, cmd, client, resource_group_name, cluster_name, name, cluster_t
155158
)
156159
return extension_instance, name, create_identity
157160

158-
def Update(self, extension, auto_upgrade_minor_version, release_train, version):
159-
return ExtensionInstanceUpdate(
160-
auto_upgrade_minor_version=auto_upgrade_minor_version,
161-
release_train=release_train,
162-
version=version
163-
)
164-
165-
def Delete(self, client, resource_group_name, cluster_name, name, cluster_type):
161+
def Delete(self, cmd, client, resource_group_name, cluster_name, name, cluster_type, yes):
166162
# Give a warning message
167163
logger.warning("If nvidia.com/gpu or fuse resource is not recognized by kubernetes after this deletion, "
168164
"you probably have installed nvidia-device-plugin or fuse-device-plugin before installing AMLArc extension. "
169165
"Please try to reinstall device plugins to fix this issue.")
166+
user_confirmation_factory(cmd, yes)
170167

171168
def __validate_config(self, configuration_settings, configuration_protected_settings):
172169
# perform basic validation of the input config
@@ -211,6 +208,12 @@ def __validate_scoring_fe_settings(self, configuration_settings, configuration_p
211208
configuration_settings['clusterPurpose'] = 'DevTest'
212209
else:
213210
configuration_settings['clusterPurpose'] = 'FastProd'
211+
isAKSMigration = _get_value_from_config_protected_config(
212+
self.IS_AKS_MIGRATION, configuration_settings, configuration_protected_settings)
213+
isAKSMigration = str(isAKSMigration).lower() == 'true'
214+
if isAKSMigration:
215+
configuration_settings['scoringFe.namespace'] = "default"
216+
configuration_settings[self.IS_AKS_MIGRATION] = "true"
214217
feSslCertFile = configuration_protected_settings.get(self.sslCertPemFile)
215218
feSslKeyFile = configuration_protected_settings.get(self.sslKeyPemFile)
216219
allowInsecureConnections = _get_value_from_config_protected_config(

src/k8s-extension/azext_k8s_extension/partner_extensions/Cassandra.py

Lines changed: 0 additions & 60 deletions
This file was deleted.

0 commit comments

Comments
 (0)