Closed camilamacedo86 closed 2 years ago
Hi @Kavinjsir,
This one is to doc how to use the helper and options. You did some docs already, so you might want to look if we can improve the docs for we finish this one.
Hi @camilamacedo86 , the idea here looks good to me. Since you've already provided rich context above, it looks a great support for me to start. Before moving on, I have some questions:
deploy-image
is implemented?another option
as you mentioned, is that to instruct developers to create a bundle of plugins chains if necessary; that is to say: apply an integration work between kb plugins and the external one? /assign
HI @Kavinjsir,
My idea here would to be supplement the docs (I think create-your-own-plugin is a good place for that) to provide the info in the description. So that, we can help out those that are looking to build their own plugins.
See that it was required to help out in the discussion topic linked here.
What do you want to happen?
Would be nice if we could add to docs the following info to help those that are looking to build their own plugins:
If you are looking to create an external plugin that will add code on top of what is scaffold by default with the create API see that we do that in deploy-image here and you have many ways to achieve this goal:
a) You can overwrite the scaffold done with the go/v3 (for example) by using this option: https://github.com/kubernetes-sigs/kubebuilder/blob/df1ed6ccf19df40bd929157a91eaae6a9215bfc6/pkg/plugins/golang/deploy-image/v1alpha1/scaffolds/internal/templates/api/types.go#L58
b) You can use the plugin utils to inject and/or replace code, see: https://github.com/kubernetes-sigs/kubebuilder/blob/master/pkg/plugins/golang/deploy-image/v1alpha1/scaffolds/api.go#L170-L266
c) Note that you can call create api --plugins=go/v3,yourplugin/v1 and just ensure that the create api subcommand will overwrite or you can import the code as we decide to do in the deploy image to allow re-use it and make eaiser for users just call create api --plugins=deploy.image/v1alpha1, see: https://github.com/kubernetes-sigs/kubebuilder/blob/master/pkg/plugins/golang/deploy-image/v1alpha1/scaffolds/api.go#L77-L98
Another option also is to use the Bundle Plugin which will build a new plugin done by composition that does the call in chain as we can do by --plugins=a/v1,b/v2 and, see: https://book.kubebuilder.io/plugins/creating-plugins.html
Motivated by: https://github.com/kubernetes-sigs/kubebuilder/issues/2871
Extra Labels
/kind documentation