Skip to content

overcommit.inditex.dev/applied annotation reflects the webhook deployment name instead of the actually resolved OvercommitClass #47

@ismaelpuerto

Description

@ismaelpuerto

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

  1. Create two OvercommitClasses:

    • economy with isDefault: true, cpuOvercommit: 0.1, memoryOvercommit: 1
    • first with isDefault: false, cpuOvercommit: 1, memoryOvercommit: 1
  2. Label a namespace with the non-default class:

    metadata:
      labels:
        inditex.com/overcommit-class: first
  3. 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")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions