Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions ui/src/views/compute/DeployVM.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1970,7 +1970,8 @@ export default {
deployVmData.dynamicscalingenabled = values.dynamicscalingenabled
deployVmData.iothreadsenabled = values.iothreadsenabled
deployVmData.iodriverpolicy = values.iodriverpolicy
if (values.userdata && values.userdata.length > 0) {
const isUserdataAllowed = !this.userdataDefaultOverridePolicy || (this.userdataDefaultOverridePolicy === 'ALLOWOVERRIDE' && this.doUserdataOverride) || (this.userdataDefaultOverridePolicy === 'APPEND' && this.doUserdataAppend)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this could be a boolean method

if (isUserdataAllowed && values.userdata && values.userdata.length > 0) {
deployVmData.userdata = encodeURIComponent(btoa(sanitizeReverse(values.userdata)))
}
// step 2: select template/iso
Expand Down Expand Up @@ -2093,7 +2094,9 @@ export default {
}
// step 7: select ssh key pair
deployVmData.keypairs = this.sshKeyPairs.join(',')
deployVmData.userdataid = values.userdataid
if (isUserdataAllowed) {
deployVmData.userdataid = values.userdataid
}

if (values.name) {
deployVmData.name = values.name
Expand Down Expand Up @@ -2129,7 +2132,7 @@ export default {
idx++
}
}
if (this.userDataValues) {
if (isUserdataAllowed && this.userDataValues) {
for (const [key, value] of Object.entries(this.userDataValues)) {
deployVmData['userdatadetails[' + idx + '].' + `${key}`] = value
idx++
Expand Down