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 new plugin go-config-gen/v1 #2099

Closed

Conversation

estroz
Copy link
Contributor

@estroz estroz commented Mar 18, 2021

This PR adds the go-config-gen/v1 plugin, which uses the recently merged alpha config-gen to configure a project. All Go code is untouched, so perhaps this idea is a good candidate for a config-only plugin as suggested in #2015.

This plugin has two modes:

Use config-gen directly with kubebuilder alpha config-gen, which will write the configgen and componentconfig manifests to the top level.

kubebuilder init --plugins go-config-gen

Use through kustomize build --enable-alpha-plugins, which will write a configgen, componentconfig, and kustomization.yaml to ./config/configgen, and a kustomization.yaml to ./config/default that calls ../configgen

kubebuilder init --plugins go-config-gen --with-kustomize

The code in this PR is experimental and probably won't merge for awhile.

/kind feature

@k8s-ci-robot k8s-ci-robot added kind/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Mar 18, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: estroz

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

@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Mar 18, 2021
@estroz estroz marked this pull request as draft March 18, 2021 02:21
@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 Mar 18, 2021
@estroz
Copy link
Contributor Author

estroz commented Mar 18, 2021

/cc @pwittrock

@estroz estroz changed the title ✨ (experimental) add new plugin 'golang-config-gen/v1' ✨ (experimental) add new plugin go-config-gen/v1 Mar 18, 2021
@estroz
Copy link
Contributor Author

estroz commented Mar 18, 2021

I'm now on the fence about whether to scaffold kustomization.yaml's by default and provide --no-kustomize, or stick with --with-kustomize. I imagine most users will eventually migrate to using kustomize, and the base kustomize scaffold is quite simple right now.

cmd/main.go Outdated
@@ -22,6 +22,7 @@ import (
"sigs.k8s.io/kubebuilder/v3/pkg/cli"
cfgv2 "sigs.k8s.io/kubebuilder/v3/pkg/config/v2"
cfgv3 "sigs.k8s.io/kubebuilder/v3/pkg/config/v3"
goconfiggenv1 "sigs.k8s.io/kubebuilder/v3/pkg/plugins/golang-config-gen/v1"
Copy link
Member

Choose a reason for hiding this comment

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

Let's use alpha here as well go-config-gen/alphav1 until it gets mature enough to be v1.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The package name doesn't really matter IMO, since the plugin has a v1-alpha version.

Copy link
Member

Choose a reason for hiding this comment

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

I think that matter because:

  • make explicitly that is in alpha for maintainers and consumers
  • kb is also a lib/api and we need to make it clear that we can break everything that we wish with this one.

@pwittrock
Copy link
Contributor

For the non-config-gen specific scaffolding, is it possible to simply reference another package?

@estroz
Copy link
Contributor Author

estroz commented Mar 18, 2021

@pwittrock I should be able to move the plugin directory into a subdir of pkg/plugins/golang/v3 to access the internal directory containing scaffolds so I can re-use some of them. That should slim down the changes here significantly.

@camilamacedo86
Copy link
Member

camilamacedo86 commented Mar 18, 2021

..

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 19, 2021
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 14, 2021
@estroz estroz force-pushed the feature/config-gen-plugin branch 3 times, most recently from 93cec06 to d34043d Compare April 14, 2021 17:40

By("bootstrapping test environment")
testEnv = &envtest.Environment{
CRDDirectoryPaths: []string{filepath.Join("..", "config", "crd", "bases")},
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This still needs to be changed.

@estroz estroz changed the title ✨ (experimental) add new plugin go-config-gen/v1 ✨ add new plugin go-config-gen/v1 Apr 14, 2021
…-alpha

Signed-off-by: Eric Stroczynski <ericstroczynski@gmail.com>
@estroz estroz marked this pull request as ready for review April 14, 2021 19:49
@k8s-ci-robot k8s-ci-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. labels Apr 14, 2021
@k8s-ci-robot
Copy link
Contributor

@estroz: PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jul 17, 2021
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Aug 16, 2021
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue or PR with /reopen
  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close

@k8s-ci-robot
Copy link
Contributor

@k8s-triage-robot: Closed this PR.

In response to this:

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue or PR with /reopen
  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

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. kind/feature Categorizes issue or PR as related to a new feature. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. 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.

None yet

6 participants