removed datadisk to allow scale after upgrade (#3482)

This commit is contained in:
Shoshi 2018-07-24 12:40:53 -07:00 коммит произвёл Jack Francis
Родитель 7448f69fed
Коммит 271a58cd15
4 изменённых файлов: 14 добавлений и 25 удалений

Просмотреть файл

@ -299,7 +299,7 @@ func (t *Transformer) NormalizeMasterResourcesForScaling(logger *logrus.Entry, t
delete(hardwareProfile, vmSizeFieldName) delete(hardwareProfile, vmSizeFieldName)
} }
if !t.removeCustomData(logger, resourceProperties) || !t.removeImageReference(logger, resourceProperties) { if !t.removeCustomData(logger, resourceProperties) || !t.removeDataDisks(logger, resourceProperties) || !t.removeImageReference(logger, resourceProperties) {
continue continue
} }
} }
@ -321,6 +321,19 @@ func (t *Transformer) removeCustomData(logger *logrus.Entry, resourceProperties
return ok return ok
} }
func (t *Transformer) removeDataDisks(logger *logrus.Entry, resourceProperties map[string]interface{}) bool {
storageProfile, ok := resourceProperties[storageProfileFieldName].(map[string]interface{})
if !ok {
logger.Warnf("Template improperly formatted. Could not find: %s", storageProfileFieldName)
return ok
}
if storageProfile[dataDisksFieldName] != nil {
delete(storageProfile, dataDisksFieldName)
}
return ok
}
func (t *Transformer) removeImageReference(logger *logrus.Entry, resourceProperties map[string]interface{}) bool { func (t *Transformer) removeImageReference(logger *logrus.Entry, resourceProperties map[string]interface{}) bool {
storageProfile, ok := resourceProperties[storageProfileFieldName].(map[string]interface{}) storageProfile, ok := resourceProperties[storageProfileFieldName].(map[string]interface{})
if !ok { if !ok {

Просмотреть файл

@ -1991,14 +1991,6 @@
} }
}, },
"storageProfile": { "storageProfile": {
"dataDisks": [
{
"createOption": "attach",
"diskSizeGB": "128",
"lun": 0,
"name": "[concat(variables('masterVMNamePrefix'), copyIndex(variables('masterOffset')),'-etcddisk')]"
}
],
"osDisk": { "osDisk": {
"caching": "ReadWrite", "caching": "ReadWrite",
"createOption": "FromImage" "createOption": "FromImage"

Просмотреть файл

@ -2173,14 +2173,6 @@
} }
}, },
"storageProfile": { "storageProfile": {
"dataDisks": [
{
"createOption": "Empty",
"diskSizeGB": "128",
"lun": 0,
"name": "[concat(variables('masterVMNamePrefix'), copyIndex(variables('masterOffset')),'-etcddisk')]"
}
],
"osDisk": { "osDisk": {
"caching": "ReadWrite", "caching": "ReadWrite",
"createOption": "FromImage" "createOption": "FromImage"

Просмотреть файл

@ -2117,14 +2117,6 @@
} }
}, },
"storageProfile": { "storageProfile": {
"dataDisks": [
{
"createOption": "Empty",
"diskSizeGB": "128",
"lun": 0,
"name": "[concat(variables('masterVMNamePrefix'), copyIndex(variables('masterOffset')),'-etcddisk')]"
}
],
"osDisk": { "osDisk": {
"caching": "ReadWrite", "caching": "ReadWrite",
"createOption": "FromImage" "createOption": "FromImage"