Skip to content

Conversation

@mikkeloscar
Copy link
Member

@mikkeloscar mikkeloscar commented Dec 1, 2025

This "modernizes" code generation setup to make it simpler to run and have less implicit dependencies. It does so in the following way:

  • Use Go 1.24 tool feature to manage Go tool dependencies (no longer need for tools.go hack)
    • Drop the make tools directive as it will be implicitly working just when running go.
  • Update hack/update-codegen.sh to not depend on a bash-script from the code-gen toolchain, instead run with the pure go implementing such that the tooling can be fully managed in go.mod
  • Update k8s.io/code-generator from v0.25.9 to v0.32.9 (This is the same version used for other k8s libraries, and required for the modernization to work).
  • Regenerate k8s client code, this has a bunch of changes because of the k8s.io/code-generator version update.
    • Add return in error cases when updating status in cluster.go and sync.go. This is needed because the newer version of the generated code doesn't return nil for the object on error, so if pgUpdatedStatus != nil checks are no longer valid to detect if it was not set. The right thing is to do this check as part of the error checking which is done by returning there.
  • Drop use of go mod vendor which is not needed with the use of go tool.
  • Drop make deps target as it's not needed to be explicitly called.

@mikkeloscar mikkeloscar marked this pull request as draft December 1, 2025 20:51
@mikkeloscar mikkeloscar changed the title Modernize code generation [WIP] Modernize code generation Dec 1, 2025
@mikkeloscar mikkeloscar changed the title [WIP] Modernize code generation Modernize code generation Dec 2, 2025
@mikkeloscar mikkeloscar marked this pull request as ready for review December 2, 2025 08:23
@mikkeloscar mikkeloscar marked this pull request as draft December 2, 2025 08:50
@mikkeloscar mikkeloscar force-pushed the modern-go-tools branch 2 times, most recently from 04da3b7 to ce348d3 Compare December 2, 2025 10:55
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
@FxKu FxKu added the major Major feature changes or updates, e.g. feature rollout to a new country, new API calls. label Dec 3, 2025
@FxKu FxKu added this to the 1.16.0 milestone Dec 3, 2025
@mikkeloscar
Copy link
Member Author

Closing in favor of #3003 (from local branch)

@mikkeloscar mikkeloscar closed this Dec 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

major Major feature changes or updates, e.g. feature rollout to a new country, new API calls.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants