Skip to content

Commit

Permalink
Introduce additional bugfixes, bump CLI extension version (#7111)
Browse files Browse the repository at this point in the history
  • Loading branch information
sidiesen authored Dec 22, 2023
1 parent ed1a667 commit 0c373bc
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
4 changes: 4 additions & 0 deletions src/connectedk8s/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
Release History
===============

1.6.2
++++++
* Additional bugfixes.

1.6.1
++++++
* Added support for reading ARM metadata 2023-11-01.
Expand Down
12 changes: 6 additions & 6 deletions src/connectedk8s/azext_connectedk8s/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ def create_connectedk8s(cmd, client, resource_group_name, cluster_name, correlat
return put_cc_response

def validate_existing_provisioned_cluster_for_reput(cluster_resource, kubernetes_distro, kubernetes_infra, enable_private_link, private_link_scope_resource_id, distribution_version, azure_hybrid_benefit, location):
if (cluster_resource != None) and (cluster_resource.kind.lower() == consts.Provisioned_Cluster_Kind):
if (cluster_resource != None) and (cluster_resource.kind != None) and (cluster_resource.kind.lower() == consts.Provisioned_Cluster_Kind):
if azure_hybrid_benefit is not None:
raise InvalidArgumentValueError("Updating the 'azure hybrid benefit' property of a Provisioned Cluster is not supported from the Connected Cluster CLI. Please use the 'az aksarc update' CLI command.\nhttps://learn.microsoft.com/en-us/cli/azure/aksarc?view=azure-cli-latest#az-aksarc-update")

Expand Down Expand Up @@ -895,7 +895,7 @@ def delete_connectedk8s(cmd, client, resource_group_name, cluster_name,

# Check if the cluster is of supported type for deletion
preview_cluster_resource = get_connectedk8s_2023_11_01(cmd, resource_group_name, cluster_name)
if (preview_cluster_resource != None) and (preview_cluster_resource.kind.lower() == consts.Provisioned_Cluster_Kind):
if (preview_cluster_resource != None) and (preview_cluster_resource.kind != None) and (preview_cluster_resource.kind.lower() == consts.Provisioned_Cluster_Kind):
raise InvalidArgumentValueError("Deleting a Provisioned Cluster is not supported from the Connected Cluster CLI. Please use the 'az aksarc delete' CLI command.\nhttps://learn.microsoft.com/en-us/cli/azure/aksarc?view=azure-cli-latest#az-aksarc-delete")

# Send cloud information to telemetry
Expand Down Expand Up @@ -1048,7 +1048,7 @@ def update_connected_cluster(cmd, client, resource_group_name, cluster_name, htt
# Fetch Connected Cluster for agent version
connected_cluster = get_connectedk8s_2023_11_01(cmd, resource_group_name, cluster_name)

if (connected_cluster != None) and (connected_cluster.kind.lower() == consts.Provisioned_Cluster_Kind):
if (connected_cluster != None) and (connected_cluster.kind != None) and (connected_cluster.kind.lower() == consts.Provisioned_Cluster_Kind):
raise InvalidArgumentValueError("Updating a Provisioned Cluster is not supported from the Connected Cluster CLI. Please use the 'az aksarc update' CLI command. https://learn.microsoft.com/en-us/cli/azure/aksarc?view=azure-cli-latest#az-aksarc-update")

# Set preview client as most of the patchable fields are available in preview api-version
Expand Down Expand Up @@ -1197,7 +1197,7 @@ def upgrade_agents(cmd, client, resource_group_name, cluster_name, kube_config=N
# Check if cluster supports upgrading
connected_cluster = get_connectedk8s_2023_11_01(cmd, resource_group_name, cluster_name)

if (connected_cluster != None) and (connected_cluster.kind.lower() == consts.Provisioned_Cluster_Kind):
if (connected_cluster != None) and (connected_cluster.kind != None) and (connected_cluster.kind.lower() == consts.Provisioned_Cluster_Kind):
raise InvalidArgumentValueError("Upgrading a Provisioned Cluster is not supported from the Connected Cluster CLI. Please use the 'az aksarc upgrade' CLI command. https://learn.microsoft.com/en-us/cli/azure/aksarc?view=azure-cli-latest#az-aksarc-upgrade")

logger.warning("This operation might take a while...\n")
Expand Down Expand Up @@ -1448,7 +1448,7 @@ def enable_features(cmd, client, resource_group_name, cluster_name, features, ku
# Check if cluster is private link enabled
connected_cluster = get_connectedk8s_2023_11_01(cmd, resource_group_name, cluster_name)

if (connected_cluster != None) and (connected_cluster.kind.lower() == consts.Provisioned_Cluster_Kind):
if (connected_cluster != None) and (connected_cluster.kind != None) and (connected_cluster.kind.lower() == consts.Provisioned_Cluster_Kind):
raise InvalidArgumentValueError("Enable feature of a Provisioned Cluster is not supported from the Connected Cluster CLI. For information on how to enable a feature on a Provisioned Cluster using a cluster extension, please refer to: https://learn.microsoft.com/en-us/azure/aks/deploy-extensions-az-cli")

if connected_cluster.private_link_state.lower() == "enabled" and (enable_cluster_connect or enable_cl):
Expand Down Expand Up @@ -1578,7 +1578,7 @@ def disable_features(cmd, client, resource_group_name, cluster_name, features, k
# Fetch Connected Cluster for agent version
connected_cluster = get_connectedk8s_2023_11_01(cmd, resource_group_name, cluster_name)

if (connected_cluster != None) and (connected_cluster.kind.lower() == consts.Provisioned_Cluster_Kind):
if (connected_cluster != None) and (connected_cluster.kind != None) and (connected_cluster.kind.lower() == consts.Provisioned_Cluster_Kind):
raise InvalidArgumentValueError("Disable feature of a Provisioned Cluster is not supported from the Connected Cluster CLI. For information on how to disable a feature on a Provisioned Cluster using a cluster extension, please refer to: https://learn.microsoft.com/en-us/azure/aks/deploy-extensions-az-cli")

logger.warning("This operation might take a while...\n")
Expand Down
2 changes: 1 addition & 1 deletion src/connectedk8s/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# TODO: Confirm this is the right version number you want and it matches your
# HISTORY.rst entry.

VERSION = '1.6.1'
VERSION = '1.6.2'

# The full list of classifiers is available at
# https://pypi.python.org/pypi?%3Aaction=list_classifiers
Expand Down

0 comments on commit 0c373bc

Please sign in to comment.