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

Autodetect the k0s APIs to be built #4536

Merged
merged 5 commits into from
Jun 5, 2024

Conversation

twz123
Copy link
Member

@twz123 twz123 commented Jun 3, 2024

Description

This allows for adding new APIs and API versions without the need to touch the Makefile. Whenever a new pkg/apis/foo/version folder gets added, it will be built automatically.

This required code generation to behave the same for all API group versions. The special case of the k0s CRD output directory has been normalized from v1beta1 to k0s. To make this transparent to k0s users, the CRD bundle files written to disk retain the v1beta1 prefix.

See:

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

How Has This Been Tested?

  • Manual test
  • Auto test added

Checklist:

  • My code follows the style guidelines of this project
  • My commit messages are signed-off
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

@twz123 twz123 added the chore label Jun 3, 2024
@twz123 twz123 marked this pull request as ready for review June 3, 2024 17:46
@twz123 twz123 requested a review from a team as a code owner June 3, 2024 17:46
@twz123 twz123 requested review from kke and makhov June 3, 2024 17:46
@twz123 twz123 force-pushed the autodetect-api-group-versions branch 4 times, most recently from 191d66a to 1503628 Compare June 4, 2024 12:54
twz123 added 5 commits June 5, 2024 13:16
Tests and auto-generated files don't need to trigger rebuilds.

Signed-off-by: Tom Wieczorek <[email protected]>
The CRD component is always used with a single bundle directory, so
there's no need to support multiple bundle directories in the same
component via slices and loops. Call sites can also very well use the
CRD component itself multiple times if they need to handle multiple
bundles.

Signed-off-by: Tom Wieczorek <[email protected]>
So that the asset dir and the bundle name may be different.

Signed-off-by: Tom Wieczorek <[email protected]>
Makes the gen_output_dir variable superfluous.

Signed-off-by: Tom Wieczorek <[email protected]>
This allows for adding new APIs and API versions without the need to
touch the Makefile. Whenever a new `pkg/apis/foo/version` folder gets
added, it will be built automatically.

Signed-off-by: Tom Wieczorek <[email protected]>
@twz123 twz123 force-pushed the autodetect-api-group-versions branch from 1503628 to 31aadb7 Compare June 5, 2024 11:16
@twz123 twz123 merged commit 7bf5438 into k0sproject:main Jun 5, 2024
78 checks passed
@twz123 twz123 deleted the autodetect-api-group-versions branch June 5, 2024 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants