Skip to content

Commit

Permalink
need to parse VirtletCPUModel in annotation
Browse files Browse the repository at this point in the history
Signed-off-by: yanxuean <yan.xuean@zte.com.cn>
  • Loading branch information
yanxuean committed Jul 27, 2018
1 parent 728a61c commit 2ce743f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/metadata/types/annotations.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit 2ce743f

Please sign in to comment.