Skip to content

Commit

Permalink
Do not enable AcceleratedNetworkingEnabled by default on upgrade (Azu…
Browse files Browse the repository at this point in the history
  • Loading branch information
Cecile Robert-Michon authored and kkmsft committed Jul 20, 2018
1 parent b5af35a commit 7125aed
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions pkg/acsengine/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ func setPropertiesDefaults(cs *api.ContainerService, isUpgrade bool) (bool, erro

setHostedMasterNetworkDefaults(properties)

setAgentNetworkDefaults(properties)
setAgentNetworkDefaults(properties, isUpgrade)

setStorageDefaults(properties)
setExtensionDefaults(properties)
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pkg/acsengine/defaults_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 7125aed

Please sign in to comment.