Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
9347eae
:book: suplememting info about release process
camilamacedo86 Feb 18, 2021
5cc7d55
Add tests to the DNS validation package
Adirio Feb 18, 2021
7a7a66f
Remove old TODOs that are no longer valid
Adirio Feb 22, 2021
615f8c2
Merge pull request #2033 from Adirio/cleanup-todos
k8s-ci-robot Feb 22, 2021
33036c5
Merge pull request #2034 from Adirio/tests/dns-validation
k8s-ci-robot Feb 22, 2021
c45c5da
fix unit tests to work with later versions of ginkgo/gomega
joelanford Feb 25, 2021
ed6539a
Merge pull request #2039 from joelanford/fix/test-unit
k8s-ci-robot Feb 25, 2021
d121077
:seedling: fix CI to use the correct g version
camilamacedo86 Feb 25, 2021
d07dfcc
Merge pull request #2040 from camilamacedo86/fix-ci-go-version
k8s-ci-robot Feb 25, 2021
4bf571c
Explicitly define WithCompletion as an Option
Adirio Feb 26, 2021
cfbf62d
Merge pull request #2045 from Adirio/completion-option
k8s-ci-robot Feb 26, 2021
1586c2d
Generalize CRD and webhook version related methods in Config
Adirio Feb 26, 2021
0610cc8
Merge pull request #2047 from Adirio/config-interface
k8s-ci-robot Feb 26, 2021
64ad95f
:seedling: Update golangci-lint to latest version
Feb 25, 2021
a90cbd5
Merge pull request #2041 from goutamtadi1/update-golangci-lint
k8s-ci-robot Feb 27, 2021
75ac496
Add https to the webpage
mkumatag Mar 1, 2021
80177d3
Merge pull request #2050 from mkumatag/fix_link
k8s-ci-robot Mar 1, 2021
2ef938f
Add go mod tidy to be executed after the scaffolding api
dastergon Feb 24, 2021
2b46403
Merge pull request #2037 from dastergon/fix-api-generation
k8s-ci-robot Mar 1, 2021
1a74c97
docs: update CRD path for multi-group api
ahalimx86 Mar 2, 2021
bc7ce7d
netlify.toml: update redirects for v3.0.0
estroz Mar 4, 2021
d905233
(go/v3) bump controller-runtime to v0.7.2
estroz Mar 5, 2021
f81fb0d
feat: improve service monitor configuration
johanneswuerbach Mar 5, 2021
bdfa597
Use client.New instead of manager client in tests
leovct Mar 6, 2021
984816b
Merge pull request #2062 from estroz/docs/update-redirects
k8s-ci-robot Mar 8, 2021
6de8014
Merge pull request #2054 from ahalim-intel/update_migrations
k8s-ci-robot Mar 8, 2021
2018a4f
Merge pull request #2064 from estroz/deps/bump-c-r-0.7.2
k8s-ci-robot Mar 8, 2021
01293b2
Fix the config registry public API
Adirio Mar 9, 2021
9a121a1
test/e2e: export KIND_CLUSTER so local tests get correct cluster name
estroz Mar 9, 2021
b6e2ead
Merge pull request #2071 from estroz/chore/correct-test-cluster-name
k8s-ci-robot Mar 9, 2021
c748ebd
This commit adds a ServiceAccount (config/rbac/service_account.yaml)
estroz Mar 8, 2021
dd3942c
Merge pull request #2070 from estroz/feature/service-account
k8s-ci-robot Mar 9, 2021
4e6c400
Remove CLI interface and expose cli instead
Adirio Mar 10, 2021
2687774
Move the internal machinery utils to appropiate exported packages
Adirio Mar 9, 2021
8e0f0ab
Merge pull request #2074 from Adirio/export-machinery-utils
k8s-ci-robot Mar 10, 2021
f0ab179
Merge pull request #2072 from Adirio/fix-config-registry-api
k8s-ci-robot Mar 10, 2021
de84b80
Merge pull request #2079 from Adirio/cli-external-api
k8s-ci-robot Mar 10, 2021
0675cd5
Merge pull request #2030 from camilamacedo86/imp-release-docs
k8s-ci-robot Mar 10, 2021
fe73ff7
Add `kubebuilder alpha config-gen` subcommand
pwittrock Mar 7, 2021
9742a11
Merge pull request #1831 from pwittrock/main
k8s-ci-robot Mar 13, 2021
a2cc78c
Inject filesystem from cli instead of creating several per command
Adirio Mar 12, 2021
73cda2b
Merge pull request #2080 from Adirio/inject-filesystem
k8s-ci-robot Mar 13, 2021
61dcae6
Export scaffolding machinery
Adirio Mar 14, 2021
f7ad796
Store abstraction for persisting Config
Adirio Mar 14, 2021
23c49c2
Add fish completion
Adirio Mar 15, 2021
cd8812d
Merge pull request #2083 from Adirio/export-config-machinery
k8s-ci-robot Mar 15, 2021
bca394b
Provide third-party devs the option to provide their own alpha subcom…
Adirio Mar 15, 2021
e9caa6e
Merge pull request #2088 from Adirio/fish-code-completion
k8s-ci-robot Mar 15, 2021
fdb87df
Merge pull request #2089 from Adirio/extra-alpha-commands
k8s-ci-robot Mar 15, 2021
83230ae
Improve plugin phase 1.5 EP
Adirio Mar 9, 2021
6ca3450
Merge pull request #2082 from Adirio/export-scaffold-machinery
k8s-ci-robot Mar 15, 2021
fb4beed
Add coverage badge from Coveralls
Adirio Mar 15, 2021
388b36e
Remove kubebuilder hardcoded reference in alpha subcommand description
Adirio Mar 15, 2021
05be3c2
Fix alpha extra commands parent command
Adirio Mar 15, 2021
94b63e2
Merge pull request #2090 from Adirio/add-coverage-badge
k8s-ci-robot Mar 15, 2021
4b4d28a
Merge pull request #2091 from Adirio/alpha-description
k8s-ci-robot Mar 15, 2021
bebd89c
Merge pull request #2092 from Adirio/fix-alpha-subcommands
k8s-ci-robot Mar 15, 2021
9eb0747
Cleanup help messages
Adirio Mar 16, 2021
104672d
Merge pull request #2093 from Adirio/cleanup-help
k8s-ci-robot Mar 16, 2021
82c1b65
Fix coverage report on master
Adirio Mar 16, 2021
e806ba0
Merge pull request #2094 from Adirio/fix-ci
k8s-ci-robot Mar 16, 2021
e5b6435
Merge pull request #2066 from leovct/use-client-new-in-tests
k8s-ci-robot Mar 16, 2021
911f342
Merge pull request #2075 from Adirio/ep-plugin-phase-1.5
k8s-ci-robot Mar 16, 2021
668b999
Enable the storage of multiple plugins as layout
Adirio Mar 17, 2021
406d79d
Merge pull request #2096 from Adirio/config-chain
estroz Mar 17, 2021
faff148
Merge pull request #2065 from johanneswuerbach/improve-service-monitor
k8s-ci-robot Mar 17, 2021
f7b0ae3
pkg/cli/alpha/config-gen: command docs no longer depend on local envi…
estroz Mar 17, 2021
f2e1edb
Plugin phase 1.5 implementation
Adirio Mar 15, 2021
646f742
Merge pull request #2097 from estroz/docs/config-gen-static-cmd-docs
estroz Mar 18, 2021
2983c97
Merge pull request #2060 from Adirio/plugin-phase-1.5
k8s-ci-robot Mar 18, 2021
62e4812
Fix linting issues
Adirio Mar 22, 2021
b789900
Merge pull request #2102 from Adirio/fix-lint
k8s-ci-robot Mar 23, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Execute golangci-lint
uses: golangci/golangci-lint-action@v2
with:
version: v1.29 # Always uses the latest patch version.
version: v1.37 # Always uses the latest patch version.
only-new-issues: true # Show only new issues if it's a pull request

testdata:
Expand All @@ -34,7 +34,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: '^1.15'
go-version: '1.15'
# This step is needed as the following one tries to remove
# kustomize for each test but has no permission to do so
- name: Remove pre-installed kustomize
Expand All @@ -57,7 +57,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: '^1.15'
go-version: '1.15'
# This step is needed as the following one tries to remove
# kustomize for each test but has no permission to do so
- name: Remove pre-installed kustomize
Expand All @@ -80,7 +80,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: '^1.15'
go-version: '1.15'
- name: Generate the coverage output
run: make test-coverage
- name: Send the coverage output
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ GOLANGCI_LINT = $(shell pwd)/bin/golangci-lint
golangci-lint:
@[ -f $(GOLANGCI_LINT) ] || { \
set -e ;\
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell dirname $(GOLANGCI_LINT)) v1.29.0 ;\
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell dirname $(GOLANGCI_LINT)) v1.37.1 ;\
}

##@ Tests
Expand All @@ -97,7 +97,7 @@ test-unit: ## Run the unit tests
.PHONY: test-coverage
test-coverage: ## Run unit tests creating the output to report coverage
- rm -rf *.out # Remove all coverage files if exists
go test -race -failfast -tags=integration -coverprofile=coverage-all.out -coverpkg="./pkg/cli/...,./pkg/config/...,./pkg/internal/...,./pkg/model/...,./pkg/plugin/...,./pkg/plugins/golang,./pkg/plugins/internal/..." ./pkg/...
go test -race -failfast -tags=integration -coverprofile=coverage-all.out -coverpkg="./pkg/cli/...,./pkg/config/...,./pkg/internal/...,./pkg/machinery/...,./pkg/model/...,./pkg/plugin/...,./pkg/plugins/golang" ./pkg/...

.PHONY: test-integration
test-integration: ## Run the integration tests
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[![Build Status](https://travis-ci.org/kubernetes-sigs/kubebuilder.svg?branch=master)](https://travis-ci.org/kubernetes-sigs/kubebuilder "Travis")
[![Go Report Card](https://goreportcard.com/badge/sigs.k8s.io/kubebuilder)](https://goreportcard.com/report/sigs.k8s.io/kubebuilder)
[![Coverage Status](https://coveralls.io/repos/github/kubernetes-sigs/kubebuilder/badge.svg?branch=master)](https://coveralls.io/github/kubernetes-sigs/kubebuilder?branch=master)

## Kubebuilder

Expand Down
14 changes: 10 additions & 4 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,25 @@

The Kubebuilder Project is released on an as-needed basis. The process is as follows:

1. An issue is proposing a new release with a changelog since the last release
1. An issue is proposing a new release with a changelog since the last release. You will need to use the [kubebuilder-release-tools][kubebuilder-release-tools] to generate the notes. See [here][release-notes-generation]
1. All [OWNERS](OWNERS) must LGTM this release
1. An OWNER runs `git tag -s $VERSION` and inserts the changelog and pushes the tag with `git push $VERSION`
1. A PR needs to be created to merge `master` branch into `book-v2` to pick up the new docs.
1. An OWNER runs `git tag -s $VERSION` and pushes the tag with `git push $VERSION`. Note that after the OWNER push the tag the CI will automatically add the release notes and the assets.
1. A PR needs to be created to merge `release-X` branch into `book-vX` to pick up the new docs.
1. The release issue is closed
1. An announcement email is sent to `[email protected]` with the subject `[ANNOUNCE] kubebuilder $VERSION is released`

Note: This process does not apply to EAP or alpha (pre-)releases which may be cut at any time for development
**Notes:** This process does not apply to EAP or alpha (pre-)releases which may be cut at any time for development
and testing.

For further information about versioning and update the Kubebuilder binaries check the [versioning][release-process] doc.

## HEAD releases

The binaries releases for HEAD are available here:

- [kubebuilder-release-master-head-darwin-amd64.tar.gz](https://storage.googleapis.com/kubebuilder-release/kubebuilder-release-master-head-darwin-amd64.tar.gz)
- [kubebuilder-release-master-head-linux-amd64.tar.gz](https://storage.googleapis.com/kubebuilder-release/kubebuilder-release-master-head-linux-amd64.tar.gz)

[kubebuilder-release-tools]: https://github.com/kubernetes-sigs/kubebuilder-release-tools
[release-notes-generation]: https://github.com/kubernetes-sigs/kubebuilder-release-tools/blob/master/README.md#release-notes-generation
[release-process]: https://github.com/kubernetes-sigs/kubebuilder/blob/master/VERSIONING.md#releasing
6 changes: 4 additions & 2 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
declarativev1 "sigs.k8s.io/kubebuilder/v3/pkg/plugins/declarative/v1"
pluginv2 "sigs.k8s.io/kubebuilder/v3/pkg/plugins/golang/v2"
pluginv3 "sigs.k8s.io/kubebuilder/v3/pkg/plugins/golang/v3"
)
Expand All @@ -30,14 +31,15 @@ func main() {
c, err := cli.New(
cli.WithCommandName("kubebuilder"),
cli.WithVersion(versionString()),
cli.WithDefaultProjectVersion(cfgv3.Version),
cli.WithPlugins(
&pluginv2.Plugin{},
&pluginv3.Plugin{},
&declarativev1.Plugin{},
),
cli.WithDefaultPlugins(cfgv2.Version, &pluginv2.Plugin{}),
cli.WithDefaultPlugins(cfgv3.Version, &pluginv3.Plugin{}),
cli.WithCompletion,
cli.WithDefaultProjectVersion(cfgv3.Version),
cli.WithCompletion(),
)
if err != nil {
log.Fatal(err)
Expand Down
137 changes: 107 additions & 30 deletions designs/extensible-cli-and-scaffolding-plugins-phase-1-5.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ The goal of this phase is to achieve one of the goals proposed for Phase 2: chai
Phase 2 includes several other challenging goals, but being able to chain plugins will be beneficial
for third-party developers that are using kubebuilder as a library.

The other main goal of phase 2, discovering and using external plugins, is out of the scope of this phase,
and will be tackled when phase 2 is implemented.

## Table of contents
- [Goal](#goal)
- [Motivation](#motivation)
Expand Down Expand Up @@ -46,36 +49,42 @@ Plugin chaining solves the aforementioned problems but the current plugin API, a

Design a Plugin API that combines the current [`Subcommand`](../pkg/plugin/interfaces.go) and
[`RunOptions`](../pkg/plugins/internal/cmdutil/cmdutil.go) interfaces and enables plugin-chaining.
The new `Subcommand` methods can be split in two different categories:
- Initialization methods
- Execution methods
The new `Subcommand` hooks can be split in two different categories:
- Initialization hooks
- Execution hooks

Initialization hooks are run during the dynamic creation of the CLI, which means that they are able to
modify the CLI, e.g. providing descriptions and examples for subcommands or binding flags.
Execution hooks are run after the CLI is created, and therefore cannot modify the CLI. On the other hand,
as they are run during the CLI execution, they have access to user-provided flag values, project configuration,
the new API resource or the filesystem abstraction, as opposed to the initialization hooks.

Additionally, some of these methods may be optional, in which case a non-implemented method will be skipped
when it should be called and consider it succeeded. This also allows to create some methods specific for
a certain subcommand call (e.g.: `Resource`-related methods for the `edit` subcommand are not needed).
Additionally, some of these hooks may be optional, in which case a non-implemented hook will be skipped
when it should be called and consider it succeeded. This also allows to create some hooks specific for
a certain subcommand call (e.g.: `Resource`-related hooks for the `edit` subcommand are not needed).

Different ordering guarantees can be considered:
- Method order guarantee: a method for a plugin will be called after its previous methods succeeded.
- Steps order guarantee: methods will be called when all plugins have finished the previous method.
- Plugin order guarantee: same method for each plugin will be called in the order specified
- Hook order guarantee: a hook for a plugin will be called after its previous hooks succeeded.
- Steps order guarantee: hooks will be called when all plugins have finished the previous hook.
- Plugin order guarantee: same hook for each plugin will be called in the order specified
by the plugin position at the plugin chain.

All of the methods will offer plugin order guarantee, as they all modify/update some item so the order
of plugins is important. Execution methods need to guarantee step order, as the items that are being modified
All of the hooks will offer plugin order guarantee, as they all modify/update some item so the order
of plugins is important. Execution hooks need to guarantee step order, as the items that are being modified
in each step (config, resource, and filesystem) are also needed in the following steps. This is not true for
initialization methods that modify items (metadata and flagset) that are only used in their own methods,
so they only need to guarantee method order.
initialization hooks that modify items (metadata and flagset) that are only used in their own methods,
so they only need to guarantee hook order.

Execution methods will be able to return an error. A specific error can be returned to specify that
no further methods of this plugin should be called, but that the scaffold process should be continued.
Execution hooks will be able to return an error. A specific error can be returned to specify that
no further hooks of this plugin should be called, but that the scaffold process should be continued.
This enables plugins to exit early, e.g., a plugin that scaffolds some files only for cluster-scoped
resources can detect if the resource is cluster-scoped at one of the first execution steps, and
therefore, use this error to tell the CLI that no further execution step should be called for itself.

### Initialization methods
### Initialization hooks

#### Update metadata
This method will be used for two purposes. It provides CLI-related metadata to the Subcommand (e.g.,
This hook will be used for two purposes. It provides CLI-related metadata to the Subcommand (e.g.,
command name) and update the subcommands metadata such as the description or examples.

- Required/optional
Expand All @@ -88,7 +97,7 @@ command name) and update the subcommands metadata such as the description or exa
- [x] Create webhook

#### Bind flags
This method will allow subcommands to define specific flags.
This hook will allow subcommands to define specific flags.

- Required/optional
- [ ] Required
Expand All @@ -102,7 +111,7 @@ This method will allow subcommands to define specific flags.
### Execution methods

#### Inject configuration
This method will be used to inject the `Config` object that the plugin can modify at will.
This hook will be used to inject the `Config` object that the plugin can modify at will.
The CLI will create/load/save this configuration object.

- Required/optional
Expand All @@ -115,7 +124,7 @@ The CLI will create/load/save this configuration object.
- [x] Create webhook

#### Inject resource
This method will be used to inject the `Resource` object.
This hook will be used to inject the `Resource` object created by the CLI.

- Required/optional
- [x] Required
Expand All @@ -127,9 +136,9 @@ This method will be used to inject the `Resource` object.
- [x] Create webhook

#### Pre-scaffold
This method will be used to take actions before the main scaffolding is performed, e.g. validations.
This hook will be used to take actions before the main scaffolding is performed, e.g. validations.

NOTE: a filesystem abstraction will be passed to this method that must be used for scaffolding.
NOTE: a filesystem abstraction will be passed to this hook, but it should not be used for scaffolding.

- Required/optional
- [ ] Required
Expand All @@ -141,9 +150,9 @@ NOTE: a filesystem abstraction will be passed to this method that must be used f
- [x] Create webhook

#### Scaffold
This method will be used to perform the main scaffolding.
This hook will be used to perform the main scaffolding.

NOTE: a filesystem abstraction will be passed to this method that must be used for scaffolding.
NOTE: a filesystem abstraction will be passed to this hook that must be used for scaffolding.

- Required/optional
- [x] Required
Expand All @@ -155,11 +164,14 @@ NOTE: a filesystem abstraction will be passed to this method that must be used f
- [x] Create webhook

#### Post-scaffold
This method will be used to take actions after the main scaffolding is performed, e.g. cleanup.
This hook will be used to take actions after the main scaffolding is performed, e.g. cleanup.

NOTE: a filesystem abstraction will **NOT** be passed to this method, as post-scaffold task do not require it.
NOTE: a filesystem abstraction will **NOT** be passed to this hook, as post-scaffold task do not require it.
In case some post-scaffold task requires a filesystem abstraction, it could be added.

NOTE 2: the project configuration is saved by the CLI before calling this hook, so changes done to the
configuration at this hook will not be persisted.

- Required/optional
- [ ] Required
- [x] Optional
Expand All @@ -168,10 +180,67 @@ In case some post-scaffold task requires a filesystem abstraction, it could be a
- [x] Edit
- [x] Create API
- [x] Create webhook

### Override plugins for single subcommand calls

Defining plugins at initialization and using them for every command call will solve most of the cases.
However, there are some cases where a plugin may be wanted just for a certain subcommand call. For
example, a project with multiple controllers may want to follow the declarative pattern in only one of
their controllers. The other case is also relevant, a project where most of the controllers follow the
declarative pattern may need a single controller not to follow it.

In order to achieve this, the `--plugins` flag will be allowed in every command call, overriding the
value used in its corresponging project initialization call.

### Plugin chain persistence

Currently, the project configuration v3 offers two mechanisms for storing plugin-related information.

- A layout field (`string`) that is used for plugin resolution on initialized projects.
- A plugin field (`map[string]interface{}`) that is used for plugin configuration raw storage.

Plugin resolution uses the `layout` field to resolve plugins. In this phase, it has to store a plugin
chain and not a single plugin. As this value is stored as a string, comma-separated representation can
be used to represent a chain of plugins instead.

NOTE: commas are not allowed in the plugin key.

While the `plugin` field may seem like a better fit to store the plugin chain, as it can already
contain multiple values, there are several issues with this alternative approach:
- A map does not provide any order guarantee, and the plugin chain order is relevant.
- Some plugins do not store plugin-specific configuration information, e.g. the `go`-plugins. So
the absence of a plugin key doesn't mean that the plugin is not part of the plugin chain.
- The desire of running a different set of plugins for a single subcommand call has already been
mentioned. Some of these out-of-chain plugins may need to store plugin-specific configuration,
so the presence of a plugin doesn't mean that is part of the plugin chain.

The next project configuration version could consider this new requirements to define the
names/types of these two fields.

### Plugin bundle

As a side-effect of plugin chaining, the user experience may suffer if they need to provide
several plugin keys for the `--plugins` flag. Additionally, this would also mean a user-facing
important breaking change.

In order to solve this issue, a plugin bundle concept will be introduced. A plugin bundle
behaves as a plugin:
- It has a name: provided at creation.
- It has a version: provided at creation.
- It has a list of supported project versions: computed from the common supported project
versions of all the plugins in the bundled.

Instead of implementing the optional getter methods that return a subcommand, it offers a way
to retrieve the list of bundled plugins. This process will be done after plugin resolution.

This way, CLIs will be able to define bundles, which will be used in the user-facing API and
the plugin resolution process, but later they will be treated as separate plugins offering
the maintainability and separation of concerns advantages that smaller plugins have in
comparison with bigger monolithic plugins.

## Implementation

The following types are used as input/output values of the described methods:
The following types are used as input/output values of the described hooks:
```go
// CLIMetadata is the runtime meta-data of the CLI
type CLIMetadata struct {
Expand All @@ -197,7 +266,7 @@ func (e ExitError) Error() string {
}
```

The described methods are implemented through the use of the following interfaces.
The described hooks are implemented through the use of the following interfaces.
```go
type RequiresCLIMetadata interface {
InjectCLIMetadata(CLIMetadata)
Expand All @@ -220,11 +289,11 @@ type RequiresResource interface {
}

type HasPreScaffold interface {
PreScaffold(afero.Fs) error
PreScaffold(machinery.Filesystem) error
}

type Scaffolder interface {
Scaffold(afero.Fs) error
Scaffold(machinery.Filesystem) error
}

type HasPostScaffold interface {
Expand Down Expand Up @@ -256,3 +325,11 @@ type CreateWebhookSubcommand interface {
Scaffolder
}
```

An additional interface defines the bundle method to return the wrapped plugins:
```go
type Bundle interface {
Plugin
Plugins() []Plugin
}
```
16 changes: 4 additions & 12 deletions pkg/cli/internal/config/config_suite_test.go → doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,8 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

package config
//go:generate go run github.com/markbates/pkger/cmd/pkger

import (
"testing"

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)

func TestCLI(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "Config Suite")
}
// Package kubebuilder contains pkged files compiled into the
// go binaries.
package kubebuilder
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ spec:
endpoints:
- path: /metrics
port: https
scheme: https
bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
tlsConfig:
insecureSkipVerify: true
selector:
matchLabels:
control-plane: controller-manager
Loading