From b71e6dc291166fcf87306ad12ee2ceb95dd47a91 Mon Sep 17 00:00:00 2001 From: Ilavelan Kanniappan Date: Mon, 4 May 2026 13:55:34 -0700 Subject: [PATCH 01/14] [az-cli][connectedk8s][MultiCloudConnector] Allow AgentNotInstalled to Agent conversion in connected clusters --- src/connectedk8s/azext_connectedk8s/custom.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/connectedk8s/azext_connectedk8s/custom.py b/src/connectedk8s/azext_connectedk8s/custom.py index d1dc4b2ac87..2bfed333ade 100644 --- a/src/connectedk8s/azext_connectedk8s/custom.py +++ b/src/connectedk8s/azext_connectedk8s/custom.py @@ -1513,7 +1513,18 @@ def connected_cluster_exists( client: ConnectedClusterOperations, resource_group_name: str, cluster_name: str ) -> bool: try: - client.get(resource_group_name, cluster_name) + connected_cluster = client.get(resource_group_name, cluster_name) + + # Allow AgentNotInstalled -> Agent conversion: + # treat an existing ARM resource in AgentNotInstalled state as non-existent for onboarding flows. + if getattr(connected_cluster, "connectivity_status", None) == "AgentNotInstalled": + logger.info( + "Arc enabling the %s in resource group %s with connectivity status %s", + cluster_name, + resource_group_name, + connected_cluster.connectivity_status, + ) + return False except Exception as e: # pylint: disable=broad-except utils.arm_exception_handler( e, From d1cfcc1e9428f401a10be2cc7d5f810197e0bb4f Mon Sep 17 00:00:00 2001 From: Ilavelan Kanniappan Date: Wed, 6 May 2026 07:17:32 -0700 Subject: [PATCH 02/14] completed ruff format check --- src/connectedk8s/azext_connectedk8s/custom.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/connectedk8s/azext_connectedk8s/custom.py b/src/connectedk8s/azext_connectedk8s/custom.py index 2bfed333ade..17eb5b4ec45 100644 --- a/src/connectedk8s/azext_connectedk8s/custom.py +++ b/src/connectedk8s/azext_connectedk8s/custom.py @@ -1517,7 +1517,10 @@ def connected_cluster_exists( # Allow AgentNotInstalled -> Agent conversion: # treat an existing ARM resource in AgentNotInstalled state as non-existent for onboarding flows. - if getattr(connected_cluster, "connectivity_status", None) == "AgentNotInstalled": + if ( + getattr(connected_cluster, "connectivity_status", None) + == "AgentNotInstalled" + ): logger.info( "Arc enabling the %s in resource group %s with connectivity status %s", cluster_name, From ce3ecba01c871940b4367787fce55b26a26d2984 Mon Sep 17 00:00:00 2001 From: Ilavelan Kanniappan Date: Fri, 8 May 2026 16:16:47 -0700 Subject: [PATCH 03/14] Handled AgentNotInstalled scenario --- src/connectedk8s/azext_connectedk8s/custom.py | 32 ++++++++++++++++--- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/src/connectedk8s/azext_connectedk8s/custom.py b/src/connectedk8s/azext_connectedk8s/custom.py index 17eb5b4ec45..025fc04bc6b 100644 --- a/src/connectedk8s/azext_connectedk8s/custom.py +++ b/src/connectedk8s/azext_connectedk8s/custom.py @@ -77,6 +77,7 @@ OidcIssuerProfile, SecurityProfile, SecurityProfileWorkloadIdentity, + ConnectivityStatus, ) if TYPE_CHECKING: @@ -133,6 +134,8 @@ def create_connectedk8s( gateway_resource_id: str = "", configuration_settings: dict[str, Any] | None = None, configuration_protected_settings: dict[str, Any] | None = None, + connectivity_status: str | None = None, + kind: str | None = None, ) -> ConnectedCluster: logger.warning("This operation might take a while...\n") # changing cli config to push telemetry in 1 hr interval @@ -865,6 +868,19 @@ def create_connectedk8s( ) oidc_profile = set_oidc_issuer_profile(enable_oidc_issuer, self_hosted_issuer) + # Getting the ConnectivityStatus and Kind to support AgentNotInstalled scenario + try: + connected_cluster = client.get(resource_group_name, cluster_name) + connectivity_status = getattr(connected_cluster, "connectivity_status", None) + kind = getattr(connected_cluster, "kind", None) + except Exception as e: # pylint: disable=broad-except + utils.arm_exception_handler( + e, + consts.Get_ConnectedCluster_Fault_Type, + "Failed to get connectivityStatus and kind if connected cluster resource already exists.", + return_if_not_found=True, + ) + print(f"Step: {utils.get_utctimestring()}: Generating ARM Request Payload") # Generate request payload cc = generate_request_payload( @@ -882,6 +898,8 @@ def create_connectedk8s( None, arc_agentry_configurations, arc_agent_profile, + connectivity_status, + kind, ) print(f"Step: {utils.get_utctimestring()}: Azure resource provisioning has begun.") @@ -1514,18 +1532,16 @@ def connected_cluster_exists( ) -> bool: try: connected_cluster = client.get(resource_group_name, cluster_name) + connectivity_status = getattr(connected_cluster, "connectivity_status", None) # Allow AgentNotInstalled -> Agent conversion: # treat an existing ARM resource in AgentNotInstalled state as non-existent for onboarding flows. - if ( - getattr(connected_cluster, "connectivity_status", None) - == "AgentNotInstalled" - ): + if connectivity_status == ConnectivityStatus.AGENT_NOT_INSTALLED: logger.info( "Arc enabling the %s in resource group %s with connectivity status %s", cluster_name, resource_group_name, - connected_cluster.connectivity_status, + connectivity_status, ) return False except Exception as e: # pylint: disable=broad-except @@ -1814,6 +1830,8 @@ def generate_request_payload( gateway: Gateway | None, arc_agentry_configurations: list[ArcAgentryConfigurations] | None, arc_agent_profile: ArcAgentProfile | None, + connectivity_status: str | None, + kind: str | None, ) -> ConnectedCluster: # Create connected cluster resource object identity = ConnectedClusterIdentity(type="SystemAssigned") @@ -1873,6 +1891,10 @@ def generate_request_payload( tags=tags, ) + if connectivity_status == ConnectivityStatus.AGENT_NOT_INSTALLED: + cc.properties.connectivity_status=connectivity_status + cc.kind=kind + return cc From 48d11ecfd24d470acea24672d6086a9ebb551aac Mon Sep 17 00:00:00 2001 From: Ilavelan Kanniappan Date: Fri, 8 May 2026 16:23:20 -0700 Subject: [PATCH 04/14] Handled AgentNotInstalled scenario --- src/connectedk8s/azext_connectedk8s/custom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/connectedk8s/azext_connectedk8s/custom.py b/src/connectedk8s/azext_connectedk8s/custom.py index 025fc04bc6b..cd4e2863610 100644 --- a/src/connectedk8s/azext_connectedk8s/custom.py +++ b/src/connectedk8s/azext_connectedk8s/custom.py @@ -73,11 +73,11 @@ ConnectedClusterPatch, ConnectedClusterPatchProperties, ConnectedClusterProperties, + ConnectivityStatus, Gateway, OidcIssuerProfile, SecurityProfile, SecurityProfileWorkloadIdentity, - ConnectivityStatus, ) if TYPE_CHECKING: From 7039c54838e779e2c7e405b31887a94223f94fee Mon Sep 17 00:00:00 2001 From: Ilavelan Kanniappan Date: Fri, 8 May 2026 17:29:18 -0700 Subject: [PATCH 05/14] Fixed the issues --- src/connectedk8s/azext_connectedk8s/custom.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/connectedk8s/azext_connectedk8s/custom.py b/src/connectedk8s/azext_connectedk8s/custom.py index cd4e2863610..7b257843ea0 100644 --- a/src/connectedk8s/azext_connectedk8s/custom.py +++ b/src/connectedk8s/azext_connectedk8s/custom.py @@ -134,8 +134,6 @@ def create_connectedk8s( gateway_resource_id: str = "", configuration_settings: dict[str, Any] | None = None, configuration_protected_settings: dict[str, Any] | None = None, - connectivity_status: str | None = None, - kind: str | None = None, ) -> ConnectedCluster: logger.warning("This operation might take a while...\n") # changing cli config to push telemetry in 1 hr interval @@ -657,6 +655,8 @@ def create_connectedk8s( gateway, arc_agentry_configurations, arc_agent_profile, + None, + None, ) cc_poller = create_cc_resource( client, resource_group_name, cluster_name, cc, no_wait @@ -868,7 +868,9 @@ def create_connectedk8s( ) oidc_profile = set_oidc_issuer_profile(enable_oidc_issuer, self_hosted_issuer) - # Getting the ConnectivityStatus and Kind to support AgentNotInstalled scenario + # Getting the ConnectivityStatus and Kind to support AgentNotInstalled scenario + connectivity_status = None + kind = None try: connected_cluster = client.get(resource_group_name, cluster_name) connectivity_status = getattr(connected_cluster, "connectivity_status", None) @@ -1892,8 +1894,8 @@ def generate_request_payload( ) if connectivity_status == ConnectivityStatus.AGENT_NOT_INSTALLED: - cc.properties.connectivity_status=connectivity_status - cc.kind=kind + cc.properties.connectivity_status = connectivity_status + cc.kind = kind return cc From cbfb82c494088208e644a8c39f631eef65973a92 Mon Sep 17 00:00:00 2001 From: Ilavelan Kanniappan Date: Fri, 8 May 2026 19:53:38 -0700 Subject: [PATCH 06/14] Updated connectivity status asignment --- src/connectedk8s/azext_connectedk8s/custom.py | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/src/connectedk8s/azext_connectedk8s/custom.py b/src/connectedk8s/azext_connectedk8s/custom.py index 7b257843ea0..69482abcc9f 100644 --- a/src/connectedk8s/azext_connectedk8s/custom.py +++ b/src/connectedk8s/azext_connectedk8s/custom.py @@ -1893,10 +1893,23 @@ def generate_request_payload( tags=tags, ) - if connectivity_status == ConnectivityStatus.AGENT_NOT_INSTALLED: - cc.properties.connectivity_status = connectivity_status - cc.kind = kind - + if connectivity_status is not None: + try: + status_enum = ConnectivityStatus(connectivity_status) + if status_enum == ConnectivityStatus.AGENT_NOT_INSTALLED: + logger.info( + "AgentNotInstalled logging connectivity status %s", + connectivity_status, + ) + cc.properties.connectivity_status = status_enum + cc.kind = kind + except ValueError: + logger.warning("Invalid connectivity_status: %s", connectivity_status) + + logger.info( + "AgentNotInstalled logging cc %s", + cc, + ) return cc From c5f4b31ffd27ca5d5393b028f551d04e2abcb70a Mon Sep 17 00:00:00 2001 From: Ilavelan Kanniappan Date: Sat, 9 May 2026 06:52:20 -0700 Subject: [PATCH 07/14] Updated models --- .../vendored_sdks/preview_2025_08_01/models/_models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/connectedk8s/azext_connectedk8s/vendored_sdks/preview_2025_08_01/models/_models.py b/src/connectedk8s/azext_connectedk8s/vendored_sdks/preview_2025_08_01/models/_models.py index 4fd2623c2de..9db843e1833 100644 --- a/src/connectedk8s/azext_connectedk8s/vendored_sdks/preview_2025_08_01/models/_models.py +++ b/src/connectedk8s/azext_connectedk8s/vendored_sdks/preview_2025_08_01/models/_models.py @@ -610,7 +610,7 @@ class ConnectedClusterProperties(_Model): ) """Time representing the last instance when heart beat was received from the cluster.""" connectivity_status: Optional[Union[str, "_models.ConnectivityStatus"]] = rest_field( - name="connectivityStatus", visibility=["read"] + name="connectivityStatus", visibility=["read", "create", "update", "delete", "query"] ) """Represents the connectivity status of the connected cluster. Known values are: \"Connecting\", \"Connected\", \"Offline\", \"Expired\", and \"AgentNotInstalled\".""" From c52930b28ce142b19b3970a180d942f737836a42 Mon Sep 17 00:00:00 2001 From: Ilavelan Kanniappan Date: Sat, 9 May 2026 08:10:17 -0700 Subject: [PATCH 08/14] Added more logging and removed models change --- src/connectedk8s/azext_connectedk8s/custom.py | 19 +++++++++++++++++++ .../preview_2025_08_01/models/_models.py | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/connectedk8s/azext_connectedk8s/custom.py b/src/connectedk8s/azext_connectedk8s/custom.py index 69482abcc9f..59e9bb9b134 100644 --- a/src/connectedk8s/azext_connectedk8s/custom.py +++ b/src/connectedk8s/azext_connectedk8s/custom.py @@ -875,6 +875,14 @@ def create_connectedk8s( connected_cluster = client.get(resource_group_name, cluster_name) connectivity_status = getattr(connected_cluster, "connectivity_status", None) kind = getattr(connected_cluster, "kind", None) + logger.info( + "Logging the debug details of Arc enabling the %s in resource group %s with connectivity status %s and kind %s", + cluster_name, + resource_group_name, + connectivity_status, + kind, + ) + except Exception as e: # pylint: disable=broad-except utils.arm_exception_handler( e, @@ -1903,6 +1911,17 @@ def generate_request_payload( ) cc.properties.connectivity_status = status_enum cc.kind = kind + else: + logger.warning( + "Connectivity status %s is not AgentNotInstalled, ignoring with kind %s", + connectivity_status, + kind, + ) + cc.properties.connectivity_status = ( + ConnectivityStatus.AGENT_NOT_INSTALLED + ) + cc.kind = "AWS" + except ValueError: logger.warning("Invalid connectivity_status: %s", connectivity_status) diff --git a/src/connectedk8s/azext_connectedk8s/vendored_sdks/preview_2025_08_01/models/_models.py b/src/connectedk8s/azext_connectedk8s/vendored_sdks/preview_2025_08_01/models/_models.py index 9db843e1833..83e2870aa91 100644 --- a/src/connectedk8s/azext_connectedk8s/vendored_sdks/preview_2025_08_01/models/_models.py +++ b/src/connectedk8s/azext_connectedk8s/vendored_sdks/preview_2025_08_01/models/_models.py @@ -615,7 +615,7 @@ class ConnectedClusterProperties(_Model): """Represents the connectivity status of the connected cluster. Known values are: \"Connecting\", \"Connected\", \"Offline\", \"Expired\", and \"AgentNotInstalled\".""" private_link_state: Optional[Union[str, "_models.PrivateLinkState"]] = rest_field( - name="privateLinkState", visibility=["read", "create", "update", "delete", "query"] + name="privateLinkState", visibility=["read"] ) """Property which describes the state of private link on a connected cluster resource. Known values are: \"Enabled\" and \"Disabled\".""" From 72094471d4715aaf8795dfac5c32e972b6297341 Mon Sep 17 00:00:00 2001 From: Ilavelan Kanniappan Date: Sat, 9 May 2026 08:11:59 -0700 Subject: [PATCH 09/14] removed models change --- .../vendored_sdks/preview_2025_08_01/models/_models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/connectedk8s/azext_connectedk8s/vendored_sdks/preview_2025_08_01/models/_models.py b/src/connectedk8s/azext_connectedk8s/vendored_sdks/preview_2025_08_01/models/_models.py index 83e2870aa91..4fd2623c2de 100644 --- a/src/connectedk8s/azext_connectedk8s/vendored_sdks/preview_2025_08_01/models/_models.py +++ b/src/connectedk8s/azext_connectedk8s/vendored_sdks/preview_2025_08_01/models/_models.py @@ -610,12 +610,12 @@ class ConnectedClusterProperties(_Model): ) """Time representing the last instance when heart beat was received from the cluster.""" connectivity_status: Optional[Union[str, "_models.ConnectivityStatus"]] = rest_field( - name="connectivityStatus", visibility=["read", "create", "update", "delete", "query"] + name="connectivityStatus", visibility=["read"] ) """Represents the connectivity status of the connected cluster. Known values are: \"Connecting\", \"Connected\", \"Offline\", \"Expired\", and \"AgentNotInstalled\".""" private_link_state: Optional[Union[str, "_models.PrivateLinkState"]] = rest_field( - name="privateLinkState", visibility=["read"] + name="privateLinkState", visibility=["read", "create", "update", "delete", "query"] ) """Property which describes the state of private link on a connected cluster resource. Known values are: \"Enabled\" and \"Disabled\".""" From e4f771ec109bb70c5b35ad42f52590f457186182 Mon Sep 17 00:00:00 2001 From: Ilavelan Kanniappan Date: Sat, 9 May 2026 18:03:48 -0700 Subject: [PATCH 10/14] Updated the custome.py --- src/connectedk8s/azext_connectedk8s/custom.py | 45 +++++++++---------- 1 file changed, 20 insertions(+), 25 deletions(-) diff --git a/src/connectedk8s/azext_connectedk8s/custom.py b/src/connectedk8s/azext_connectedk8s/custom.py index 59e9bb9b134..48e886e9cc8 100644 --- a/src/connectedk8s/azext_connectedk8s/custom.py +++ b/src/connectedk8s/azext_connectedk8s/custom.py @@ -70,6 +70,7 @@ ArcAgentryConfigurations, ConnectedCluster, ConnectedClusterIdentity, + ConnectedClusterKind, ConnectedClusterPatch, ConnectedClusterPatchProperties, ConnectedClusterProperties, @@ -1840,8 +1841,8 @@ def generate_request_payload( gateway: Gateway | None, arc_agentry_configurations: list[ArcAgentryConfigurations] | None, arc_agent_profile: ArcAgentProfile | None, - connectivity_status: str | None, - kind: str | None, + connectivity_status: ConnectivityStatus | None, + kind: ConnectedClusterKind | None, ) -> ConnectedCluster: # Create connected cluster resource object identity = ConnectedClusterIdentity(type="SystemAssigned") @@ -1901,29 +1902,23 @@ def generate_request_payload( tags=tags, ) - if connectivity_status is not None: - try: - status_enum = ConnectivityStatus(connectivity_status) - if status_enum == ConnectivityStatus.AGENT_NOT_INSTALLED: - logger.info( - "AgentNotInstalled logging connectivity status %s", - connectivity_status, - ) - cc.properties.connectivity_status = status_enum - cc.kind = kind - else: - logger.warning( - "Connectivity status %s is not AgentNotInstalled, ignoring with kind %s", - connectivity_status, - kind, - ) - cc.properties.connectivity_status = ( - ConnectivityStatus.AGENT_NOT_INSTALLED - ) - cc.kind = "AWS" - - except ValueError: - logger.warning("Invalid connectivity_status: %s", connectivity_status) + if connectivity_status == ConnectivityStatus.AGENT_NOT_INSTALLED: + status_enum = ConnectivityStatus(connectivity_status) + logger.info( + "AgentNotInstalled logging connectivity status %s with kind %s", + connectivity_status, + kind, + ) + cc.properties.connectivity_status = status_enum + cc.kind = kind + else: + logger.warning( + "Connectivity status %s is not AgentNotInstalled, ignoring with kind %s", + connectivity_status, + kind, + ) + cc.properties.connectivity_status = ConnectivityStatus.AGENT_NOT_INSTALLED + cc.kind = ConnectedClusterKind.AWS logger.info( "AgentNotInstalled logging cc %s", From f78b95d9050596d9a986e2fe131d1c7e0dd730c0 Mon Sep 17 00:00:00 2001 From: Ilavelan Kanniappan Date: Sun, 10 May 2026 00:07:58 -0700 Subject: [PATCH 11/14] Updated the custome.py - Fixed the datatype --- src/connectedk8s/azext_connectedk8s/custom.py | 24 +++++++++++++------ 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/src/connectedk8s/azext_connectedk8s/custom.py b/src/connectedk8s/azext_connectedk8s/custom.py index 48e886e9cc8..f5678cab0fb 100644 --- a/src/connectedk8s/azext_connectedk8s/custom.py +++ b/src/connectedk8s/azext_connectedk8s/custom.py @@ -874,8 +874,12 @@ def create_connectedk8s( kind = None try: connected_cluster = client.get(resource_group_name, cluster_name) - connectivity_status = getattr(connected_cluster, "connectivity_status", None) - kind = getattr(connected_cluster, "kind", None) + get_connectivity_status = getattr( + connected_cluster, "connectivity_status", None + ) + get_kind = getattr(connected_cluster, "kind", None) + connectivity_status = ConnectivityStatus(get_connectivity_status) + kind = ConnectedClusterKind(get_kind) logger.info( "Logging the debug details of Arc enabling the %s in resource group %s with connectivity status %s and kind %s", cluster_name, @@ -1902,17 +1906,23 @@ def generate_request_payload( tags=tags, ) + logger.info( + "Before: AgentNotInstalled logging connectivity status %s with kind %s", + connectivity_status, + kind, + ) + + cc.properties.connectivity_status = connectivity_status + cc.kind = kind + if connectivity_status == ConnectivityStatus.AGENT_NOT_INSTALLED: - status_enum = ConnectivityStatus(connectivity_status) logger.info( - "AgentNotInstalled logging connectivity status %s with kind %s", + "Inside: AgentNotInstalled logging connectivity status %s with kind %s", connectivity_status, kind, ) - cc.properties.connectivity_status = status_enum - cc.kind = kind else: - logger.warning( + logger.info( "Connectivity status %s is not AgentNotInstalled, ignoring with kind %s", connectivity_status, kind, From 6e6724844892f034bf51346940b7dfaf867c33ec Mon Sep 17 00:00:00 2001 From: Ilavelan Kanniappan Date: Sun, 10 May 2026 07:22:16 -0700 Subject: [PATCH 12/14] Updated the position of the code --- src/connectedk8s/azext_connectedk8s/custom.py | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/connectedk8s/azext_connectedk8s/custom.py b/src/connectedk8s/azext_connectedk8s/custom.py index f5678cab0fb..6a5abe0a8b1 100644 --- a/src/connectedk8s/azext_connectedk8s/custom.py +++ b/src/connectedk8s/azext_connectedk8s/custom.py @@ -1906,29 +1906,29 @@ def generate_request_payload( tags=tags, ) + logger.info( + "Before: AgentNotInstalled logging connectivity status %s with kind %s", + connectivity_status, + kind, + ) + + cc.properties.connectivity_status = connectivity_status + cc.kind = kind + + if connectivity_status == ConnectivityStatus.AGENT_NOT_INSTALLED: logger.info( - "Before: AgentNotInstalled logging connectivity status %s with kind %s", + "Inside: AgentNotInstalled logging connectivity status %s with kind %s", connectivity_status, kind, ) - - cc.properties.connectivity_status = connectivity_status - cc.kind = kind - - if connectivity_status == ConnectivityStatus.AGENT_NOT_INSTALLED: - logger.info( - "Inside: AgentNotInstalled logging connectivity status %s with kind %s", - connectivity_status, - kind, - ) - else: - logger.info( - "Connectivity status %s is not AgentNotInstalled, ignoring with kind %s", - connectivity_status, - kind, - ) - cc.properties.connectivity_status = ConnectivityStatus.AGENT_NOT_INSTALLED - cc.kind = ConnectedClusterKind.AWS + else: + logger.info( + "Connectivity status %s is not AgentNotInstalled, ignoring with kind %s", + connectivity_status, + kind, + ) + cc.properties.connectivity_status = ConnectivityStatus.AGENT_NOT_INSTALLED + cc.kind = ConnectedClusterKind.AWS logger.info( "AgentNotInstalled logging cc %s", From ae6ef011b785e7fceb196aa2d889955fa99aa2cf Mon Sep 17 00:00:00 2001 From: Ilavelan Kanniappan Date: Sun, 10 May 2026 09:46:48 -0700 Subject: [PATCH 13/14] Updated the models --- src/connectedk8s/azext_connectedk8s/custom.py | 19 ++----------------- .../preview_2025_08_01/models/_models.py | 2 +- 2 files changed, 3 insertions(+), 18 deletions(-) diff --git a/src/connectedk8s/azext_connectedk8s/custom.py b/src/connectedk8s/azext_connectedk8s/custom.py index 6a5abe0a8b1..e64dbd2d0e1 100644 --- a/src/connectedk8s/azext_connectedk8s/custom.py +++ b/src/connectedk8s/azext_connectedk8s/custom.py @@ -1906,29 +1906,14 @@ def generate_request_payload( tags=tags, ) - logger.info( - "Before: AgentNotInstalled logging connectivity status %s with kind %s", - connectivity_status, - kind, - ) - - cc.properties.connectivity_status = connectivity_status - cc.kind = kind - if connectivity_status == ConnectivityStatus.AGENT_NOT_INSTALLED: logger.info( "Inside: AgentNotInstalled logging connectivity status %s with kind %s", connectivity_status, kind, ) - else: - logger.info( - "Connectivity status %s is not AgentNotInstalled, ignoring with kind %s", - connectivity_status, - kind, - ) - cc.properties.connectivity_status = ConnectivityStatus.AGENT_NOT_INSTALLED - cc.kind = ConnectedClusterKind.AWS + cc.properties.connectivity_status = connectivity_status + cc.kind = kind logger.info( "AgentNotInstalled logging cc %s", diff --git a/src/connectedk8s/azext_connectedk8s/vendored_sdks/preview_2025_08_01/models/_models.py b/src/connectedk8s/azext_connectedk8s/vendored_sdks/preview_2025_08_01/models/_models.py index 4fd2623c2de..9db843e1833 100644 --- a/src/connectedk8s/azext_connectedk8s/vendored_sdks/preview_2025_08_01/models/_models.py +++ b/src/connectedk8s/azext_connectedk8s/vendored_sdks/preview_2025_08_01/models/_models.py @@ -610,7 +610,7 @@ class ConnectedClusterProperties(_Model): ) """Time representing the last instance when heart beat was received from the cluster.""" connectivity_status: Optional[Union[str, "_models.ConnectivityStatus"]] = rest_field( - name="connectivityStatus", visibility=["read"] + name="connectivityStatus", visibility=["read", "create", "update", "delete", "query"] ) """Represents the connectivity status of the connected cluster. Known values are: \"Connecting\", \"Connected\", \"Offline\", \"Expired\", and \"AgentNotInstalled\".""" From de6d035d65a46dbe1dfd56d76d460ec04495f3f4 Mon Sep 17 00:00:00 2001 From: Ilavelan Kanniappan Date: Sun, 10 May 2026 12:55:58 -0700 Subject: [PATCH 14/14] Finalversion --- src/connectedk8s/azext_connectedk8s/custom.py | 47 ------------------- .../preview_2025_08_01/models/_models.py | 2 +- 2 files changed, 1 insertion(+), 48 deletions(-) diff --git a/src/connectedk8s/azext_connectedk8s/custom.py b/src/connectedk8s/azext_connectedk8s/custom.py index e64dbd2d0e1..a93b666638f 100644 --- a/src/connectedk8s/azext_connectedk8s/custom.py +++ b/src/connectedk8s/azext_connectedk8s/custom.py @@ -70,7 +70,6 @@ ArcAgentryConfigurations, ConnectedCluster, ConnectedClusterIdentity, - ConnectedClusterKind, ConnectedClusterPatch, ConnectedClusterPatchProperties, ConnectedClusterProperties, @@ -656,8 +655,6 @@ def create_connectedk8s( gateway, arc_agentry_configurations, arc_agent_profile, - None, - None, ) cc_poller = create_cc_resource( client, resource_group_name, cluster_name, cc, no_wait @@ -869,33 +866,6 @@ def create_connectedk8s( ) oidc_profile = set_oidc_issuer_profile(enable_oidc_issuer, self_hosted_issuer) - # Getting the ConnectivityStatus and Kind to support AgentNotInstalled scenario - connectivity_status = None - kind = None - try: - connected_cluster = client.get(resource_group_name, cluster_name) - get_connectivity_status = getattr( - connected_cluster, "connectivity_status", None - ) - get_kind = getattr(connected_cluster, "kind", None) - connectivity_status = ConnectivityStatus(get_connectivity_status) - kind = ConnectedClusterKind(get_kind) - logger.info( - "Logging the debug details of Arc enabling the %s in resource group %s with connectivity status %s and kind %s", - cluster_name, - resource_group_name, - connectivity_status, - kind, - ) - - except Exception as e: # pylint: disable=broad-except - utils.arm_exception_handler( - e, - consts.Get_ConnectedCluster_Fault_Type, - "Failed to get connectivityStatus and kind if connected cluster resource already exists.", - return_if_not_found=True, - ) - print(f"Step: {utils.get_utctimestring()}: Generating ARM Request Payload") # Generate request payload cc = generate_request_payload( @@ -913,8 +883,6 @@ def create_connectedk8s( None, arc_agentry_configurations, arc_agent_profile, - connectivity_status, - kind, ) print(f"Step: {utils.get_utctimestring()}: Azure resource provisioning has begun.") @@ -1845,8 +1813,6 @@ def generate_request_payload( gateway: Gateway | None, arc_agentry_configurations: list[ArcAgentryConfigurations] | None, arc_agent_profile: ArcAgentProfile | None, - connectivity_status: ConnectivityStatus | None, - kind: ConnectedClusterKind | None, ) -> ConnectedCluster: # Create connected cluster resource object identity = ConnectedClusterIdentity(type="SystemAssigned") @@ -1906,19 +1872,6 @@ def generate_request_payload( tags=tags, ) - if connectivity_status == ConnectivityStatus.AGENT_NOT_INSTALLED: - logger.info( - "Inside: AgentNotInstalled logging connectivity status %s with kind %s", - connectivity_status, - kind, - ) - cc.properties.connectivity_status = connectivity_status - cc.kind = kind - - logger.info( - "AgentNotInstalled logging cc %s", - cc, - ) return cc diff --git a/src/connectedk8s/azext_connectedk8s/vendored_sdks/preview_2025_08_01/models/_models.py b/src/connectedk8s/azext_connectedk8s/vendored_sdks/preview_2025_08_01/models/_models.py index 9db843e1833..4fd2623c2de 100644 --- a/src/connectedk8s/azext_connectedk8s/vendored_sdks/preview_2025_08_01/models/_models.py +++ b/src/connectedk8s/azext_connectedk8s/vendored_sdks/preview_2025_08_01/models/_models.py @@ -610,7 +610,7 @@ class ConnectedClusterProperties(_Model): ) """Time representing the last instance when heart beat was received from the cluster.""" connectivity_status: Optional[Union[str, "_models.ConnectivityStatus"]] = rest_field( - name="connectivityStatus", visibility=["read", "create", "update", "delete", "query"] + name="connectivityStatus", visibility=["read"] ) """Represents the connectivity status of the connected cluster. Known values are: \"Connecting\", \"Connected\", \"Offline\", \"Expired\", and \"AgentNotInstalled\"."""