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

✨ Add support to scaffold controllers for External Types #4171

Conversation

camilamacedo86
Copy link
Member

@camilamacedo86 camilamacedo86 commented Sep 15, 2024

Introduces the option to allow users scaffold controllers for external types by running:

Example

kubebuilder create api --group certmanager --version v1 --kind Certificate --controller=true --resource=false --make=false --external-api-path=github.com/cert-manager/cert-manager/pkg/apis/certmanager/v1 --external-api-domain=cert-manager.io

Partial Close: #1999
We need to either add the support for Core and External types for webhooks which is blocked by: #4150

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Sep 15, 2024
camilamacedo86

This comment was marked as outdated.

@camilamacedo86 camilamacedo86 changed the title 🐛 fix scaffold of controllers for Core Types 🐛 (go/v4): fix scaffold of controllers for Core Types Sep 15, 2024
@camilamacedo86 camilamacedo86 added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 15, 2024
@camilamacedo86 camilamacedo86 changed the title 🐛 (go/v4): fix scaffold of controllers for Core Types 🐛 (go/v4): fix suite test scaffold of controllers for Core Types by adding missing import Sep 15, 2024
@camilamacedo86 camilamacedo86 removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 15, 2024
@camilamacedo86 camilamacedo86 changed the title 🐛 (go/v4): fix suite test scaffold of controllers for Core Types by adding missing import WIP: 🐛 (go/v4): fix suite test scaffold of controllers for Core Types by adding missing import Sep 15, 2024
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 15, 2024
@camilamacedo86 camilamacedo86 changed the title WIP: 🐛 (go/v4): fix suite test scaffold of controllers for Core Types by adding missing import WIP Sep 16, 2024
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 16, 2024
@camilamacedo86 camilamacedo86 force-pushed the fix-scaffold-controller-core-types branch from a6977f9 to 389c644 Compare September 16, 2024 10:42
@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Sep 16, 2024
@camilamacedo86 camilamacedo86 changed the title WIP ✨ Add support to scaffold controllers for External Types Sep 16, 2024
@camilamacedo86 camilamacedo86 changed the title ✨ Add support to scaffold controllers for External Types WIP: ✨ Add support to scaffold controllers for External Types Sep 16, 2024
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 16, 2024
@camilamacedo86 camilamacedo86 force-pushed the fix-scaffold-controller-core-types branch 3 times, most recently from 7ea823d to 040ae31 Compare September 21, 2024 09:29
@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Sep 21, 2024
@camilamacedo86 camilamacedo86 force-pushed the fix-scaffold-controller-core-types branch from 040ae31 to 965e005 Compare September 21, 2024 09:34
@camilamacedo86 camilamacedo86 changed the title ✨ Add support to scaffold controllers for External Types WIP: ✨ Add support to scaffold controllers for External Types Sep 23, 2024
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 23, 2024
@camilamacedo86 camilamacedo86 force-pushed the fix-scaffold-controller-core-types branch 4 times, most recently from 62bbaa6 to 68c9bf7 Compare September 23, 2024 04:49
@camilamacedo86 camilamacedo86 changed the title WIP: ✨ Add support to scaffold controllers for External Types ✨ Add support to scaffold controllers for External Types Sep 23, 2024
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 23, 2024
@camilamacedo86
Copy link
Member Author

Hi @fischor,

See that we have a flag for the domain now and the new makers to scaffold the checks we can add/discuss in a follow so that we can shape those better and make easier the review. (We can describe the behaviour without to demo why that is required/recommended and etc)

Thank you for your time on reviews.
Fell free to check it now.

Copy link

@fischor fischor left a comment

Choose a reason for hiding this comment

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

LGTM. Just some minors left in the docs.

pkg/plugins/golang/v4/api.go Outdated Show resolved Hide resolved
docs/book/src/reference/using_an_external_resource.md Outdated Show resolved Hide resolved
docs/book/src/reference/using_an_external_resource.md Outdated Show resolved Hide resolved
pkg/plugins/golang/v4/api.go Outdated Show resolved Hide resolved
docs/book/src/reference/using_an_external_resource.md Outdated Show resolved Hide resolved
Introduces the option to allow users scaffold controllers for external types by running:

kubebuilder create api --group certmanager --version v1 --kind Certificate --controller=true --resource=false --make=false --external-api-path=github.com/cert-manager/cert-manager/pkg/apis/certmanager/v1 --external-api-domain=certmanager.io
@camilamacedo86 camilamacedo86 force-pushed the fix-scaffold-controller-core-types branch from a1dbe01 to f070751 Compare September 23, 2024 16:10
@camilamacedo86
Copy link
Member Author

Hi @fischor

Thank you a lot for your time and help with the review. 🥇
The latest NITs are not either addressed !

@camilamacedo86
Copy link
Member Author

c/c @lingdie

@camilamacedo86
Copy link
Member Author

I think you all have been looking for that:
@hardikdr, @kopiczko, @janik-io, @oliviermichaelis, @ctrought, @armsnyder, @samuelvl, @allenhaozi, @wangjiusi

Copy link
Member

@varshaprasad96 varshaprasad96 left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

/hold - in case anyone else would like to review. @camilamacedo86 please feel free to remove the hold when you see fit for merge.

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 29, 2024
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 29, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: camilamacedo86, fischor, varshaprasad96

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:
  • OWNERS [camilamacedo86,varshaprasad96]

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

@camilamacedo86
Copy link
Member Author

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 1, 2024
@k8s-ci-robot k8s-ci-robot merged commit f2a3897 into kubernetes-sigs:master Oct 1, 2024
21 checks passed
@camilamacedo86 camilamacedo86 deleted the fix-scaffold-controller-core-types branch October 14, 2024 14:00
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. 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.

Handle external API types explicitly in create api
4 participants