From 7125aed23b125620e4a6e8c2abb52aeed147aa71 Mon Sep 17 00:00:00 2001 From: Cecile Robert-Michon Date: Mon, 16 Jul 2018 21:48:49 -0700 Subject: [PATCH] Do not enable AcceleratedNetworkingEnabled by default on upgrade (#3483) --- pkg/acsengine/defaults.go | 6 +++--- pkg/acsengine/defaults_test.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/acsengine/defaults.go b/pkg/acsengine/defaults.go index 7bcca7e153..74aab21bc3 100644 --- a/pkg/acsengine/defaults.go +++ b/pkg/acsengine/defaults.go @@ -371,7 +371,7 @@ func setPropertiesDefaults(cs *api.ContainerService, isUpgrade bool) (bool, erro setHostedMasterNetworkDefaults(properties) - setAgentNetworkDefaults(properties) + setAgentNetworkDefaults(properties, isUpgrade) setStorageDefaults(properties) setExtensionDefaults(properties) @@ -792,7 +792,7 @@ func setMasterNetworkDefaults(a *api.Properties, isUpgrade bool) { } // SetAgentNetworkDefaults for agents -func setAgentNetworkDefaults(a *api.Properties) { +func setAgentNetworkDefaults(a *api.Properties, isUpgrade bool) { // configure the subnets if not in custom VNET if a.MasterProfile != nil && !a.MasterProfile.IsCustomVNET() { subnetCounter := 0 @@ -819,7 +819,7 @@ func setAgentNetworkDefaults(a *api.Properties) { // On instances that support hyperthreading, Accelerated Networking is supported on VM instances with 4 or more vCPUs. // Supported series are: D/DSv3, E/ESv3, Fsv2, and Ms/Mms. if profile.AcceleratedNetworkingEnabled == nil { - profile.AcceleratedNetworkingEnabled = helpers.PointerToBool(helpers.AcceleratedNetworkingSupported(profile.VMSize)) + profile.AcceleratedNetworkingEnabled = helpers.PointerToBool(!isUpgrade && helpers.AcceleratedNetworkingSupported(profile.VMSize)) } // don't default Distro for OpenShift diff --git a/pkg/acsengine/defaults_test.go b/pkg/acsengine/defaults_test.go index 250c042f0a..81e1f4536b 100644 --- a/pkg/acsengine/defaults_test.go +++ b/pkg/acsengine/defaults_test.go @@ -548,7 +548,7 @@ func TestSetComponentsNetworkDefaults(t *testing.T) { mockAPI := getMockAPIProperties("1.0.0") mockAPI.OrchestratorProfile = &test.orchestratorProfile setMasterNetworkDefaults(&mockAPI, false) - setAgentNetworkDefaults(&mockAPI) + setAgentNetworkDefaults(&mockAPI, false) if mockAPI.MasterProfile.Distro != test.expectedDistro { t.Fatalf("setMasterNetworkDefaults() test case %v did not return right Distro configurations %v != %v", test.name, mockAPI.MasterProfile.Distro, test.expectedDistro) }