Skip to content

Commit 5ab2faf

Browse files
committed
CreateAutoScaleVmGroup.vue: fix same issue as DeployVM.vue (7758)
1 parent 030024f commit 5ab2faf

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

ui/src/views/compute/CreateAutoScaleVmGroup.vue

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2629,10 +2629,13 @@ export default {
26292629
// advanced settings
26302630
createVmGroupData.keypairs = this.sshKeyPairs.join(',')
26312631
createVmGroupData.affinitygroupids = (values.affinitygroupids || []).join(',')
2632-
if (values.userdata && values.userdata.length > 0) {
2632+
const isUserdataAllowed = !this.userdataDefaultOverridePolicy || (this.userdataDefaultOverridePolicy === 'ALLOWOVERRIDE' && this.doUserdataOverride) || (this.userdataDefaultOverridePolicy === 'APPEND' && this.doUserdataAppend)
2633+
if (isUserdataAllowed && values.userdata && values.userdata.length > 0) {
26332634
createVmGroupData.userdata = this.$toBase64AndURIEncoded(values.userdata)
26342635
}
2635-
createVmGroupData.userdataid = values.userdataid
2636+
if (isUserdataAllowed) {
2637+
createVmGroupData.userdataid = values.userdataid
2638+
}
26362639
26372640
// vm profile details
26382641
createVmGroupData.autoscaleuserid = values.autoscaleuserid
@@ -2648,7 +2651,7 @@ export default {
26482651
idx++
26492652
}
26502653
}
2651-
if (this.userDataValues) {
2654+
if (isUserdataAllowed && this.userDataValues) {
26522655
for (const [key, value] of Object.entries(this.userDataValues)) {
26532656
createVmGroupData['userdatadetails[' + idx + '].' + `${key}`] = value
26542657
idx++

0 commit comments

Comments
 (0)