Skip to content

Commit afd9bbe

Browse files
committed
Fix update enable cnl hlsm
1 parent e511374 commit afd9bbe

3 files changed

Lines changed: 648 additions & 4 deletions

File tree

src/aks-preview/azext_aks_preview/managed_cluster_decorator.py

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5049,8 +5049,21 @@ def postprocessing_after_mc_created(self, cluster: ManagedCluster) -> None:
50495049
cluster, cluster_resource_id, self.cmd
50505050
)
50515051
elif (self.context.raw_param.get("enable_addons") is not None or
5052-
self.context.raw_param.get("enable-azure-monitor-logs") is not None):
5053-
# Create the DCR Association here
5052+
self.context.raw_param.get("enable-azure-monitor-logs") is not None or
5053+
self.context.raw_param.get("enable_container_network_logs") is not None or
5054+
self.context.raw_param.get("enable_retina_flow_logs") is not None or
5055+
self.context.raw_param.get("disable_container_network_logs") is not None or
5056+
self.context.raw_param.get("disable_retina_flow_logs") is not None or
5057+
self.context.raw_param.get("enable_high_log_scale_mode") is not None):
5058+
# Create/update the DCR when CNL or HLSM flags change so that the DCR streams
5059+
# (e.g. Microsoft-ContainerLogV2-HighScale) are kept in sync.
5060+
cnl_or_hlsm_changing = (
5061+
self.context.raw_param.get("enable_container_network_logs") is not None or
5062+
self.context.raw_param.get("enable_retina_flow_logs") is not None or
5063+
self.context.raw_param.get("disable_container_network_logs") is not None or
5064+
self.context.raw_param.get("disable_retina_flow_logs") is not None or
5065+
self.context.raw_param.get("enable_high_log_scale_mode") is not None
5066+
)
50545067
addon_consts = self.context.get_addon_consts()
50555068
CONST_MONITORING_ADDON_NAME = addon_consts.get("CONST_MONITORING_ADDON_NAME")
50565069
self.context.external_functions.ensure_container_insights_for_monitoring(
@@ -5062,7 +5075,7 @@ def postprocessing_after_mc_created(self, cluster: ManagedCluster) -> None:
50625075
self.context.get_location(),
50635076
remove_monitoring=False,
50645077
aad_route=self.context.get_enable_msi_auth_for_monitoring(),
5065-
create_dcr=False,
5078+
create_dcr=cnl_or_hlsm_changing,
50665079
create_dcra=True,
50675080
enable_syslog=self.context.get_enable_syslog(),
50685081
data_collection_settings=self.context.get_data_collection_settings(),

0 commit comments

Comments
 (0)