Summary
When a pod is mutated via the default webhook (the one with objectSelector: DoesNotExist), but the overcommit class is resolved from the namespace label, the overcommit.inditex.dev/applied annotation incorrectly shows the name of the default OvercommitClass (the webhook that intercepted the pod) instead of the class that was actually used to compute the overcommit values.
Steps to Reproduce
-
Create two OvercommitClasses:
economy with isDefault: true, cpuOvercommit: 0.1, memoryOvercommit: 1
first with isDefault: false, cpuOvercommit: 1, memoryOvercommit: 1
-
Label a namespace with the non-default class:
metadata:
labels:
inditex.com/overcommit-class: first
-
Deploy a pod without the inditex.com/overcommit-class label in that namespace.
Expected Behavior
The pod annotation should reflect the class that was actually resolved and applied:
annotations:
overcommit.inditex.dev/applied: "first"
overcommit.inditex.dev/cpu: "1.0000"
overcommit.inditex.dev/memory: "1.0000"
Actual Behavior
The annotation shows the default class name (the webhook that processed the request), even though the values applied correspond to the class resolved from the namespace label:
annotations:
overcommit.inditex.dev/applied: "economy" # ← wrong, should be "first"
overcommit.inditex.dev/cpu: "1.0000" # ← correct (from "first")
overcommit.inditex.dev/memory: "1.0000" # ← correct (from "first")
Summary
When a pod is mutated via the default webhook (the one with
objectSelector: DoesNotExist), but the overcommit class is resolved from the namespace label, theovercommit.inditex.dev/appliedannotation incorrectly shows the name of the default OvercommitClass (the webhook that intercepted the pod) instead of the class that was actually used to compute the overcommit values.Steps to Reproduce
Create two OvercommitClasses:
economywithisDefault: true,cpuOvercommit: 0.1,memoryOvercommit: 1firstwithisDefault: false,cpuOvercommit: 1,memoryOvercommit: 1Label a namespace with the non-default class:
Deploy a pod without the
inditex.com/overcommit-classlabel in that namespace.Expected Behavior
The pod annotation should reflect the class that was actually resolved and applied:
Actual Behavior
The annotation shows the default class name (the webhook that processed the request), even though the values applied correspond to the class resolved from the namespace label: