mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2025-12-13 05:01:43 +00:00
fix: do not inherit template secret when creating new VM (#643)
Signed-off-by: Andy Lee <andy.lee@suse.com>
This commit is contained in:
parent
b03fffbc30
commit
6c27a46274
@ -96,7 +96,6 @@ export default {
|
|||||||
templateVersionId: '',
|
templateVersionId: '',
|
||||||
namePrefix: '',
|
namePrefix: '',
|
||||||
isSingle: true,
|
isSingle: true,
|
||||||
useTemplate: false,
|
|
||||||
isOpen: false,
|
isOpen: false,
|
||||||
hostname,
|
hostname,
|
||||||
isRestartImmediately,
|
isRestartImmediately,
|
||||||
|
|||||||
@ -142,6 +142,7 @@ export default {
|
|||||||
showYaml: false,
|
showYaml: false,
|
||||||
spec: null,
|
spec: null,
|
||||||
osType: 'linux',
|
osType: 'linux',
|
||||||
|
useTemplate: false,
|
||||||
sshKey: [],
|
sshKey: [],
|
||||||
maintenanceStrategies,
|
maintenanceStrategies,
|
||||||
maintenanceStrategy: 'Migrate',
|
maintenanceStrategy: 'Migrate',
|
||||||
@ -273,7 +274,7 @@ export default {
|
|||||||
|
|
||||||
needNewSecret() {
|
needNewSecret() {
|
||||||
// When creating a template it is always necessary to create a new secret.
|
// When creating a template it is always necessary to create a new secret.
|
||||||
return this.showYaml ? false : this.resourceType === HCI.VM_VERSION || this.isCreate;
|
return this.isCreate || this.showYaml ? false : this.resourceType === HCI.VM_VERSION;
|
||||||
},
|
},
|
||||||
|
|
||||||
defaultTerminationSetting() {
|
defaultTerminationSetting() {
|
||||||
@ -1647,7 +1648,8 @@ export default {
|
|||||||
|
|
||||||
secretRef: {
|
secretRef: {
|
||||||
handler(secret) {
|
handler(secret) {
|
||||||
if (secret && this.resourceType !== HCI.BACKUP && this.resourceType !== HCI.VM) {
|
// we should not inherit the secret if it's from VM template.
|
||||||
|
if (secret && this.resourceType !== HCI.BACKUP && !this.useTemplate) {
|
||||||
this.secretName = secret?.metadata.name;
|
this.secretName = secret?.metadata.name;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user