Skip to content

Commit 382d5ac

Browse files
committed
Add node-role.kubernetes.io support
Signed-off-by: Markus Blaschke <[email protected]>
1 parent 6e4bff6 commit 382d5ac

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

config/config.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,19 @@ func (p *PoolConfig) CreateJsonPatchSet() (patches []k8s.JsonPatch) {
108108
patches = []k8s.JsonPatch{}
109109

110110
if p.Node.Role != nil {
111-
name := "kubernetes.io/role"
111+
label := "kubernetes.io/role"
112112
patches = append(patches, k8s.JsonPatchString{
113113
Op: "replace",
114-
Path: fmt.Sprintf("/metadata/labels/%s", k8s.PatchPathEsacpe(name)),
114+
Path: fmt.Sprintf("/metadata/labels/%s", k8s.PatchPathEsacpe(label)),
115115
Value: *p.Node.Role,
116116
})
117+
118+
label = fmt.Sprintf("node-role.kubernetes.io/%s", *p.Node.Role)
119+
patches = append(patches, k8s.JsonPatchString{
120+
Op: "replace",
121+
Path: fmt.Sprintf("/metadata/labels/%s", k8s.PatchPathEsacpe(label)),
122+
Value: "",
123+
})
117124
}
118125

119126
if p.Node.ConfigSource != nil {

0 commit comments

Comments
 (0)