@@ -10,31 +10,31 @@ import (
1010 "github.com/spf13/cobra"
1111)
1212
13- type upgradeOptions struct {
13+ type updateOptions struct {
1414 parametersOptions
1515 credentialOptions
1616 bundleOrDockerApp string
1717}
1818
19- func upgradeCmd (dockerCli command.Cli ) * cobra.Command {
20- var opts upgradeOptions
19+ func updateCmd (dockerCli command.Cli ) * cobra.Command {
20+ var opts updateOptions
2121 cmd := & cobra.Command {
22- Use : "upgrade INSTALLATION_NAME [--target-context TARGET_CONTEXT] [ OPTIONS]" ,
23- Short : "Upgrade an installed application" ,
24- Example : `$ docker app upgrade myinstallation --target-context=mycontext --set key=value` ,
22+ Use : "update [ OPTIONS] RUNNING_APP " ,
23+ Short : "Update a running application" ,
24+ Example : `$ docker app update myrunningapp --target-context=mycontext --set key=value` ,
2525 Args : cobra .ExactArgs (1 ),
2626 RunE : func (cmd * cobra.Command , args []string ) error {
27- return runUpgrade (dockerCli , args [0 ], opts )
27+ return runUpdate (dockerCli , args [0 ], opts )
2828 },
2929 }
3030 opts .parametersOptions .addFlags (cmd .Flags ())
3131 opts .credentialOptions .addFlags (cmd .Flags ())
32- cmd .Flags ().StringVar (& opts .bundleOrDockerApp , "app-name " , "" , "Override the installation with another Application Package" )
32+ cmd .Flags ().StringVar (& opts .bundleOrDockerApp , "image " , "" , "Override the installation with another Application Package" )
3333
3434 return cmd
3535}
3636
37- func runUpgrade (dockerCli command.Cli , installationName string , opts upgradeOptions ) error {
37+ func runUpdate (dockerCli command.Cli , installationName string , opts updateOptions ) error {
3838 defer muteDockerCli (dockerCli )()
3939 opts .SetDefaultTargetContext (dockerCli )
4040
@@ -49,7 +49,7 @@ func runUpgrade(dockerCli command.Cli, installationName string, opts upgradeOpti
4949 }
5050
5151 if isInstallationFailed (installation ) {
52- return fmt .Errorf ("Installation %q has failed and cannot be upgraded , reinstall it using 'docker app install'" , installationName )
52+ return fmt .Errorf ("Installation %q has failed and cannot be updated , reinstall it using 'docker app install'" , installationName )
5353 }
5454
5555 if opts .bundleOrDockerApp != "" {
@@ -85,11 +85,11 @@ func runUpgrade(dockerCli command.Cli, installationName string, opts upgradeOpti
8585 err = u .Run (& installation .Claim , creds , os .Stdout )
8686 err2 := installationStore .Store (installation )
8787 if err != nil {
88- return fmt .Errorf ("Upgrade failed: %s\n %s" , err , errBuf )
88+ return fmt .Errorf ("Update failed: %s\n %s" , err , errBuf )
8989 }
9090 if err2 != nil {
9191 return err2
9292 }
93- fmt .Fprintf (os .Stdout , "Application %q upgraded on context %q\n " , installationName , opts .targetContext )
93+ fmt .Fprintf (os .Stdout , "Application %q updated on context %q\n " , installationName , opts .targetContext )
9494 return nil
9595}
0 commit comments