Skip to content

Commit

Permalink
Merge pull request #941 from treeverse/bugfix/940-init-add-flag-acces…
Browse files Browse the repository at this point in the history
…s-key-id

Make "lakefs init" work when _not_ specifying access_key_id
  • Loading branch information
arielshaqed authored Nov 19, 2020
2 parents 74ac713 + db02f63 commit 95e2125
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions cmd/lakefs/cmd/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,24 @@ var initCmd = &cobra.Command{
},
}

const internalErrorCode = 2

//nolint:gochecknoinits
func init() {
rootCmd.AddCommand(initCmd)
f := initCmd.Flags()
f.String("user-name", "", "an identifier for the user (e.g. \"jane.doe\")")
f.String("access-key-id", "", "AWS-format access key ID to create for that user (for integration)")
f.String("secret-access-key", "", "AWS-format secret access key to create for that user (for integration)")
if err := f.MarkHidden("access-key-id"); err != nil {
// (internal error)
fmt.Fprint(os.Stderr, err)
os.Exit(internalErrorCode)
}
if err := f.MarkHidden("secret-access-key"); err != nil {
// (internal error)
fmt.Fprint(os.Stderr, err)
os.Exit(internalErrorCode)
}
_ = initCmd.MarkFlagRequired("user-name")
}

0 comments on commit 95e2125

Please sign in to comment.