зеркало из https://github.com/Azure/acs-engine.git
removed datadisk to allow scale after upgrade (#3482)
This commit is contained in:
Родитель
7448f69fed
Коммит
271a58cd15
|
@ -299,7 +299,7 @@ func (t *Transformer) NormalizeMasterResourcesForScaling(logger *logrus.Entry, t
|
|||
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
|
||||
}
|
||||
}
|
||||
|
@ -321,6 +321,19 @@ func (t *Transformer) removeCustomData(logger *logrus.Entry, resourceProperties
|
|||
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 {
|
||||
storageProfile, ok := resourceProperties[storageProfileFieldName].(map[string]interface{})
|
||||
if !ok {
|
||||
|
|
|
@ -1991,14 +1991,6 @@
|
|||
}
|
||||
},
|
||||
"storageProfile": {
|
||||
"dataDisks": [
|
||||
{
|
||||
"createOption": "attach",
|
||||
"diskSizeGB": "128",
|
||||
"lun": 0,
|
||||
"name": "[concat(variables('masterVMNamePrefix'), copyIndex(variables('masterOffset')),'-etcddisk')]"
|
||||
}
|
||||
],
|
||||
"osDisk": {
|
||||
"caching": "ReadWrite",
|
||||
"createOption": "FromImage"
|
||||
|
|
|
@ -2173,14 +2173,6 @@
|
|||
}
|
||||
},
|
||||
"storageProfile": {
|
||||
"dataDisks": [
|
||||
{
|
||||
"createOption": "Empty",
|
||||
"diskSizeGB": "128",
|
||||
"lun": 0,
|
||||
"name": "[concat(variables('masterVMNamePrefix'), copyIndex(variables('masterOffset')),'-etcddisk')]"
|
||||
}
|
||||
],
|
||||
"osDisk": {
|
||||
"caching": "ReadWrite",
|
||||
"createOption": "FromImage"
|
||||
|
|
|
@ -2117,14 +2117,6 @@
|
|||
}
|
||||
},
|
||||
"storageProfile": {
|
||||
"dataDisks": [
|
||||
{
|
||||
"createOption": "Empty",
|
||||
"diskSizeGB": "128",
|
||||
"lun": 0,
|
||||
"name": "[concat(variables('masterVMNamePrefix'), copyIndex(variables('masterOffset')),'-etcddisk')]"
|
||||
}
|
||||
],
|
||||
"osDisk": {
|
||||
"caching": "ReadWrite",
|
||||
"createOption": "FromImage"
|
||||
|
|
Загрузка…
Ссылка в новой задаче