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

Regenerating CRDs to make them compatible with newer kubernetes types. #4221

Merged

Conversation

paulfantom
Copy link
Member

@paulfantom paulfantom commented Aug 18, 2021

Description

Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request.
If it fixes a bug or resolves a feature request, be sure to link to that issue.

Some of the native kubernetes types used in prometheus-operator CRDs changed recently and have additional fields. This was not caught as we bumped neither controller-gen nor k8s.io/code-generator (both pinned in scripts/go.mod).

While fixing this I took a stab at simplifying process of generating CRDs. Instead of using our custom wrapper in form of generate-crd.go I switched to using controller-gen directly in Makefile.

Type of change

I also explicitly set preserveUnknownFields=false even though controller-gen defaults to that value when using CRD v1. This is explicitly fixing #4206

What type of changes does your code introduce to the Prometheus operator? Put an x in the box that apply.

  • CHANGE (fix or feature that would cause existing functionality to not work as expected)
  • FEATURE (non-breaking change which adds functionality)
  • BUGFIX (non-breaking change which fixes an issue)
  • ENHANCEMENT (non-breaking change which improves existing functionality)
  • NONE (if none of the other choices apply. Example, tooling, build system, CI, docs, etc.)

Changelog entry

Please put a one-line changelog entry below. This will be copied to the changelog file during the release process.

Update native kubernetes fields used in prometheus-operator CRDs

@simonpasquier
Copy link
Contributor

lgtm

@paulfantom
Copy link
Member Author

Seems I forgot about this PR in the first place and some of this made way into master with #4346. I updated this PR to include changes which were not included in #4346 but are still relevant to the PR description.

I additionally passed generated CRDs through jq to have human-readable JSON files with CRDs.

cc @simonpasquier @fpetkovski

@paulfantom paulfantom merged commit 1247c8a into prometheus-operator:master Nov 2, 2021
@paulfantom paulfantom deleted the simpler-crd-generation branch November 2, 2021 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants