AUTOSCALE-644: Release chores 5.0 for Karpenter#18
Conversation
Adds a script which can be used during rebase chores to update go deps and vendor. It can also be used to update the to the latest karpenter fork go deps. This requires the karpenter/aws/azure forks to be updated before this repo. Signed-off-by: Max Cao <macao@redhat.com>
Signed-off-by: Max Cao <macao@redhat.com>
|
@maxcao13: This pull request references AUTOSCALE-644 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "5.0.0" version, but no target version was set. DetailsIn response to this:
Instructions 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 openshift-eng/jira-lifecycle-plugin repository. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: maxcao13 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
WalkthroughUpdated development tool pins and Go dependencies, refreshed Karpenter CRD schemas with new fields and Kubernetes typing metadata, and corrected two RBAC verb entries. ChangesKarpenter dependency and manifest refresh
Estimated code review effort: 3 (Moderate) | ~20 minutes Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 error)
✅ Passed checks (14 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 Checkov (3.3.8)go.modTraceback (most recent call last): install/00_autoscaling.openshift.io_karpenters.yamlTraceback (most recent call last): install/04_rbac.yamlTraceback (most recent call last):
🔧 golangci-lint (2.12.2)level=error msg="Running error: context loading failed: failed to load packages: failed to load packages: failed to load with go/packages: err: exit status 1: stderr: go: inconsistent vendoring in :\n\tgithub.com/aws/aws-sdk-go-v2/config@v1.32.31: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt\n\tgithub.com/aws/aws-sdk-go-v2/service/ec2@v1.317.0: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt\n\tgithub.com/aws/karpenter-provider-aws@v1.13.0: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt\n\tgithub.com/onsi/ginkgo/v2@v2.32.0: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt\n\tgithub.com/onsi/gomega@v1.42.1: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt\n\tgithub.com/openshift/api@v0.0.0-20260722154127-581cfdf71986: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt\n\tgithub.com ... [truncated 11641 characters] ... /karpenter@v1.13.0: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt\n\tsigs.k8s.io/randfill@v1.0.0: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt\n\tsigs.k8s.io/structured-merge-diff/v6@v6.4.2: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt\n\tsigs.k8s.io/yaml@v1.6.0: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt\n\tgithub.com/aws/karpenter-provider-aws: is replaced in go.mod, but not marked as replaced in vendor/modules.txt\n\tsigs.k8s.io/karpenter: is replaced in go.mod, but not marked as replaced in vendor/modules.txt\n\n\tTo ignore the vendor directory, use -mod=readonly or -mod=mod.\n\tTo sync the vendor directory, run:\n\t\tgo mod vendor\n" Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@hack/update-vendor.sh`:
- Around line 1-2: Add strict error handling immediately after the shebang in
update-vendor.sh, before any dependency or vendor mutations, so a failed go get
or other command terminates the script instead of continuing with stale
dependencies.
- Around line 8-10: Update the kube_release value in hack/update-vendor.sh to
match the v0.36.2 Kubernetes module versions pinned in go.mod, while leaving
kube_components unchanged.
- Around line 47-48: Update the Karpenter replacements in the go mod edit
command within update-vendor.sh to use immutable commit SHA revisions instead of
`@main` for both fork modules. Keep the existing OpenShift fork paths unchanged
and pin each replacement to its intended commit.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
| #!/bin/bash | ||
|
|
There was a problem hiding this comment.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
Fail fast when dependency updates fail.
Without set -e, a failed go get is followed by updated_mods[...] = 1, so the script can skip the failed module and still vendor stale dependencies. Add strict error handling before any mutating command.
Proposed fix
#!/bin/bash
+set -euo pipefail📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| #!/bin/bash | |
| #!/bin/bash | |
| set -euo pipefail | |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@hack/update-vendor.sh` around lines 1 - 2, Add strict error handling
immediately after the shebang in update-vendor.sh, before any dependency or
vendor mutations, so a failed go get or other command terminates the script
instead of continuing with stale dependencies.
| kube_release="v0.36.0" | ||
| # these components k8s.io/<item> are versioned for each k8s release | ||
| kube_components="api apimachinery client-go" |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf '--- hack/update-vendor.sh ---\n'
cat -n hack/update-vendor.sh | sed -n '1,220p'
printf '\n--- go.mod ---\n'
cat -n go.mod | sed -n '1,120p'Repository: openshift/karpenter-operator
Length of output: 257
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Inspect the exact references to kube_release and the k8s module versions.
rg -n 'kube_release|k8s.io/(api|apimachinery|client-go)|v0\.36\.[0-9]+' hack/update-vendor.sh go.modRepository: openshift/karpenter-operator
Length of output: 744
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo '=== hack/update-vendor.sh ==='
sed -n '1,220p' hack/update-vendor.sh | nl -ba
echo
echo '=== go.mod k8s module lines ==='
grep -nE 'k8s.io/(api|apimachinery|client-go)' go.modRepository: openshift/karpenter-operator
Length of output: 236
Keep kube_release in sync with go.mod. hack/update-vendor.sh hard-codes k8s.io/api, k8s.io/apimachinery, and k8s.io/client-go to v0.36.0, while go.mod already pins them at v0.36.2, so rerunning the script would downgrade those modules.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@hack/update-vendor.sh` around lines 8 - 10, Update the kube_release value in
hack/update-vendor.sh to match the v0.36.2 Kubernetes module versions pinned in
go.mod, while leaving kube_components unchanged.
|
/lgtm |
|
/test e2e-aws |
|
@maxcao13: all tests passed! Full PR test history. Your PR dashboard. 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. I understand the commands that are listed here. |
|
/verified by e2e tests |
|
@alaxkar: This PR has been marked as verified by DetailsIn response to this:
Instructions 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 openshift-eng/jira-lifecycle-plugin repository. |
First, had to create a new script
update-vendor.shsimilar to the other scripts that we maintain in our other autoscaling repos.Next:
Used these commands in this order (or some configuration of these commands). Note the steps here for the 5.1 rebase cycle.
Note that this requires our karpenter forks to finish their rebase cycle since we need to sync crds and rbac. And they are finished for 5.0 (thanks Ayush!)
Summary by CodeRabbit
New Features
Bug Fixes
Chores