Skip to content

Commit

Permalink
fix: removed cmd.ParseFlags
Browse files Browse the repository at this point in the history
  • Loading branch information
zregvart committed Dec 5, 2018
1 parent 144e04d commit 3a56d01
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
10 changes: 2 additions & 8 deletions pkg/client/cmd/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,13 @@ package cmd
import (
"fmt"

"os"

"github.com/apache/camel-k/pkg/install"
"github.com/pkg/errors"
"github.com/spf13/cobra"
k8serrors "k8s.io/apimachinery/pkg/api/errors"
)

func newCmdInstall(rootCmdOptions *RootCmdOptions) (*cobra.Command, error) {
func newCmdInstall(rootCmdOptions *RootCmdOptions) *cobra.Command {
options := installCmdOptions{
RootCmdOptions: rootCmdOptions,
}
Expand All @@ -44,12 +42,8 @@ func newCmdInstall(rootCmdOptions *RootCmdOptions) (*cobra.Command, error) {
cmd.Flags().StringVar(&options.registry, "registry", "", "A Docker registry that can be used to publish images")
cmd.Flags().StringVar(&options.organization, "organization", "", "A organization on the Docker registry that can be used to publish images")
cmd.Flags().StringVar(&options.pushSecret, "push-secret", "", "A secret used to push images to the Docker registry")
err := cmd.ParseFlags(os.Args)
if err != nil {
return nil, err
}

return &cmd, nil
return &cmd
}

type installCmdOptions struct {
Expand Down
6 changes: 1 addition & 5 deletions pkg/client/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,7 @@ func NewKamelCommand(ctx context.Context) (*cobra.Command, error) {
cmd.AddCommand(newCmdRun(&options))
cmd.AddCommand(newCmdGet(&options))
cmd.AddCommand(newCmdDelete(&options))
install, err := newCmdInstall(&options)
if err != nil {
return nil, err
}
cmd.AddCommand(install)
cmd.AddCommand(newCmdInstall(&options))
cmd.AddCommand(newCmdLog(&options))
cmd.AddCommand(newCmdContext(&options))

Expand Down

0 comments on commit 3a56d01

Please sign in to comment.