feat: add kb scaffold utilities for plugins in internal/kubebuilder#3305
feat: add kb scaffold utilities for plugins in internal/kubebuilder#3305camilamacedo86 merged 3 commits intooperator-framework:masterfrom camilamacedo86:add-internal-kb
Conversation
|
I know we discussed this offline, but could you expand on the reasoning for this in the PR description for those that might wonder why we're duplicating KB code. |
|
@joelanford it is done. |
joelanford
left a comment
There was a problem hiding this comment.
All good except copy the files verbatim (no changes to the license headers)
|
| // This file's code was modified from "k8s.io/apimachinery/pkg/util/validation" | ||
| // to avoid package dependencies. In case of additional functionality from | ||
| // "k8s.io/apimachinery" is needed, re-consider whether to add the dependency. |
There was a problem hiding this comment.
Since operator-sdk already depends on k8s.io/apimachinery, can we remove this file?
It looks like regexError (used in internal/kubebuilder/validation/project.go) is now exported in k8s.io/apimachinery, so we could make that one tweak to that file.
There was a problem hiding this comment.
we can remove the full validation dir. Done. See that it is already removed from #3295
Description
Motivation
SDK is in a process to be integrated with KB which means that its project layouts will be aligned. More info : Integrating Kubebuilder and Operator SDK. As the first step, for we getting starting to working on in the Ansible/Helm plugins with the new layout we defined the strategy to just copy these helpers which will allow us to have the same features/utilities required to do the scaffolds.
Note that these utilities are not exported by kubebuilder, in this way, since Ansible/Helm will be also plugins that will do similar scaffolds and following a similar design they will be useful in the next steps. For a further understanding see the WIP: #329 and the doc Extensible CLI and Scaffolding Plugins.