diff --git a/src/k8s-extension/azext_k8s_extension/custom.py b/src/k8s-extension/azext_k8s_extension/custom.py index 504539179d1..8d6b82d1885 100644 --- a/src/k8s-extension/azext_k8s_extension/custom.py +++ b/src/k8s-extension/azext_k8s_extension/custom.py @@ -195,6 +195,17 @@ def delete_k8s_extension(client, resource_group_name, cluster_name, name, cluste """ # Determine ClusterRP cluster_rp = __get_cluster_rp(cluster_type) + extension = None + try: + extension = client.get(resource_group_name, cluster_rp, cluster_type, cluster_name, name) + except ErrorResponseException: + logger.warning("No extension with name '%s' found on cluster '%s', so nothing to delete", cluster_name, name) + return None + extension_class = ExtensionFactory(extension.extension_type.lower()) + + # If there is any custom delete logic, this will call the logic + extension_class.Delete(client, resource_group_name, cluster_name, name, cluster_type) + return client.delete(resource_group_name, cluster_rp, cluster_type, cluster_name, name) diff --git a/src/k8s-extension/azext_k8s_extension/partner_extensions/AzureDefender.py b/src/k8s-extension/azext_k8s_extension/partner_extensions/AzureDefender.py index a3e805006de..ffb6a926328 100644 --- a/src/k8s-extension/azext_k8s_extension/partner_extensions/AzureDefender.py +++ b/src/k8s-extension/azext_k8s_extension/partner_extensions/AzureDefender.py @@ -70,3 +70,6 @@ def Update(self, extension, auto_upgrade_minor_version, release_train, version): release_train=release_train, version=version ) + + def Delete(self, client, resource_group_name, cluster_name, name, cluster_type): + pass diff --git a/src/k8s-extension/azext_k8s_extension/partner_extensions/AzureMLKubernetes.py b/src/k8s-extension/azext_k8s_extension/partner_extensions/AzureMLKubernetes.py index bd49a164a3b..83a38b7f25d 100644 --- a/src/k8s-extension/azext_k8s_extension/partner_extensions/AzureMLKubernetes.py +++ b/src/k8s-extension/azext_k8s_extension/partner_extensions/AzureMLKubernetes.py @@ -162,6 +162,9 @@ def Update(self, extension, auto_upgrade_minor_version, release_train, version): version=version ) + def Delete(self, client, resource_group_name, cluster_name, name, cluster_type): + pass + def __validate_config(self, configuration_settings, configuration_protected_settings): # perform basic validation of the input config config_keys = configuration_settings.keys() @@ -226,7 +229,7 @@ def __validate_scoring_fe_settings(self, configuration_settings, configuration_p if feIsNodePort and feIsInternalLoadBalancer: raise MutuallyExclusiveArgumentError( "Specify either privateEndpointNodeport=true or privateEndpointILB=true, but not both.") - elif feIsNodePort: + if feIsNodePort: configuration_settings['scoringFe.serviceType.nodePort'] = feIsNodePort elif feIsInternalLoadBalancer: configuration_settings['scoringFe.serviceType.internalLoadBalancer'] = feIsInternalLoadBalancer diff --git a/src/k8s-extension/azext_k8s_extension/partner_extensions/Cassandra.py b/src/k8s-extension/azext_k8s_extension/partner_extensions/Cassandra.py index 2357bf08af6..289e8053223 100644 --- a/src/k8s-extension/azext_k8s_extension/partner_extensions/Cassandra.py +++ b/src/k8s-extension/azext_k8s_extension/partner_extensions/Cassandra.py @@ -55,3 +55,6 @@ def Update(self, extension, auto_upgrade_minor_version, release_train, version): release_train=release_train, version=version ) + + def Delete(self, client, resource_group_name, cluster_name, name, cluster_type): + pass diff --git a/src/k8s-extension/azext_k8s_extension/partner_extensions/ContainerInsights.py b/src/k8s-extension/azext_k8s_extension/partner_extensions/ContainerInsights.py index e42f22199da..1c2a334cdda 100644 --- a/src/k8s-extension/azext_k8s_extension/partner_extensions/ContainerInsights.py +++ b/src/k8s-extension/azext_k8s_extension/partner_extensions/ContainerInsights.py @@ -82,6 +82,9 @@ def Update(self, extension, auto_upgrade_minor_version, release_train, version): version=version ) + def Delete(self, client, resource_group_name, cluster_name, name, cluster_type): + pass + # Custom Validation Logic for Container Insights diff --git a/src/k8s-extension/azext_k8s_extension/partner_extensions/DefaultExtension.py b/src/k8s-extension/azext_k8s_extension/partner_extensions/DefaultExtension.py index a72aef847fc..8977ec4187e 100644 --- a/src/k8s-extension/azext_k8s_extension/partner_extensions/DefaultExtension.py +++ b/src/k8s-extension/azext_k8s_extension/partner_extensions/DefaultExtension.py @@ -55,3 +55,6 @@ def Update(self, extension, auto_upgrade_minor_version, release_train, version): release_train=release_train, version=version ) + + def Delete(self, client, resource_group_name, cluster_name, name, cluster_type): + pass diff --git a/src/k8s-extension/azext_k8s_extension/partner_extensions/OpenServiceMesh.py b/src/k8s-extension/azext_k8s_extension/partner_extensions/OpenServiceMesh.py index 4839c5d763a..c5ad73ac35f 100644 --- a/src/k8s-extension/azext_k8s_extension/partner_extensions/OpenServiceMesh.py +++ b/src/k8s-extension/azext_k8s_extension/partner_extensions/OpenServiceMesh.py @@ -4,6 +4,8 @@ # -------------------------------------------------------------------------------------------- # pylint: disable=unused-argument +# pylint: disable=redefined-outer-name +# pylint: disable=no-member from knack.log import get_logger @@ -101,6 +103,9 @@ def Update(self, extension, auto_upgrade_minor_version, release_train, version): version=version ) + def Delete(self, client, resource_group_name, cluster_name, name, cluster_type): + pass + def _validate_tested_distro(cmd, cluster_resource_group_name, cluster_name, extension_version): diff --git a/src/k8s-extension/azext_k8s_extension/partner_extensions/PartnerExtensionModel.py b/src/k8s-extension/azext_k8s_extension/partner_extensions/PartnerExtensionModel.py index b8cb01334d3..98a6c1ea63f 100644 --- a/src/k8s-extension/azext_k8s_extension/partner_extensions/PartnerExtensionModel.py +++ b/src/k8s-extension/azext_k8s_extension/partner_extensions/PartnerExtensionModel.py @@ -21,3 +21,7 @@ def Create(self, cmd, client, resource_group_name: str, cluster_name: str, name: def Update(self, extension: ExtensionInstance, auto_upgrade_minor_version: bool, release_train: str, version: str) -> ExtensionInstanceUpdate: pass + + @abstractmethod + def Delete(self, client, resource_group_name: str, cluster_name: str, name: str, cluster_type: str): + pass diff --git a/src/k8s-extension/azext_k8s_extension/tests/latest/recordings/test_k8s_extension.yaml b/src/k8s-extension/azext_k8s_extension/tests/latest/recordings/test_k8s_extension.yaml index 127b21ac873..c55ebb0a737 100644 --- a/src/k8s-extension/azext_k8s_extension/tests/latest/recordings/test_k8s_extension.yaml +++ b/src/k8s-extension/azext_k8s_extension/tests/latest/recordings/test_k8s_extension.yaml @@ -1,9 +1,58 @@ interactions: - request: - body: '{"properties": {"extensionType": "microsoft.openservicemesh", "autoUpgradeMinorVersion": - false, "releaseTrain": "staging", "version": "0.1.0", "scope": {"cluster": {}}, - "configurationSettings": {}, "configurationProtectedSettings": {}}, "location": - ""}' + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - k8s-extension create + Connection: + - keep-alive + ParameterSetName: + - -g -n -c --cluster-type --extension-type --release-train --version + User-Agent: + - AZURECLI/2.24.2 azsdk-python-azure-mgmt-resource/18.0.0 Python/3.9.0 (Windows-10-10.0.19041-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KubernetesConfiguration?api-version=2021-04-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KubernetesConfiguration","namespace":"Microsoft.KubernetesConfiguration","authorizations":[{"applicationId":"c699bf69-fb1d-4eaf-999b-99e6b2ae4d85","roleDefinitionId":"90155430-a360-410f-af5d-89dc284d85c6"},{"applicationId":"03db181c-e9d3-4868-9097-f0b728327182","roleDefinitionId":"DE2ADB97-42D8-49C8-8FCF-DBB53EF936AC"},{"applicationId":"a0f92522-89de-4c5e-9a75-0044ccf66efd","roleDefinitionId":"b3429810-7d5c-420e-8605-cf280f3099f2"},{"applicationId":"bd9b7cd5-dac1-495f-b013-ac871e98fa5f","roleDefinitionId":"0d44c8f0-08b9-44d4-9f59-e51c83f95200"}],"resourceTypes":[{"resourceType":"sourceControlConfigurations","locations":["East + US","West Europe","West Central US","West US 2","South Central US","East US + 2","North Europe","UK South","Southeast Asia","Australia East","France Central","East + US 2 EUAP"],"apiVersions":["2021-03-01","2020-10-01-preview","2020-07-01-preview","2019-11-01-preview"],"defaultApiVersion":"2021-03-01","capabilities":"SupportsExtension"},{"resourceType":"extensions","locations":["East + US","West Europe","West Central US","West US 2","South Central US","East US + 2","North Europe","UK South","Southeast Asia","Australia East","France Central","East + US 2 EUAP"],"apiVersions":["2021-05-01-preview","2020-07-01-preview"],"capabilities":"SystemAssignedResourceIdentity, + SupportsExtension"},{"resourceType":"operations","locations":[],"apiVersions":["2021-05-01-preview","2021-03-01","2020-10-01-preview","2020-07-01-preview","2019-11-01-preview"],"capabilities":"None"}],"registrationState":"Registered","registrationPolicy":"RegistrationRequired"}' + headers: + cache-control: + - no-cache + content-length: + - '1654' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 22 Jun 2021 23:19:11 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: '{"location": "", "properties": {"extensionType": "microsoft.openservicemesh", + "autoUpgradeMinorVersion": false, "releaseTrain": "pilot", "version": "0.8.3", + "scope": {"cluster": {}}, "configurationSettings": {}, "configurationProtectedSettings": + {}}}' headers: Accept: - application/json @@ -14,32 +63,32 @@ interactions: Connection: - keep-alive Content-Length: - - '252' + - '250' Content-Type: - application/json; charset=utf-8 ParameterSetName: - -g -n -c --cluster-type --extension-type --release-train --version User-Agent: - python/3.9.0 (Windows-10-10.0.19041-SP0) msrest/0.6.21 msrest_azure/0.6.4 - azure-mgmt-kubernetesconfiguration/0.1.0 Azure-SDK-For-Python AZURECLI/2.19.1 + azure-mgmt-kubernetesconfiguration/0.3.0 Azure-SDK-For-Python AZURECLI/2.24.2 accept-language: - en-US method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/nanthirg0923/providers/Microsoft.Kubernetes/connectedClusters/nanthicluster0923/providers/Microsoft.KubernetesConfiguration/extensions/openservice-mesh?api-version=2020-07-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/nanthirg0923/providers/Microsoft.Kubernetes/connectedClusters/nanthicluster0923/providers/Microsoft.KubernetesConfiguration/extensions/openservicemesh?api-version=2020-07-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/nanthirg0923/providers/Microsoft.Kubernetes/connectedClusters/nanthicluster0923/providers/Microsoft.KubernetesConfiguration/extensions/openservice-mesh","name":"openservice-mesh","type":"Microsoft.KubernetesConfiguration/extensions","properties":{"configurationSettings":{},"statuses":[],"extensionType":"microsoft.openservicemesh","autoUpgradeMinorVersion":false,"releaseTrain":"staging","version":"0.1.0","scope":{"cluster":{"releaseNamespace":"arc-osm-system"}},"installState":"Pending","lastStatusTime":null,"errorInfo":{},"creationTime":"2021-03-08T23:14:12.4010326+00:00","lastModifiedTime":"2021-03-08T23:14:12.4010327+00:00"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/nanthirg0923/providers/Microsoft.Kubernetes/connectedClusters/nanthicluster0923/providers/Microsoft.KubernetesConfiguration/extensions/openservicemesh","name":"openservicemesh","type":"Microsoft.KubernetesConfiguration/extensions","properties":{"configurationSettings":{},"statuses":[],"extensionType":"microsoft.openservicemesh","autoUpgradeMinorVersion":false,"releaseTrain":"pilot","version":"0.8.3","scope":{"cluster":{"releaseNamespace":"arc-osm-system"}},"installState":"Pending","lastStatusTime":null,"errorInfo":{},"creationTime":"2021-06-22T23:19:13.9750935+00:00","lastModifiedTime":"2021-06-22T23:19:13.9750935+00:00"}}' headers: api-supported-versions: - - 2020-07-01-Preview + - 2020-07-01-Preview, 2021-05-01-preview cache-control: - no-cache content-length: - - '708' + - '704' content-type: - application/json; charset=utf-8 date: - - Mon, 08 Mar 2021 23:14:11 GMT + - Tue, 22 Jun 2021 23:19:13 GMT expires: - '-1' pragma: @@ -74,25 +123,25 @@ interactions: - -c -g --cluster-type User-Agent: - python/3.9.0 (Windows-10-10.0.19041-SP0) msrest/0.6.21 msrest_azure/0.6.4 - azure-mgmt-kubernetesconfiguration/0.1.0 Azure-SDK-For-Python AZURECLI/2.19.1 + azure-mgmt-kubernetesconfiguration/0.3.0 Azure-SDK-For-Python AZURECLI/2.24.2 accept-language: - en-US method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/nanthirg0923/providers/Microsoft.Kubernetes/connectedClusters/nanthicluster0923/providers/Microsoft.KubernetesConfiguration/extensions?api-version=2020-07-01-preview response: body: - string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/nanthirg0923/providers/Microsoft.Kubernetes/connectedClusters/nanthicluster0923/providers/Microsoft.KubernetesConfiguration/extensions/openservice-mesh","name":"openservice-mesh","type":"Microsoft.KubernetesConfiguration/extensions","properties":{"extensionType":"microsoft.openservicemesh","autoUpgradeMinorVersion":false,"releaseTrain":"staging","version":"0.1.0","scope":{"cluster":{"releaseNamespace":"arc-osm-system"}},"installState":"Pending","lastStatusTime":null,"errorInfo":{},"creationTime":"2021-03-08T23:14:12.4010326+00:00","lastModifiedTime":"2021-03-08T23:14:12.4010327+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/nanthirg0923/providers/Microsoft.Kubernetes/connectedClusters/nanthicluster0923/providers/Microsoft.KubernetesConfiguration/extensions/hci22jan21","name":"hci22jan21","type":"Microsoft.KubernetesConfiguration/extensions","properties":{"extensionType":"microsoft.azstackhci.operator","autoUpgradeMinorVersion":true,"releaseTrain":"stable","version":"1.0.0","scope":{"cluster":{"releaseNamespace":null}},"installState":"Pending","lastStatusTime":null,"errorInfo":{},"creationTime":"2021-01-22T20:49:34.3336157+00:00","lastModifiedTime":"2021-01-22T20:49:34.3336249+00:00"}}],"nextLink":null}' + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/nanthirg0923/providers/Microsoft.Kubernetes/connectedClusters/nanthicluster0923/providers/Microsoft.KubernetesConfiguration/extensions/openservicemesh","name":"openservicemesh","type":"Microsoft.KubernetesConfiguration/extensions","properties":{"extensionType":"microsoft.openservicemesh","autoUpgradeMinorVersion":false,"releaseTrain":"pilot","version":"0.8.3","scope":{"cluster":{"releaseNamespace":"arc-osm-system"}},"installState":"Pending","lastStatusTime":null,"errorInfo":{},"creationTime":"2021-06-22T23:19:13.9750935+00:00","lastModifiedTime":"2021-06-22T23:19:13.9750935+00:00"}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/nanthirg0923/providers/Microsoft.Kubernetes/connectedClusters/nanthicluster0923/providers/Microsoft.KubernetesConfiguration/extensions/hci22jan21","name":"hci22jan21","type":"Microsoft.KubernetesConfiguration/extensions","properties":{"extensionType":"microsoft.azstackhci.operator","autoUpgradeMinorVersion":true,"releaseTrain":"stable","version":"1.0.0","scope":{"cluster":{"releaseNamespace":null}},"installState":"Pending","lastStatusTime":null,"errorInfo":{},"creationTime":"2021-01-22T20:49:34.3336157+00:00","lastModifiedTime":"2021-01-22T20:49:34.3336249+00:00"}}],"nextLink":null}' headers: api-supported-versions: - - 2020-07-01-Preview + - 2020-07-01-Preview, 2021-05-01-preview cache-control: - no-cache content-length: - - '1341' + - '1337' content-type: - application/json; charset=utf-8 date: - - Mon, 08 Mar 2021 23:14:13 GMT + - Tue, 22 Jun 2021 23:19:14 GMT expires: - '-1' pragma: @@ -125,25 +174,76 @@ interactions: - -c -g -n --cluster-type User-Agent: - python/3.9.0 (Windows-10-10.0.19041-SP0) msrest/0.6.21 msrest_azure/0.6.4 - azure-mgmt-kubernetesconfiguration/0.1.0 Azure-SDK-For-Python AZURECLI/2.19.1 + azure-mgmt-kubernetesconfiguration/0.3.0 Azure-SDK-For-Python AZURECLI/2.24.2 + accept-language: + - en-US + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/nanthirg0923/providers/Microsoft.Kubernetes/connectedClusters/nanthicluster0923/providers/Microsoft.KubernetesConfiguration/extensions/openservicemesh?api-version=2020-07-01-preview + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/nanthirg0923/providers/Microsoft.Kubernetes/connectedClusters/nanthicluster0923/providers/Microsoft.KubernetesConfiguration/extensions/openservicemesh","name":"openservicemesh","type":"Microsoft.KubernetesConfiguration/extensions","properties":{"configurationSettings":{},"statuses":[],"extensionType":"microsoft.openservicemesh","autoUpgradeMinorVersion":false,"releaseTrain":"pilot","version":"0.8.3","scope":{"cluster":{"releaseNamespace":"arc-osm-system"}},"installState":"Pending","lastStatusTime":null,"errorInfo":{},"creationTime":"2021-06-22T23:19:13.9750935+00:00","lastModifiedTime":"2021-06-22T23:19:13.9750935+00:00"}}' + headers: + api-supported-versions: + - 2020-07-01-Preview, 2021-05-01-preview + cache-control: + - no-cache + content-length: + - '704' + content-type: + - application/json; charset=utf-8 + date: + - Tue, 22 Jun 2021 23:19:15 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - openresty/1.15.8.2 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding,Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - k8s-extension delete + Connection: + - keep-alive + ParameterSetName: + - -g -c -n --cluster-type -y + User-Agent: + - python/3.9.0 (Windows-10-10.0.19041-SP0) msrest/0.6.21 msrest_azure/0.6.4 + azure-mgmt-kubernetesconfiguration/0.3.0 Azure-SDK-For-Python AZURECLI/2.24.2 accept-language: - en-US method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/nanthirg0923/providers/Microsoft.Kubernetes/connectedClusters/nanthicluster0923/providers/Microsoft.KubernetesConfiguration/extensions/openservice-mesh?api-version=2020-07-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/nanthirg0923/providers/Microsoft.Kubernetes/connectedClusters/nanthicluster0923/providers/Microsoft.KubernetesConfiguration/extensions/openservicemesh?api-version=2020-07-01-preview response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/nanthirg0923/providers/Microsoft.Kubernetes/connectedClusters/nanthicluster0923/providers/Microsoft.KubernetesConfiguration/extensions/openservice-mesh","name":"openservice-mesh","type":"Microsoft.KubernetesConfiguration/extensions","properties":{"configurationSettings":{},"statuses":[],"extensionType":"microsoft.openservicemesh","autoUpgradeMinorVersion":false,"releaseTrain":"staging","version":"0.1.0","scope":{"cluster":{"releaseNamespace":"arc-osm-system"}},"installState":"Pending","lastStatusTime":null,"errorInfo":{},"creationTime":"2021-03-08T23:14:12.4010326+00:00","lastModifiedTime":"2021-03-08T23:14:12.4010327+00:00"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/nanthirg0923/providers/Microsoft.Kubernetes/connectedClusters/nanthicluster0923/providers/Microsoft.KubernetesConfiguration/extensions/openservicemesh","name":"openservicemesh","type":"Microsoft.KubernetesConfiguration/extensions","properties":{"configurationSettings":{},"statuses":[],"extensionType":"microsoft.openservicemesh","autoUpgradeMinorVersion":false,"releaseTrain":"pilot","version":"0.8.3","scope":{"cluster":{"releaseNamespace":"arc-osm-system"}},"installState":"Pending","lastStatusTime":null,"errorInfo":{},"creationTime":"2021-06-22T23:19:13.9750935+00:00","lastModifiedTime":"2021-06-22T23:19:13.9750935+00:00"}}' headers: api-supported-versions: - - 2020-07-01-Preview + - 2020-07-01-Preview, 2021-05-01-preview cache-control: - no-cache content-length: - - '708' + - '704' content-type: - application/json; charset=utf-8 date: - - Mon, 08 Mar 2021 23:14:14 GMT + - Tue, 22 Jun 2021 23:19:16 GMT expires: - '-1' pragma: @@ -178,17 +278,17 @@ interactions: - -g -c -n --cluster-type -y User-Agent: - python/3.9.0 (Windows-10-10.0.19041-SP0) msrest/0.6.21 msrest_azure/0.6.4 - azure-mgmt-kubernetesconfiguration/0.1.0 Azure-SDK-For-Python AZURECLI/2.19.1 + azure-mgmt-kubernetesconfiguration/0.3.0 Azure-SDK-For-Python AZURECLI/2.24.2 accept-language: - en-US method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/nanthirg0923/providers/Microsoft.Kubernetes/connectedClusters/nanthicluster0923/providers/Microsoft.KubernetesConfiguration/extensions/openservice-mesh?api-version=2020-07-01-preview + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/nanthirg0923/providers/Microsoft.Kubernetes/connectedClusters/nanthicluster0923/providers/Microsoft.KubernetesConfiguration/extensions/openservicemesh?api-version=2020-07-01-preview response: body: string: '{"content":null,"statusCode":200,"headers":[],"version":"1.1","reasonPhrase":"OK","trailingHeaders":[],"requestMessage":null,"isSuccessStatusCode":true}' headers: api-supported-versions: - - 2020-07-01-Preview + - 2020-07-01-Preview, 2021-05-01-preview cache-control: - no-cache content-length: @@ -196,7 +296,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 08 Mar 2021 23:14:14 GMT + - Tue, 22 Jun 2021 23:19:17 GMT expires: - '-1' pragma: @@ -231,7 +331,7 @@ interactions: - -c -g --cluster-type User-Agent: - python/3.9.0 (Windows-10-10.0.19041-SP0) msrest/0.6.21 msrest_azure/0.6.4 - azure-mgmt-kubernetesconfiguration/0.1.0 Azure-SDK-For-Python AZURECLI/2.19.1 + azure-mgmt-kubernetesconfiguration/0.3.0 Azure-SDK-For-Python AZURECLI/2.24.2 accept-language: - en-US method: GET @@ -241,7 +341,7 @@ interactions: string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/nanthirg0923/providers/Microsoft.Kubernetes/connectedClusters/nanthicluster0923/providers/Microsoft.KubernetesConfiguration/extensions/hci22jan21","name":"hci22jan21","type":"Microsoft.KubernetesConfiguration/extensions","properties":{"extensionType":"microsoft.azstackhci.operator","autoUpgradeMinorVersion":true,"releaseTrain":"stable","version":"1.0.0","scope":{"cluster":{"releaseNamespace":null}},"installState":"Pending","lastStatusTime":null,"errorInfo":{},"creationTime":"2021-01-22T20:49:34.3336157+00:00","lastModifiedTime":"2021-01-22T20:49:34.3336249+00:00"}}],"nextLink":null}' headers: api-supported-versions: - - 2020-07-01-Preview + - 2020-07-01-Preview, 2021-05-01-preview cache-control: - no-cache content-length: @@ -249,7 +349,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Mon, 08 Mar 2021 23:14:16 GMT + - Tue, 22 Jun 2021 23:19:19 GMT expires: - '-1' pragma: diff --git a/src/k8s-extension/azext_k8s_extension/tests/latest/test_k8s_extension_scenario.py b/src/k8s-extension/azext_k8s_extension/tests/latest/test_k8s_extension_scenario.py index 010df2e3077..53db4ce2c2d 100644 --- a/src/k8s-extension/azext_k8s_extension/tests/latest/test_k8s_extension_scenario.py +++ b/src/k8s-extension/azext_k8s_extension/tests/latest/test_k8s_extension_scenario.py @@ -6,7 +6,7 @@ # pylint: disable=line-too-long import os -from azure.cli.testsdk import (ScenarioTest, ResourceGroupPreparer, record_only) +from azure.cli.testsdk import (ScenarioTest, record_only) TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..')) @@ -14,17 +14,16 @@ class K8sExtensionScenarioTest(ScenarioTest): @record_only() - @ResourceGroupPreparer(name_prefix='cli_test_k8s_extension') def test_k8s_extension(self): resource_type = 'microsoft.openservicemesh' self.kwargs.update({ - 'name': 'openservice-mesh', + 'name': 'openservicemesh', 'rg': 'nanthirg0923', 'cluster_name': 'nanthicluster0923', 'cluster_type': 'connectedClusters', 'extension_type': resource_type, - 'release_train': 'staging', - 'version': '0.1.0' + 'release_train': 'pilot', + 'version': '0.8.3' }) self.cmd('k8s-extension create -g {rg} -n {name} -c {cluster_name} --cluster-type {cluster_type} ' diff --git a/src/k8s-extension/azext_k8s_extension/tests/latest/test_open_service_mesh.py b/src/k8s-extension/azext_k8s_extension/tests/latest/test_open_service_mesh.py index d3b322ef799..72e94a06831 100644 --- a/src/k8s-extension/azext_k8s_extension/tests/latest/test_open_service_mesh.py +++ b/src/k8s-extension/azext_k8s_extension/tests/latest/test_open_service_mesh.py @@ -8,8 +8,8 @@ import os import unittest -from azext_k8s_extension.partner_extensions.OpenServiceMesh import _get_tested_distros from azure.cli.core.azclierror import InvalidArgumentValueError +from azext_k8s_extension.partner_extensions.OpenServiceMesh import _get_tested_distros TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..'))