mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-10 04:27:54 +00:00
Merge pull request #123128 from yue9944882/admission-runtime-class-empty-map-fix
Fail admission check upon nil/empty overhead map
This commit is contained in:
commit
8bd39b8eb1
@ -175,7 +175,7 @@ func setOverhead(a admission.Attributes, pod *api.Pod, runtimeClass *nodev1.Runt
|
||||
}
|
||||
|
||||
// reject pod if Overhead is already set that differs from what is defined in RuntimeClass
|
||||
if pod.Spec.Overhead != nil && !apiequality.Semantic.DeepEqual(nodeOverhead.PodFixed, pod.Spec.Overhead) {
|
||||
if len(pod.Spec.Overhead) > 0 && !apiequality.Semantic.DeepEqual(nodeOverhead.PodFixed, pod.Spec.Overhead) {
|
||||
return admission.NewForbidden(a, fmt.Errorf("pod rejected: Pod's Overhead doesn't match RuntimeClass's defined Overhead"))
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user