Skip to content

Commit

Permalink
Merge pull request #1490 from camilamacedo86/remove-deprecated-flags
Browse files Browse the repository at this point in the history
remove the deprecated flags: depArgs and dep. Use fetch-deps instead of them.
  • Loading branch information
k8s-ci-robot committed May 8, 2020
2 parents 5e387b7 + 39224f0 commit 118df81
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 21 deletions.
20 changes: 1 addition & 19 deletions pkg/plugin/v2/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package v2

import (
"fmt"
"log"
"os"
"path/filepath"
"strings"
Expand All @@ -42,11 +41,6 @@ type initPlugin struct {
license string
owner string

// deprecated flags
depFlag *pflag.Flag
depArgs []string
dep bool

// flags
fetchDeps bool
skipGoVersionCheck bool
Expand Down Expand Up @@ -87,18 +81,6 @@ func (p *initPlugin) BindFlags(fs *pflag.FlagSet) {
// dependency args
fs.BoolVar(&p.fetchDeps, "fetch-deps", true, "ensure dependencies are downloaded")

// deprecated dependency args
fs.BoolVar(&p.dep, "dep", true, "if specified, determines whether dep will be used.")
p.depFlag = fs.Lookup("dep")
fs.StringArrayVar(&p.depArgs, "depArgs", nil, "additional arguments for dep")

if err := fs.MarkDeprecated("dep", "use the fetch-deps flag instead"); err != nil {
log.Printf("error to mark dep flag as deprecated: %v", err)
}
if err := fs.MarkDeprecated("depArgs", "will be removed with version 1 scaffolding"); err != nil {
log.Printf("error to mark dep flag as deprecated: %v", err)
}

// boilerplate args
fs.StringVar(&p.license, "license", "apache2",
"license to use to boilerplate, may be one of 'apache2', 'none'")
Expand Down Expand Up @@ -157,7 +139,7 @@ func (p *initPlugin) GetScaffolder() (scaffold.Scaffolder, error) {
}

func (p *initPlugin) PostScaffold() error {
if (p.depFlag.Changed && !p.dep) || (!p.depFlag.Changed && !p.fetchDeps) {
if !p.fetchDeps {
fmt.Println("Skipping fetching dependencies.")
return nil
}
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/v2/e2e_suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ var _ = Describe("kubebuilder", func() {
err := kbc.Init(
"--project-version", "2",
"--domain", kbc.Domain,
"--dep=false")
"--fetch-deps=false")
Expect(err).Should(Succeed())

By("creating api definition")
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/v3/e2e_suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ var _ = Describe("kubebuilder", func() {
err := kbc.Init(
"--project-version", "3-alpha",
"--domain", kbc.Domain,
"--dep=false")
"--fetch-deps=false")
Expect(err).Should(Succeed())

By("creating api definition")
Expand Down

0 comments on commit 118df81

Please sign in to comment.