Skip to content
This repository has been archived by the owner on May 3, 2022. It is now read-only.

Commit

Permalink
remove insecure from creds generate
Browse files Browse the repository at this point in the history
  • Loading branch information
Michelle Noorali committed Apr 5, 2019
1 parent 16e80e2 commit 8ca0742
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 11 deletions.
6 changes: 2 additions & 4 deletions cmd/duffle/credential_generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ will still need to edit that file to set the appropriate values.
func newCredentialGenerateCmd(out io.Writer) *cobra.Command {
bundleFile := ""
var (
insecure bool
dryRun bool
noPrompt bool
)
Expand All @@ -47,7 +46,7 @@ func newCredentialGenerateCmd(out io.Writer) *cobra.Command {
Short: "generate a credentialset from a bundle",
Long: credentialGenerateHelp,
RunE: func(cmd *cobra.Command, args []string) error {
bf, err := getBundleFileFromCredentialsArg(args, bundleFile, out, insecure)
bf, err := getBundleFileFromCredentialsArg(args, bundleFile, out)
if err != nil {
return err
}
Expand Down Expand Up @@ -84,7 +83,6 @@ func newCredentialGenerateCmd(out io.Writer) *cobra.Command {

f := cmd.Flags()
f.StringVarP(&bundleFile, "file", "f", "", "path to bundle.json")
f.BoolVarP(&insecure, "insecure", "k", false, "do not verify the bundle (INSECURE)")
f.BoolVar(&dryRun, "dry-run", false, "show prompts and result, but don't create credential set")
f.BoolVarP(&noPrompt, "no-prompt", "q", false, "do not prompt for input, but generate a stub credentialset")

Expand Down Expand Up @@ -178,7 +176,7 @@ func genCredentialSurvey(name string) (credentials.CredentialStrategy, error) {
return c, nil
}

func getBundleFileFromCredentialsArg(args []string, bundleFile string, w io.Writer, insecure bool) (string, error) {
func getBundleFileFromCredentialsArg(args []string, bundleFile string, w io.Writer) (string, error) {
switch {
case len(args) < 1:
return "", errors.New("This command requires at least one argument: NAME (name for the credentialset). It also requires a BUNDLE (CNAB bundle name) or file (using -f)\nValid inputs:\n\t$ duffle credentials generate NAME BUNDLE\n\t$ duffle credentials generate NAME -f path-to-bundle.json")
Expand Down
6 changes: 2 additions & 4 deletions cmd/duffle/main.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package main

import (
"errors"
"fmt"
"os"
"path/filepath"
Expand All @@ -22,9 +21,8 @@ import (

var (
// duffleHome depicts the home directory where all duffle config is stored.
duffleHome string
rootCmd *cobra.Command
ErrUnderConstruction = errors.New("under construction")
duffleHome string
rootCmd *cobra.Command
)

func main() {
Expand Down
2 changes: 0 additions & 2 deletions cmd/duffle/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ func newRootCmd(outputRedirect io.Writer) *cobra.Command {
cmd.AddCommand(newInitCmd(outLog))
cmd.AddCommand(newShowCmd(outLog))
cmd.AddCommand(newListCmd(outLog))
cmd.AddCommand(newPullCmd(outLog))
cmd.AddCommand(newPushCmd(outLog))
cmd.AddCommand(newVersionCmd(outLog))
cmd.AddCommand(newInstallCmd(outLog))
cmd.AddCommand(newStatusCmd(outLog))
Expand Down
2 changes: 1 addition & 1 deletion pkg/packager/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ type Importer struct {
//
// source is the filesystem path to the archive.
// destination is the directory to unpack the contents.
// load is a loader.BundleLoader preconfigured for loading secure or insecure bundles.
// load is a loader.BundleLoader preconfigured for loading bundles.
func NewImporter(source, destination string, load loader.BundleLoader, verbose bool) (*Importer, error) {
cli, err := client.NewClientWithOpts(client.FromEnv)
if err != nil {
Expand Down

0 comments on commit 8ca0742

Please sign in to comment.