internal/plugins/helm: add --project-name and use Config.ProjectName in scaffold#3438
Conversation
|
Relates to #3341 |
There was a problem hiding this comment.
Upstream kubebuilder just uses os.Getwd() for the project name in various places (e.g. scaffolds/templates/kustomize.go and scaffolds/templates/manager/config.go)
and doesn't make it configurable. Is there a strong use case for allowing users to choose something different than the directory name?
Even if there is, is this a difference we want to introduce between SDK and Kubebuilder?
EDIT: Just saw kubernetes-sigs/kubebuilder#1596
So Go projects use repo. Ansible and helm projects don't need repo, but can use projectName. Is it too late to make repo a config field for just the Go plugin?
|
just a few nits but I liked the idea 👍 |
|
Another thought just crossed my mind. The bundle and packagemanifest generators would probably want to use this to determine the project name, right? If so, does it make sense to put logic in those generators to handle specific plugin configurations? (e.g. it will check for Go + But what if another plugin has everything setup such that those generators would just work? Ideally we don't hardcode the set of supported plugins and prevent future plugins from working with OLM integration. |
|
/hold Until the discussion in kubernetes-sigs/kubebuilder#1596 is acted upon upstream. |
9a2c11d to
5f7c1b6
Compare
--project-name and use Config.ProjectName in scaffold
|
@camilamacedo86 @joelanford updated after kubernetes-sigs/kubebuilder#1603 was merged. /hold cancel |
5f7c1b6 to
483308d
Compare
There was a problem hiding this comment.
I am ok with move in this direction and just add TODO's to perform the refinements suggested by @joelanford in a follow up since they are more related to the design and not the functionality.
so, if we add the todo's it has my /lgtm when pass in the CI. PS requires a rebase.
d8d2185 to
a43cf79
Compare
| migration: | ||
| header: Add the `projectName` config key to your PROJECT file | ||
| body: > | ||
| Set the `projectName` key in your PROJECT file. If this key is not set, |
There was a problem hiding this comment.
👍 have the flag as suggested with projectName was blocker here that is solved now
| Image string | ||
|
|
||
| // OperatorName will be used to create the pods | ||
| OperatorName string |
20cfa4a to
5601742
Compare
Config.ProjectName is available, and adds `--project-name` to Go (indirectly) and Helm (directly) to set this field on `init`. go.sum,go.mod: bump kubebuilder dep internal/plugins/helm: add `--project-name` flag, and use Config.ProjectName in scaffolds
5601742 to
dbc6efb
Compare
Description of the change:
--project-nameflag, and useConfig.ProjectNamein scaffoldsMotivation for the change: This commit bumps sigs.k8s.io/kubebuilder to the latest commit so
Config.ProjectNameis available, and adds--project-nameto Go (indirectly) and Helm (directly) to set this field oninit. See kubernetes-sigs/kubebuilder#1603 and kubernetes-sigs/kubebuilder#1609 for details and changes to the Go plugin.@asmacdo @fabianvf this might also be nice to have in an Ansible plugin too.
/cc @camilamacedo86 @joelanford
Checklist
If the pull request includes user-facing changes, extra documentation is required:
changelog/fragments(seechangelog/fragments/00-template.yaml)website/content/en/docs