From 2ce743f7960d0b20f3c13e808010cc0fe24c6af0 Mon Sep 17 00:00:00 2001 From: yanxuean Date: Fri, 27 Jul 2018 11:34:59 +0800 Subject: [PATCH] need to parse VirtletCPUModel in annotation Signed-off-by: yanxuean --- pkg/metadata/types/annotations.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 }