Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix VPA code generation #6834

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Conversation

voelzmo
Copy link
Contributor

@voelzmo voelzmo commented May 15, 2024

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

Seems like code generation wasn't working for a while, as the dependency for hack/update-codegen.sh wasn't vendored. This script wasn't executed in a while, although there were changes in the API recently. This commit does a few things, separated into individual commits:

  • introduce a new file hack/tools.go to pull in k8s.io/code-generator and have it correctly versioned in go.mod
  • changing the commandline for generate-groups.sh from all to client,deepcopy,informer,lister. This excludes applyconfiguration, which we currently don't generate, but would be included in all
  • actually run hack/update-codegen.sh to generate the deepcopy files and client-related files with the most recent API changes
  • switch to kube-codegen.sh, as generate-groups.sh was showing a deprecation warning
  • run hack/update-codegen.sh again, to see that there are no notable diffs after switching the generation script – the only changes seem to be concerned with the order of certain functions/variables

Special notes for your reviewer:

  • should we consider dropping versions other than v1, especially v1alpha1 and v1beta1, maybe even v1beta2? All those versions don't work with the newer k8s releases and the recent VPA releases don't work with older k8s releases.
  • should we consider generating applyconfigurations, as discussed in Make enum fields on the VPA API not pointers #5503?
  • Considering we already released 1.1 without re-generating these code parts
    • how problematic is this? Do we need to cherry-pick this into 1.1 and cut a new release?
    • should we consider making hack/verify-codegen.sh a presubmit check?

Does this PR introduce a user-facing change?

Re-generated deepcopy and client files to include the recent API changes.

@k8s-ci-robot k8s-ci-robot added the kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. label May 15, 2024
@k8s-ci-robot k8s-ci-robot added area/vertical-pod-autoscaler cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels May 15, 2024
Copy link
Contributor

@nikimanoledaki nikimanoledaki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! Left a couple comments 👍

vertical-pod-autoscaler/go.mod Outdated Show resolved Hide resolved
vertical-pod-autoscaler/hack/tools.go Outdated Show resolved Hide resolved
@voelzmo voelzmo force-pushed the fix/vpa-codegen branch 2 times, most recently from 1fa1df9 to c3470b5 Compare May 17, 2024 08:12
Copy link
Contributor

@nikimanoledaki nikimanoledaki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: nikimanoledaki, voelzmo
Once this PR has been reviewed and has the lgtm label, please assign kwiesmueller for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@voelzmo
Copy link
Contributor Author

voelzmo commented May 27, 2024

rebased on recent master to re-trigger github action tests – somehow they were red although I didn't change anything related to the test?

@voelzmo
Copy link
Contributor Author

voelzmo commented May 27, 2024

rebased on recent master to re-trigger github action tests – somehow they were red although I didn't change anything related to the test?

Turned out I was wrong: the boilerplate was missing for tools.go. There were just so many Error: lines in the test output that were unrelated to my change that I didn't see the very first line that actually was helpful 🙈

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/vertical-pod-autoscaler cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants