From 0ee5af827e6ac10b6a8c2ce942e19de53ba9e49c Mon Sep 17 00:00:00 2001 From: Nancy Butler <42977925+mantis-toboggan-md@users.noreply.github.com> Date: Tue, 21 May 2024 14:52:31 -0700 Subject: [PATCH] fix container monitoring checkbox and add unit tests --- pkg/aks/components/CruAks.vue | 16 ++++-- pkg/aks/components/__tests__/CruAks.test.ts | 57 ++++++++++++++++++++- 2 files changed, 67 insertions(+), 6 deletions(-) diff --git a/pkg/aks/components/CruAks.vue b/pkg/aks/components/CruAks.vue index d890a2c1ab7..45ca971d3a0 100644 --- a/pkg/aks/components/CruAks.vue +++ b/pkg/aks/components/CruAks.vue @@ -157,7 +157,6 @@ export default defineComponent({ } this.config = this.normanCluster.aksConfig; this.nodePools = this.normanCluster.aksConfig.nodePools; - this.containerMonitoring = !!(this.config.logAnalyticsWorkspaceGroup || this.config.logAnalyticsWorkspaceName); this.setAuthorizedIPRanges = !!(this.config?.authorizedIpRanges || []).length; this.nodePools.forEach((pool: AKSNodePool) => { this.$set(pool, '_id', randomStr()); @@ -201,7 +200,6 @@ export default defineComponent({ loadingVersions: false, loadingVmSizes: false, loadingVirtualNetworks: false, - containerMonitoring: false, setAuthorizedIPRanges: false, fvFormRuleSets: [{ path: 'name', @@ -793,6 +791,13 @@ export default defineComponent({ delete this.config.privateDnsZone; delete this.config.userAssignedIdentity; } + }, + + 'config.monitoring'(neu: boolean) { + if (!neu) { + this.$set(this.config, 'logAnalyticsWorkspaceGroup', null); + this.$set(this.config, 'logAnalyticsWorkspaceName', null); + } } }, @@ -1179,20 +1184,22 @@ export default defineComponent({
-