Repository navigation
Conversation
|
This issue is currently awaiting triage. If SIG Autoscaling contributors determines this is a relevant issue, they will accept it by applying the The DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
b46bc5f to
2f04326
Compare
2f04326 to
cbcd6ed
Compare
b811056 to
6051e39
Compare
norbertcyran
left a comment
There was a problem hiding this comment.
Hashing itself sounds fine to me, but I have some concerns about some other behavior changes introduced by this PR, esp. by breaking self-healing in case of removal of owner reference from the buffer.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: niewysoki The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
6051e39 to
5003b2d
Compare
Deriving managed PodTemplate names from buffer.Name truncates names over 225 characters and can collide with pre-existing user PodTemplates, other long-named CapacityBuffers, or recreated buffers of the same name. Adds common.ManagedPodTemplateName to name managed PodTemplates capacitybuffer-<buffer.UID>-managed-pod-template, removes name truncation in the translators, and validates the controller ownerRef UID and expected UID name in EnsurePodTemplate.
A CapacityBuffer referencing a managed PodTemplate name in spec.podTemplateRef can create self-referential or cross-buffer coupling, and during --cascade=orphan deletion garbage collection clears ownerReferences before the buffer informer observes DeletionTimestamp, allowing the controller to re-adopt an orphaned PodTemplate. Adds common.HasManagedPodTemplateName to reject reserved capacitybuffer-*-managed-pod-template references before dry-run, skips terminating CapacityBuffers in both translators, and verifies the live CapacityBuffer is still active before adopting an unowned managed PodTemplate in EnsurePodTemplate.
5003b2d to
5c7ce2b
Compare
Without admission enforcement, users and other controllers can pre-create colliding capacitybuffer-*-managed-pod-template PodTemplates or directly edit and delete active managed PodTemplates in KWOK E2E clusters. Adds a ValidatingAdmissionPolicy and binding to the KWOK Helm chart to deny non-controller creation, updates, and active deletion while leaving orphaned PodTemplates deletable once ownerReferences are cleared. Adds envtest admission coverage and updates the KWOK E2E reconciliation test to assert non-admin updates fail with Forbidden before testing drift recovery via system:masters.
5c7ce2b to
ec69d6a
Compare
What type of PR is this?
/kind bug
What this PR does / why we need it:
Previously, managed
PodTemplatenames were derived frombuffer.Name(capacitybuffer-<name>-pod-template) and truncated at 225 characters. That allowed collisions across long-namedCapacityBuffers, pre-existing userPodTemplates, and same-name delete-and-recreate cycles.This PR names managed
PodTemplatescapacitybuffer-<buffer.UID>-managed-pod-template:ownerReferencesself-healing (Index CapacityBuffer status.podTemplateRef for immediate reconciliation #262), since<buffer.UID>uniquely identifies the owningCapacityBufferinstance.CapacityBuffersand verifies the owning buffer is still active before adopting an unowned UID-namedPodTemplate, sokubectl delete capacitybuffer --cascade=orphannever re-attaches ownership.spec.podTemplateRefvalues matching the reservedcapacitybuffer-*-managed-pod-templatepattern before dry-run.ValidatingAdmissionPolicyto the KWOK E2E chart blocking non-controller creation, updates, and active deletion of managedPodTemplates.Which issue(s) this PR fixes:
N/A
Special notes for your reviewer:
CapacityBufferscreate a newcapacitybuffer-<buffer.UID>-managed-pod-templateon upgrade. Previously createdcapacitybuffer-<name>-pod-templateobjects keep theirownerReferencesto the buffer and are garbage-collected when the buffer is deleted.Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: