Skip to content

Commit

Permalink
log debug if 'arcConfigEndpoint' doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
TheOnlyWei committed Nov 6, 2023
1 parent 9a11956 commit 2d0c363
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 20 deletions.
5 changes: 5 additions & 0 deletions src/connectedk8s/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
Release History
===============

1.5.4
++++++
* Log debug if 'arcConfigEndpoint' doesn't exist in 'dataplaneEndpoints' ARM metadata.

1.5.3
++++++
* Add support to get AKS-EE kubernetes distro
Expand Down
39 changes: 21 additions & 18 deletions src/connectedk8s/azext_connectedk8s/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -591,24 +591,27 @@ def helm_install_release(resource_manager, chart_path, subscription_id, kubernet

# Special configurations from 2022-09-01 ARM metadata.
if "dataplaneEndpoints" in arm_metadata:
notification_endpoint = arm_metadata["dataplaneEndpoints"]["arcGlobalNotificationServiceEndpoint"]
config_endpoint = arm_metadata["dataplaneEndpoints"]["arcConfigEndpoint"]
his_endpoint = arm_metadata["dataplaneEndpoints"]["arcHybridIdentityServiceEndpoint"]
if his_endpoint[-1] != "/":
his_endpoint = his_endpoint + "/"
his_endpoint = his_endpoint + f"discovery?location={location}&api-version=1.0-preview"
relay_endpoint = arm_metadata["suffixes"]["relayEndpointSuffix"]
active_directory = arm_metadata["authentication"]["loginEndpoint"]
cmd_helm_install.extend(
[
"--set", "systemDefaultValues.azureResourceManagerEndpoint={}".format(resource_manager),
"--set", "systemDefaultValues.azureArcAgents.config_dp_endpoint_override={}".format(config_endpoint),
"--set", "systemDefaultValues.clusterconnect-agent.notification_dp_endpoint_override={}".format(notification_endpoint),
"--set", "systemDefaultValues.clusterconnect-agent.relay_endpoint_suffix_override={}".format(relay_endpoint),
"--set", "systemDefaultValues.clusteridentityoperator.his_endpoint_override={}".format(his_endpoint),
"--set", "systemDefaultValues.activeDirectoryEndpoint={}".format(active_directory)
]
)
if "arcConfigEndpoint" in arm_metadata["dataplaneEndpoints"]:
notification_endpoint = arm_metadata["dataplaneEndpoints"]["arcGlobalNotificationServiceEndpoint"]
config_endpoint = arm_metadata["dataplaneEndpoints"]["arcConfigEndpoint"]
his_endpoint = arm_metadata["dataplaneEndpoints"]["arcHybridIdentityServiceEndpoint"]
if his_endpoint[-1] != "/":
his_endpoint = his_endpoint + "/"
his_endpoint = his_endpoint + f"discovery?location={location}&api-version=1.0-preview"
relay_endpoint = arm_metadata["suffixes"]["relayEndpointSuffix"]
active_directory = arm_metadata["authentication"]["loginEndpoint"]
cmd_helm_install.extend(
[
"--set", "systemDefaultValues.azureResourceManagerEndpoint={}".format(resource_manager),
"--set", "systemDefaultValues.azureArcAgents.config_dp_endpoint_override={}".format(config_endpoint),
"--set", "systemDefaultValues.clusterconnect-agent.notification_dp_endpoint_override={}".format(notification_endpoint),
"--set", "systemDefaultValues.clusterconnect-agent.relay_endpoint_suffix_override={}".format(relay_endpoint),
"--set", "systemDefaultValues.clusteridentityoperator.his_endpoint_override={}".format(his_endpoint),
"--set", "systemDefaultValues.activeDirectoryEndpoint={}".format(active_directory)
]
)
else:
logger.debug("'arcConfigEndpoint' doesn't exist under 'dataplaneEndpoints' in the ARM metadata.")

# Add custom-locations related params
if enable_custom_locations and not enable_private_link:
Expand Down
5 changes: 4 additions & 1 deletion src/connectedk8s/azext_connectedk8s/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,10 @@ def get_config_dp_endpoint(cmd, location, values_file, arm_metadata=None):
config_dp_endpoint, release_train = validate_env_file_dogfood(values_file)
# Get the values or endpoints required for retreiving the Helm registry URL.
if "dataplaneEndpoints" in arm_metadata:
config_dp_endpoint = arm_metadata["dataplaneEndpoints"]["arcConfigEndpoint"]
if "arcConfigEndpoint" in arm_metadata["dataplaneEndpoints"]:
config_dp_endpoint = arm_metadata["dataplaneEndpoints"]["arcConfigEndpoint"]
else:
logger.debug("'arcConfigEndpoint' doesn't exist under 'dataplaneEndpoints' in the ARM metadata.")
# Get the default config dataplane endpoint.
if config_dp_endpoint is None:
config_dp_endpoint = get_default_config_dp_endpoint(cmd, location)
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.5.3'
VERSION = '1.5.4'

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

0 comments on commit 2d0c363

Please sign in to comment.