Skip to content

Commit

Permalink
nsc build: raise errors if multiple modes are selected
Browse files Browse the repository at this point in the history
  • Loading branch information
n-g committed Oct 20, 2023
1 parent 149c5cd commit d77e1d7
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion internal/cli/cmd/cluster/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,17 @@ func NewBuildCmd() *cobra.Command {
}

// XXX: having multiple outputs is not supported by buildctl.
if *push && *dockerLoad && *outputLocal != "" {
var activeModes int
if *push {
activeModes++
}
if *dockerLoad {
activeModes++
}
if *outputLocal != "" {
activeModes++
}
if activeModes > 1 {
return fnerrors.New("only one of --push, --load or --output-local can be used at a time")
}

Expand Down

0 comments on commit d77e1d7

Please sign in to comment.