1
0
mirror of https://github.com/rancher/types.git synced 2025-06-27 14:06:49 +00:00

Add taints field into rke node config

This commit is contained in:
orangedeng 2019-06-21 15:44:20 +08:00 committed by Alena Prokharchyk
parent b9d6b98174
commit 197b45db42
2 changed files with 16 additions and 1 deletions

View File

@ -2,6 +2,7 @@ package v3
import (
"github.com/rancher/norman/types"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
@ -172,6 +173,8 @@ type RKEConfigNode struct {
SSHCertPath string `yaml:"ssh_cert_path" json:"sshCertPath,omitempty"`
// Node Labels
Labels map[string]string `yaml:"labels" json:"labels,omitempty"`
// Node Taints
Taints []v1.Taint `yaml:"taints" json:"taints,omitempty"`
}
type RKEK8sSystemImage struct {

View File

@ -52,7 +52,19 @@ var (
)
func rkeTypes(schemas *types.Schemas) *types.Schemas {
return schemas.AddMapperForType(&Version, v3.BaseService{}, m.Drop{Field: "image"})
return schemas.AddMapperForType(&Version, v3.BaseService{}, m.Drop{Field: "image"}).
AddMapperForType(&Version, v1.Taint{},
m.Enum{Field: "effect", Options: []string{
string(v1.TaintEffectNoSchedule),
string(v1.TaintEffectPreferNoSchedule),
string(v1.TaintEffectNoExecute),
}},
m.Required{Fields: []string{
"effect",
"key",
}},
m.ReadOnly{Field: "timeAdded"},
)
}
func schemaTypes(schemas *types.Schemas) *types.Schemas {