[CP 1681] [NO-JIRA] build: resolve kubectl version dynamically via stable.txt - #655
Merged
spraveenio merged 2 commits intoSep 23, 2026
Conversation
…#1681) Replace the hardcoded kubectl pin (v1.36.2) in Dockerfile.build with a dynamic lookup against https://dl.k8s.io/release/stable.txt, matching the pattern already used in Dockerfile and tests/k8s-e2e/Dockerfile.e2e. Plan: docs-internal/knowledge/plans/2026-09-22-bump-kubectl-oc-versions.md Co-authored-by: Claude <noreply@anthropic.com> (cherry picked from commit 8adebb8619c8c306e96bfe2052dd06002afd54a9)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
cp of pensando/gpu-operator#1681
Source PR Description (pensando/gpu-operator#1681):
Summary
Replace the hardcoded kubectl pin in `Dockerfile.build` with a dynamic lookup via `stable.txt`, matching the pattern already used in `Dockerfile` and `tests/k8s-e2e/Dockerfile.e2e`. No more manual bump PRs when a new kubectl stable is released.
Changes
Before:
```dockerfile
RUN curl -o /usr/local/bin/kubectl -LO 'https://dl.k8s.io/release/v1.36.2/bin/linux/amd64/kubectl' &&
chmod +x /usr/local/bin/kubectl
```
After:
```dockerfile
RUN KUBECTL_VERSION=$(curl -Ls https://dl.k8s.io/release/stable.txt) &&
curl -o /usr/local/bin/kubectl -LO "https://dl.k8s.io/release/\${KUBECTL_VERSION}/bin/linux/amd64/kubectl" &&
chmod +x /usr/local/bin/kubectl
```
Plan: docs-internal/knowledge/plans/2026-09-22-bump-kubectl-oc-versions.md
Test plan
Risks
Low — kubectl is backwards-compatible. Rollback: revert to a pinned version in `Dockerfile.build`.
🤖 Generated with Claude Code
Cherrypick triggered by: ACP-Automation