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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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
Copy link
Member Author

Hi @fischor, @sundaram2021,

See the changes here.

We need to add the support for controllers first, ensure the docs, change in the PROJECT config and re-scaffold helper first for then we be able to work on with those sample supports for webhooks in a follow up.

So, please feel free to help us in the review of this one for we are able to looking for in the next step.

@camilamacedo86
Copy link
Member Author

Hi

@hardikdr, @kopiczko, @janik-io, @oliviermichaelis, @ctrought, @armsnyder, @samuelvl, @allenhaozi, @wangjiusi

I know that you were looking for that.
The follow up here is add the same to the webhooks.
But we need to move forward step by step and we have another PR that blocks us to
do the changes in the webhooks at the moment.

So, if you be able to help us with reviews that will be great.

fischor

This comment was marked as duplicate.

@camilamacedo86

This comment was marked as duplicate.

@fischor

This comment was marked as duplicate.

@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
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

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

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

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

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. 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
3 participants