mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2026-10-04 21:26:08 +08:00
feat: Unattend.xml support for Windows (#954)
Documentation: https://kubevirt.io/user-guide/user_workloads/startup_scripts/#sysprep Related to: https://github.com/harvester/harvester/issues/1836 Signed-off-by: Volker Theile <vtheile@suse.com>
This commit is contained in:
@@ -255,6 +255,29 @@ export default {
|
||||
return this.convertToJson(userData)?.ssh_authorized_keys || [];
|
||||
},
|
||||
|
||||
getSysprepConfig(spec) {
|
||||
const sysprepVolume = spec?.template?.spec?.volumes?.find(
|
||||
(v) => v.name === 'sysprep' && v.sysprep?.secret
|
||||
);
|
||||
|
||||
if (!sysprepVolume) {
|
||||
return { secretName: '', xmlContent: '' };
|
||||
}
|
||||
|
||||
const inStore = this.$store.getters['currentProduct'].inStore;
|
||||
const namespace = this.value.metadata.namespace;
|
||||
const secretName = sysprepVolume.sysprep.secret.name;
|
||||
const secret = this.$store.getters[`${ inStore }/byId`](
|
||||
SECRET,
|
||||
`${ namespace }/${ secretName }`
|
||||
);
|
||||
|
||||
return {
|
||||
secretName: `${ namespace }/${ secretName }`,
|
||||
xmlContent: secret?.decodedData?.['autounattend.xml'] || ''
|
||||
};
|
||||
},
|
||||
|
||||
compareSSHValue(a = '', b = '') {
|
||||
const r = /(\r\n\t|\n|\r\t)|(\s*)/gm;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user