fix(backend): Updates nodeSelector, and Affinity Paths in cache-server. Fixes #6623 (#6656)

nodeSelectors needs to start with /.
This commit is contained in:
boarder7395 2021-10-14 19:12:36 -04:00 committed by GitHub
parent 1e2af8379f
commit 773e9650a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -169,13 +169,13 @@ func MutatePodIfCached(req *v1beta1.AdmissionRequest, clientMgr ClientManagerInt
if pod.Spec.Affinity != nil {
patches = append(patches, patchOperation{
Op: OperationTypeRemove,
Path: "spec/affinity",
Path: "/spec/affinity",
})
}
if pod.Spec.NodeSelector != nil {
patches = append(patches, patchOperation{
Op: OperationTypeRemove,
Path: "spec/nodeSelector",
Path: "/spec/nodeSelector",
})
}
}