refactor: update feature flag

Signed-off-by: Yi-Ya Chen <yiya.chen@suse.com>
(cherry picked from commit 1651e201e8)
This commit is contained in:
Yi-Ya Chen
2025-02-11 02:28:10 +00:00
committed by Mergify
parent 8c20ddb440
commit 6eb845b46b
8 changed files with 20 additions and 20 deletions
+1 -1
View File
@@ -140,7 +140,7 @@ export default {
return !!spec?.template?.spec?.domain?.devices?.tpm;
},
isPersistentStateEnabled(spec) {
isTPMPersistentStateEnabled(spec) {
return !!spec?.template?.spec?.domain?.devices?.tpm?.persistent;
},
+7 -7
View File
@@ -164,7 +164,7 @@ export default {
accessCredentials: [],
efiEnabled: false,
tpmEnabled: false,
persistentStateEnabled: false,
tpmPersistentStateEnabled: false,
secureBoot: false,
userDataTemplateId: '',
saveUserDataAsClearText: false,
@@ -368,7 +368,7 @@ export default {
const installAgent = this.hasInstallAgent(userData, osType, true);
const efiEnabled = this.isEfiEnabled(spec);
const tpmEnabled = this.isTpmEnabled(spec);
const persistentStateEnabled = this.isPersistentStateEnabled(spec);
const tpmPersistentStateEnabled = this.isTPMPersistentStateEnabled(spec);
const secureBoot = this.isSecureBoot(spec);
const cpuPinning = this.isCpuPinning(spec);
@@ -401,7 +401,7 @@ export default {
this['installUSBTablet'] = installUSBTablet;
this['efiEnabled'] = efiEnabled;
this['tpmEnabled'] = tpmEnabled;
this['persistentStateEnabled'] = persistentStateEnabled;
this['tpmPersistentStateEnabled'] = tpmPersistentStateEnabled;
this['secureBoot'] = secureBoot;
this['cpuPinning'] = cpuPinning;
@@ -1424,8 +1424,8 @@ export default {
}
},
setPersistentStateEnabled(persistentStateEnabled) {
if (persistentStateEnabled) {
setTPMPersistentStateEnabled(tpmPersistentStateEnabled) {
if (tpmPersistentStateEnabled) {
set(this.spec.template.spec.domain.devices, 'tpm', { persistent: true });
} else {
set(this.spec.template.spec.domain.devices, 'tpm', {});
@@ -1555,8 +1555,8 @@ export default {
this.setTPM(val);
},
persistentStateEnabled(val) {
this.setPersistentStateEnabled(val);
tpmPersistentStateEnabled(val) {
this.setTPMPersistentStateEnabled(val);
},
installAgent: {