Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Commit 2ec23c8

Browse files
Use app naming rules in error and progress messages
Signed-off-by: Caroline Briaud <[email protected]>
1 parent b07e744 commit 2ec23c8

File tree

6 files changed

+14
-14
lines changed

6 files changed

+14
-14
lines changed

internal/commands/build/build.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ func runBuild(dockerCli command.Cli, contextPath string, opt buildOptions) error
114114

115115
if opt.imageIDFile != "" {
116116
if err = ioutil.WriteFile(opt.imageIDFile, []byte(id.Digest().String()), 0644); err != nil {
117-
fmt.Fprintf(dockerCli.Err(), "Failed to write application image id in %s: %s", opt.imageIDFile, err)
117+
fmt.Fprintf(dockerCli.Err(), "Failed to write App image ID in %s: %s", opt.imageIDFile, err)
118118
}
119119
}
120120

@@ -191,7 +191,7 @@ func getAppFolder(opt buildOptions, contextPath string) (string, error) {
191191
for _, f := range files {
192192
if strings.HasSuffix(f.Name(), ".dockerapp") {
193193
if application != "" {
194-
return "", fmt.Errorf("%s contains multiple .dockerapp directories, use -f option to select the one to build", contextPath)
194+
return "", fmt.Errorf("%s contains multiple .dockerapp directories, use -f option to select the App definition to build", contextPath)
195195
}
196196
application = filepath.Join(contextPath, f.Name())
197197
if !f.IsDir() {

internal/commands/build/types.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ type ImageBuildConfig struct {
2828
func load(dict map[string]interface{}, buildArgs []string) ([]ServiceConfig, error) {
2929
section, ok := dict["services"]
3030
if !ok {
31-
return nil, fmt.Errorf("compose file doesn't declare any service")
31+
return nil, fmt.Errorf("Compose file doesn't declare any service")
3232
}
3333
services, ok := section.(map[string]interface{})
3434
if !ok {
35-
return nil, fmt.Errorf("Invalid compose file: 'services' should be a map")
35+
return nil, fmt.Errorf("Invalid Compose file: 'services' should be a map")
3636
}
3737
return loadServices(services, buildArgs)
3838
}

internal/commands/image/tag.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ func readBundle(name string, bundleStore store.BundleStore) (*bundle.Bundle, err
5353

5454
bundle, err := bundleStore.Read(cnabRef)
5555
if err != nil {
56-
return nil, fmt.Errorf("could not tag '%s': no such application image", name)
56+
return nil, fmt.Errorf("could not tag '%s': no such App image", name)
5757
}
5858
return bundle, nil
5959
}

internal/commands/remove.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ func runRemove(dockerCli command.Cli, installationName string, opts removeOption
5555
return
5656
}
5757
if err := installationStore.Delete(installationName); err != nil {
58-
fmt.Fprintf(os.Stderr, "failed to force deletion of installation %q: %s\n", installationName, err)
58+
fmt.Fprintf(os.Stderr, "failed to force deletion of running App %q: %s\n", installationName, err)
5959
return
6060
}
61-
fmt.Fprintf(os.Stderr, "deletion forced for installation %q\n", installationName)
61+
fmt.Fprintf(os.Stderr, "deletion forced for running App %q\n", installationName)
6262
}()
6363
}
6464
bind, err := cnab.RequiredClaimBindMount(installation.Claim, opts.targetContext, dockerCli)
@@ -83,8 +83,8 @@ func runRemove(dockerCli command.Cli, installationName string, opts removeOption
8383
return fmt.Errorf("Remove failed: %s\n%s", err, errBuf)
8484
}
8585
if err := installationStore.Delete(installationName); err != nil {
86-
return fmt.Errorf("Failed to delete installation %q from the installation store: %s", installationName, err)
86+
return fmt.Errorf("Failed to delete running App %q from the installation store: %s", installationName, err)
8787
}
88-
fmt.Fprintf(os.Stdout, "Application %q uninstalled on context %q\n", installationName, opts.targetContext)
88+
fmt.Fprintf(os.Stdout, "App %q uninstalled on context %q\n", installationName, opts.targetContext)
8989
return nil
9090
}

internal/commands/run.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ func runDockerApp(dockerCli command.Cli, appname string, opts runOptions) error
8383

8484
bndl, ref, err := cnab.GetBundle(dockerCli, bundleStore, appname)
8585
if err != nil {
86-
return errors.Wrapf(err, "Unable to find application %q", appname)
86+
return errors.Wrapf(err, "Unable to find App %q", appname)
8787
}
8888
return runBundle(dockerCli, bndl, opts, ref.String())
8989
}
@@ -154,12 +154,12 @@ func runBundle(dockerCli command.Cli, bndl *bundle.Bundle, opts runOptions, ref
154154
// so any installation needs a clean uninstallation.
155155
err2 := installationStore.Store(installation)
156156
if err != nil {
157-
return fmt.Errorf("Installation failed: %s\n%s", err, errBuf)
157+
return fmt.Errorf("Failed to run App: %s\n%s", err, errBuf)
158158
}
159159
if err2 != nil {
160160
return err2
161161
}
162162

163-
fmt.Fprintf(os.Stdout, "Application %q installed on context %q\n", installationName, opts.targetContext)
163+
fmt.Fprintf(os.Stdout, "App %q is running on context %q\n", installationName, opts.targetContext)
164164
return nil
165165
}

internal/commands/update.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ func runUpdate(dockerCli command.Cli, installationName string, opts updateOption
5050
}
5151

5252
if isInstallationFailed(installation) {
53-
return fmt.Errorf("Installation %q has failed and cannot be updated, reinstall it using 'docker app run'", installationName)
53+
return fmt.Errorf("Running App %q cannot be updated, please use 'docker app run' instead", installationName)
5454
}
5555

5656
if opts.bundleOrDockerApp != "" {
@@ -91,6 +91,6 @@ func runUpdate(dockerCli command.Cli, installationName string, opts updateOption
9191
if err2 != nil {
9292
return err2
9393
}
94-
fmt.Fprintf(os.Stdout, "Application %q updated on context %q\n", installationName, opts.targetContext)
94+
fmt.Fprintf(os.Stdout, "Running App %q updated on context %q\n", installationName, opts.targetContext)
9595
return nil
9696
}

0 commit comments

Comments
 (0)