diff --git a/src/k8s-extension/HISTORY.rst b/src/k8s-extension/HISTORY.rst index 50684dd4731..5e4d977b057 100644 --- a/src/k8s-extension/HISTORY.rst +++ b/src/k8s-extension/HISTORY.rst @@ -3,6 +3,10 @@ Release History =============== +1.3.3 +++++++++++++++++++ +* microsoft.azuremonitor.containers: add condition to use different api version for provisioned clusters + 1.3.2 ++++++++++++++++++ * Create identity for Appliances clusters 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 d2e5ba2491c..8f1271b2593 100644 --- a/src/k8s-extension/azext_k8s_extension/partner_extensions/ContainerInsights.py +++ b/src/k8s-extension/azext_k8s_extension/partner_extensions/ContainerInsights.py @@ -9,6 +9,7 @@ import json from ..utils import get_cluster_rp_api_version +from .. import consts from knack.log import get_logger @@ -244,7 +245,10 @@ def _ensure_default_log_analytics_workspace_for_monitoring(cmd, subscription_id, cluster_resource_id = '/subscriptions/{0}/resourceGroups/{1}/providers/{2}/{3}/{4}'.format( subscription_id, cluster_resource_group_name, cluster_rp, cluster_type, cluster_name) try: - resource = resources.get_by_id(cluster_resource_id, '2022-05-01-preview') + if cluster_rp.lower() == consts.HYBRIDCONTAINERSERVICE_RP: + resource = resources.get_by_id(cluster_resource_id, consts.HYBRIDCONTAINERSERVICE_API_VERSION) + else: + resource = resources.get_by_id(cluster_resource_id, '2020-01-01-preview') cluster_location = resource.location.lower() except HttpResponseError as ex: raise ex @@ -574,7 +578,10 @@ def _ensure_container_insights_dcr_for_monitoring(cmd, subscription_id, cluster_ cluster_resource_id = '/subscriptions/{0}/resourceGroups/{1}/providers/{2}/{3}/{4}'.format( subscription_id, cluster_resource_group_name, cluster_rp, cluster_type, cluster_name) try: - resource = resources.get_by_id(cluster_resource_id, '2022-05-01-preview') + if cluster_rp.lower() == consts.HYBRIDCONTAINERSERVICE_RP: + resource = resources.get_by_id(cluster_resource_id, consts.HYBRIDCONTAINERSERVICE_API_VERSION) + else: + resource = resources.get_by_id(cluster_resource_id, '2020-01-01-preview') cluster_region = resource.location.lower() except HttpResponseError as ex: raise ex diff --git a/src/k8s-extension/setup.py b/src/k8s-extension/setup.py index 968417737e4..295ea4718f9 100644 --- a/src/k8s-extension/setup.py +++ b/src/k8s-extension/setup.py @@ -33,7 +33,7 @@ # TODO: Add any additional SDK dependencies here DEPENDENCIES = [] -VERSION = "1.3.2" +VERSION = "1.3.3" with open("README.rst", "r", encoding="utf-8") as f: README = f.read()