Export sandbox label constant (#216)#317
Export sandbox label constant (#216)#317abkaskari wants to merge 9 commits intokubernetes-sigs:mainfrom
Conversation
|
Hi @abkaskari. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
✅ Deploy Preview for agent-sandbox canceled.
|
|
Hello @abkaskari ! do you mind linking the correct issue in the description of the PR, thanks! Perhaps, #216 ? |
controllers/sandbox_controller.go
Outdated
|
|
||
| const ( | ||
| sandboxLabel = "agents.x-k8s.io/sandbox-name-hash" | ||
| //sandboxLabel = "agents.x-k8s.io/sandbox-name-hash" |
|
/ok-to-test |
|
| }, | ||
| } | ||
|
|
||
| for _, tc := range testCases { |
There was a problem hiding this comment.
There is a massive commented-out block of the old TestReconcilePod function. Please delete this entire commented block.
| } | ||
|
|
||
| // +kubebuilder:object:root=true | ||
|
|
| // VolumeClaimTemplates is a list of claims that the sandbox pod is allowed to reference. | ||
| // Every claim in this list must have at least one matching access mode with a provisioner volume. | ||
| // +optional | ||
| // +kubebuilder:validation:Optional |
There was a problem hiding this comment.
why is this removed ? i believe it should be kept, please revert this change.
|
|
||
| // SandboxSpec defines the desired state of Sandbox | ||
| type SandboxSpec struct { | ||
| // The following markers will use OpenAPI v3 schema to validate the value |
There was a problem hiding this comment.
revert this change please, it's not related to this PR.
vicentefb
left a comment
There was a problem hiding this comment.
The actual logic changes—moving the label into api/v1alpha1/sandbox_types.go and exporting it as SandboxNameHashLabel make sense and are exactly the DRY refactoring we needed to prevent contract drift between the controllers. I left some comments that need to be addressed.
I also noticed that the PR description seems to describe a completely different set of changes (e.g., "Ensure existing pods adopt labels", "Update annotations to reflect the latest PodTemplate values", etc.). Could you please update the PR description to accurately reflect the simple constant refactoring you actually did here as well as adding the issue number there ? In addition to this could you also update the PR title, to something Export sandbox label constant, we aren't fixing any pod label synchronization issues here.
Thanks!!
aditya-shantanu
left a comment
There was a problem hiding this comment.
Thanks for making this change.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: abkaskari, aditya-shantanu 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 |
|
/lgtm |
| metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
| ) | ||
|
|
||
| const SandboxNameHashLabel = "agents.x-k8s.io/sandbox-name-hash" |
There was a problem hiding this comment.
Please update extensions/controllers/sandboxclaim_controller.go to reuse this exported label as well
This PR exports the sandbox label constant to avoid duplication between
the API and controller packages.
Previously, the sandbox label key was defined inside the controller,
which created a risk of contract drift between the API and its consumers.
This change moves the label definition to api/v1alpha1 and exports it
as SandboxNameHashLabel so it can be reused consistently across the
codebase.
No functional behavior is changed. This is purely a refactoring to
improve maintainability and ensure a single source of truth for the
sandbox label key.
Related to #216.