Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an overwrite flag to package bind #474

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions commands/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ type FlagsStruct struct {
detail bool
format string
nameSort bool // sorts list alphabetically by entity name
overwrite bool
}

property struct {
Expand Down
5 changes: 4 additions & 1 deletion commands/package.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ var packageBindCmd = &cobra.Command{
Binding: binding,
}

_, _, err = Client.Packages.Insert(p, false)
overwrite := Flags.common.overwrite

_, _, err = Client.Packages.Insert(p, overwrite)
if err != nil {
whisk.Debug(whisk.DbgError, "Client.Packages.Insert(%#v, false) failed: %s\n", p, err)
errStr := wski18n.T("Binding creation failed: {{.err}}", map[string]interface{}{"err": err})
Expand Down Expand Up @@ -522,6 +524,7 @@ func init() {
packageBindCmd.Flags().StringVarP(&Flags.common.annotFile, "annotation-file", "A", "", wski18n.T("`FILE` containing annotation values in JSON format"))
packageBindCmd.Flags().StringSliceVarP(&Flags.common.param, "param", "p", []string{}, wski18n.T("parameter values in `KEY VALUE` format"))
packageBindCmd.Flags().StringVarP(&Flags.common.paramFile, "param-file", "P", "", wski18n.T("`FILE` containing parameter values in JSON format"))
packageBindCmd.Flags().BoolVarP(&Flags.common.overwrite, "overwrite", "o", false, wski18n.T("overwrite bind"))

packageListCmd.Flags().IntVarP(&Flags.common.skip, "skip", "s", 0, wski18n.T("exclude the first `SKIP` number of packages from the result"))
packageListCmd.Flags().IntVarP(&Flags.common.limit, "limit", "l", 30, wski18n.T("only return `LIMIT` number of packages from the collection"))
Expand Down