Skip to content

Commit

Permalink
Improve missing registry on sanic build --push message.
Browse files Browse the repository at this point in the history
  • Loading branch information
ColinChartier committed Jul 2, 2019
1 parent e96bdf3 commit 2a34c7c
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions commands/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,13 @@ func buildCommandAction(cliContext *cli.Context) error {
registry := ""
registryInsecure := false
if cliContext.Bool("push") {
var err error
registry, registryInsecure, err = getRegistry()
if err != nil {
return cli.NewExitError(fmt.Sprintf("could not get registry to push to: %s", err.Error()), 1)
}
provisioner, err := getProvisioner()
_, err := getProvisioner()
if err != nil {
return cli.NewExitError(fmt.Sprintf("you must be in an environment with a provisioner to use --push while building: %s", err.Error()), 1)
}
fmt.Println("Because you specified --push, sanic is ensuring that there is a valid cluster running...")
err = provisioner.EnsureCluster()
registry, registryInsecure, err = getRegistry()
if err != nil {
return cli.NewExitError(err.Error(), 1)
return cli.NewExitError(fmt.Sprintf("you specified --push, but a registry was not found: %s. Try sanic deploy first.", err.Error()), 1)
}
}

Expand Down

0 comments on commit 2a34c7c

Please sign in to comment.