Apply same logic to other routes setting FirstConsecutiveStaticIP.
@@ -477,16 +477,25 @@ func setMasterNetworkDefaults(a *api.Properties, isUpgrade bool) {
}
} else {
a.MasterProfile.Subnet = DefaultKubernetesMasterSubnet
+ // FirstConsecutiveStaticIP is not reset if it is upgrade and some value already exists
+ if !isUpgrade || len(a.MasterProfile.FirstConsecutiveStaticIP) == 0 {
a.MasterProfile.FirstConsecutiveStaticIP = DefaultFirstConsecutiveKubernetesStaticIP
}
+ }
} else if a.HasWindows() {
a.MasterProfile.Subnet = DefaultSwarmWindowsMasterSubnet
+ // FirstConsecutiveStaticIP is not reset if it is upgrade and some value already exists
+ if !isUpgrade || len(a.MasterProfile.FirstConsecutiveStaticIP) == 0 {
a.MasterProfile.FirstConsecutiveStaticIP = DefaultSwarmWindowsFirstConsecutiveStaticIP
+ }
} else {
a.MasterProfile.Subnet = DefaultMasterSubnet
+ // FirstConsecutiveStaticIP is not reset if it is upgrade and some value already exists
+ if !isUpgrade || len(a.MasterProfile.FirstConsecutiveStaticIP) == 0 {
a.MasterProfile.FirstConsecutiveStaticIP = DefaultFirstConsecutiveStaticIP
}
}
+ }
// Set the default number of IP addresses allocated for masters.
if a.MasterProfile.IPAddressCount == 0 {
