Skip to content

Commit

Permalink
sperate api version for connected and provisioned (AzureArcForKuberne…
Browse files Browse the repository at this point in the history
…tes#169)

* fix ci script

* sperate_api_version

* change_style

* use_const_for_provisioned_api

Co-authored-by: root <[email protected]>
Co-authored-by: Bavneet Singh <[email protected]>
  • Loading branch information
3 people authored Aug 18, 2022
1 parent 85a879d commit f519ff6
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import json

from ..utils import get_cluster_rp_api_version
from .. import consts

from knack.log import get_logger

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit f519ff6

Please sign in to comment.