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

Make generated CRDs directly available for testing and development #214

Merged
merged 1 commit into from
Dec 10, 2024

Conversation

erikgb
Copy link
Contributor

@erikgb erikgb commented Nov 26, 2024

This is a new attempt at what was started in #209, but accidentally got merged before being fully reviewed (and then reverted in #213).

I think the CRDs generated by controller-gen should be available in our projects, not just temporary files used as input to Helm CRD templates. While this will semi-duplicate the CRDs in project repositories, I think it has a lot of benefits (not limited to):

I have suggested the default kubebuilder path for CRD manifests, even if we don't use/require kubebuilder in our projects. Open for other suggestions, but I think the term "bases" is important - as I think we can use kustomize to transform CRD in other use cases. When deciding on the path, please keep in mind that:

  • We probably want to continue using the generated files as input to Helm chart templates.
  • Leave room for possibly generating more than just CRDs.

@cert-manager-prow cert-manager-prow bot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Nov 26, 2024
modules/helm/crds.mk Outdated Show resolved Hide resolved
modules/helm/crds.mk Outdated Show resolved Hide resolved
Copy link
Contributor

@ThatsMrTalbot ThatsMrTalbot left a comment

Choose a reason for hiding this comment

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

Can you update the path to something like deploy/crds as discussed in the earlier thread, I also think we should drop a README in that dir with something like:

cert-manager recommends the CRDs are deployed as part of the Helm chart, these CRDs exist for reference and development.

After this merges we can create an github issue to refactor it out the helm module.

@erikgb
Copy link
Contributor Author

erikgb commented Nov 29, 2024

Can you update the path to something like deploy/crds as discussed in the earlier thread, I also think we should drop a README in that dir with something like:

cert-manager recommends the CRDs are deployed as part of the Helm chart, these CRDs exist for reference and development.

After this merges we can create an github issue to refactor it out the helm module.

Will do! Thanks for reviewing @ThatsMrTalbot!

@erikgb
Copy link
Contributor Author

erikgb commented Nov 30, 2024

@ThatsMrTalbot, your initial review comments should be addressed now. I have also created a WIP PR to verify/test that this would actually work in our projects: cert-manager/trust-manager#493. Rhere are probably additional (minor) details that need to be adjusted. PTAL!

Copy link
Member

@SgtCoDFish SgtCoDFish left a comment

Choose a reason for hiding this comment

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

A couple of little makefile things - what do you think? I don't feel super strongly but I think these might be worth updating unless I'm missing something!

modules/helm/crds.mk Outdated Show resolved Hide resolved
modules/helm/crds.mk Outdated Show resolved Hide resolved
@erikgb erikgb force-pushed the new-gen-crds branch 2 times, most recently from 81bad3d to 6f67118 Compare December 8, 2024 20:25
@cert-manager-prow cert-manager-prow bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Dec 8, 2024
@erikgb erikgb requested a review from SgtCoDFish December 8, 2024 20:48
@erikgb
Copy link
Contributor Author

erikgb commented Dec 9, 2024

@ThatsMrTalbot @inteon Are you able to review this again? All remarks should be addressed now.

@cert-manager-prow cert-manager-prow bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 10, 2024
@ThatsMrTalbot
Copy link
Contributor

Thanks for making the changes!

This has been discussed extensively in the bi-weekly so I'm happy to lgtm and approve this and we can create a issue to tidy up the logic into a more appropriate module later as we agreed.

/lgtm
/approve

@cert-manager-prow cert-manager-prow bot added the lgtm Indicates that a PR is ready to be merged. label Dec 10, 2024
@cert-manager-prow
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ThatsMrTalbot

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

The pull request process is described 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

@SgtCoDFish
Copy link
Member

/unhold

I reckon this is good to go!

@cert-manager-prow cert-manager-prow bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 10, 2024
@cert-manager-prow cert-manager-prow bot merged commit 6357eb5 into cert-manager:main Dec 10, 2024
4 checks passed
@inteon
Copy link
Member

inteon commented Dec 10, 2024

@erikgb it looks like the README is not auto-generated currently: cert-manager/approver-policy#545

@erikgb
Copy link
Contributor Author

erikgb commented Dec 10, 2024

@erikgb it looks like the README is not auto-generated currently: cert-manager/approver-policy#545

Strange! I will take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants