diff --git a/pkg/metadata/types/annotations.go b/pkg/metadata/types/annotations.go index 5806defc7..c1638c1cc 100644 --- a/pkg/metadata/types/annotations.go +++ b/pkg/metadata/types/annotations.go @@ -37,12 +37,12 @@ const ( cloudInitUserDataScriptKeyName = "VirtletCloudInitUserDataScript" cloudInitImageType = "VirtletCloudInitImageType" cpuModel = "VirtletCPUModel" + libvirtCPUSetting = "VirtletLibvirtCPUSetting" sshKeysKeyName = "VirtletSSHKeys" // CloudInitUserDataSourceKeyName is the name of user data source key in the pod annotations. CloudInitUserDataSourceKeyName = "VirtletCloudInitUserDataSource" // SSHKeySourceKeyName is the name of ssh key source key in the pod annotations. SSHKeySourceKeyName = "VirtletSSHKeySource" - libvirtCPUSetting = "VirtletLibvirtCPUSettings" ) // CloudInitImageType specifies the image type used for cloud-init @@ -166,6 +166,11 @@ func (va *VirtletAnnotations) parsePodAnnotations(ns string, podAnnotations map[ } va.CPUSetting = &cpuSetting } + + if cpuModelStr, found := podAnnotations[cpuModel]; found { + va.CPUModel = CPUModelType(cpuModelStr) + } + if podAnnotations[cloudInitUserDataOverwriteKeyName] == "true" { va.UserDataOverwrite = true }