Skip to content

Commit

Permalink
Merge pull request #1403 from estroz/feature/plugins-config-layout
Browse files Browse the repository at this point in the history
feature/plugins: config `layout`, `--plugins` flag, and plugin name validation
  • Loading branch information
k8s-ci-robot committed Mar 25, 2020
2 parents cf728d8 + f460cc7 commit 505e23d
Show file tree
Hide file tree
Showing 16 changed files with 342 additions and 147 deletions.
4 changes: 4 additions & 0 deletions cmd/main.go
Expand Up @@ -31,6 +31,10 @@ func main() {
&pluginv1.Plugin{},
&pluginv2.Plugin{},
),
cli.WithDefaultPlugins(
&pluginv1.Plugin{},
&pluginv2.Plugin{},
),
cli.WithExtraCommands(
newEditCmd(),
newUpdateCmd(),
Expand Down
2 changes: 1 addition & 1 deletion designs/extensible-cli-and-scaffolding-plugins-phase-1.md
Expand Up @@ -62,7 +62,7 @@ project versions (via `SupportedProjectVersions()`).
Example `PROJECT` file:

```yaml
version: "3-alpha"
version: "2"
layout: go/v1.0.0
domain: testproject.org
repo: github.com/test-inc/testproject
Expand Down
7 changes: 1 addition & 6 deletions pkg/cli/api.go
Expand Up @@ -55,14 +55,9 @@ func (c cli) newAPIContext() plugin.Context {
}

func (c cli) bindCreateAPI(ctx plugin.Context, cmd *cobra.Command) {
versionedPlugins, err := c.getVersionedPlugins()
if err != nil {
cmdErr(cmd, err)
return
}
var getter plugin.CreateAPIPluginGetter
var hasGetter bool
for _, p := range versionedPlugins {
for _, p := range c.resolvedPlugins {
tmpGetter, isGetter := p.(plugin.CreateAPIPluginGetter)
if isGetter {
if hasGetter {
Expand Down

0 comments on commit 505e23d

Please sign in to comment.