@@ -565,23 +565,28 @@ func TestIsAzureCNINetworkmonitorAddon(t *testing.T) {
565565 properties := mockCS .Properties
566566 properties .OrchestratorProfile .OrchestratorType = "Kubernetes"
567567 properties .MasterProfile .Count = 1
568+ properties .OrchestratorProfile .KubernetesConfig .Addons = []api.KubernetesAddon {
569+ getMockAddon (AzureCNINetworkMonitoringAddonName ),
570+ }
568571 properties .OrchestratorProfile .KubernetesConfig .NetworkPlugin = "azure"
569572 setOrchestratorDefaults (& mockCS )
570573
571574 i := getAddonsIndexByName (properties .OrchestratorProfile .KubernetesConfig .Addons , AzureCNINetworkMonitoringAddonName )
572575 if ! helpers .IsTrueBoolPointer (properties .OrchestratorProfile .KubernetesConfig .Addons [i ].Enabled ) {
573- t .Fatalf ("Azure CNI network plugin configuration should add Azure CNI networkmonitor addon " )
576+ t .Fatalf ("Azure CNI networkmonitor addon should be present " )
574577 }
578+
575579 mockCS = getMockBaseContainerService ("1.10.3" )
576580 properties = mockCS .Properties
577581 properties .OrchestratorProfile .OrchestratorType = "Kubernetes"
578582 properties .MasterProfile .Count = 1
579- properties .OrchestratorProfile .KubernetesConfig .NetworkPlugin = "kubenet"
583+ properties .OrchestratorProfile .KubernetesConfig .NetworkPlugin = "azure"
584+ properties .OrchestratorProfile .KubernetesConfig .Addons = []api.KubernetesAddon {}
580585 setOrchestratorDefaults (& mockCS )
581586
582587 i = getAddonsIndexByName (properties .OrchestratorProfile .KubernetesConfig .Addons , AzureCNINetworkMonitoringAddonName )
583588 if helpers .IsTrueBoolPointer (properties .OrchestratorProfile .KubernetesConfig .Addons [i ].Enabled ) {
584- t .Fatalf ("Azure CNI networkmonitor addon should only be present in Azure CNI configurations " )
589+ t .Fatalf ("Azure CNI networkmonitor addon should only be present if explicitly configured " )
585590 }
586591}
587592
0 commit comments