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

Commit 0ffdc18

Browse files
Merge pull request #713 from carolinebriaud/fix-usages-examples
Use app naming rules in error and progress messages
2 parents 6e215e7 + 0abe6b4 commit 0ffdc18

13 files changed

+23
-23
lines changed

e2e/commands_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ func testDockerAppLifecycle(t *testing.T, useBindMount bool) {
238238
cmd.Command = dockerCli.Command("app", "update", appName)
239239
icmd.RunCmd(cmd).Assert(t, icmd.Expected{
240240
ExitCode: 1,
241-
Err: fmt.Sprintf("Installation %q has failed and cannot be updated, reinstall it using 'docker app run'", appName),
241+
Err: fmt.Sprintf("Running App %q cannot be updated, please use 'docker app run' instead", appName),
242242
})
243243

244244
// Install a Docker Application Package with an existing failed installation is fine

e2e/images_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,14 +155,14 @@ a-simple-app:latest simple
155155
dockerAppImageTag("b-simple-app", "target")
156156
icmd.RunCmd(cmd).Assert(t, icmd.Expected{
157157
ExitCode: 1,
158-
Err: `could not tag 'b-simple-app': no such application image`,
158+
Err: `could not tag 'b-simple-app': no such App image`,
159159
})
160160

161161
// with unexisting source tag
162162
dockerAppImageTag("a-simple-app:not-a-tag", "target")
163163
icmd.RunCmd(cmd).Assert(t, icmd.Expected{
164164
ExitCode: 1,
165-
Err: `could not tag 'a-simple-app:not-a-tag': no such application image`,
165+
Err: `could not tag 'a-simple-app:not-a-tag': no such App image`,
166166
})
167167

168168
// tag image with only names

e2e/pushpull_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,8 @@ func TestPushPullInstall(t *testing.T) {
180180
// install should fail (registry is stopped)
181181
cmd.Command = dockerCli.Command("app", "run", "unknown")
182182
//nolint: lll
183-
expected := `Unable to find application image "unknown:latest" locally
184-
Unable to find application "unknown": failed to resolve bundle manifest "docker.io/library/unknown:latest": pull access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed`
183+
expected := `Unable to find App image "unknown:latest" locally
184+
Unable to find App "unknown": failed to resolve bundle manifest "docker.io/library/unknown:latest": pull access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed`
185185
icmd.RunCmd(cmd).Assert(t, icmd.Expected{
186186
ExitCode: 1,
187187
Err: expected,

e2e/testdata/credential-install-full.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ bar
44
SECRET_THREE: baz
55
/var/secret_three/data.txt
66
baz
7-
Application "full" installed on context "default"
7+
App "full" running on context "default"

e2e/testdata/credential-install-mixed-credstore.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ secret2value
44
SECRET_THREE: xyzzy
55
/var/secret_three/data.txt
66
xyzzy
7-
Application "mixed-credstore" installed on context "default"
7+
App "mixed-credstore" running on context "default"

e2e/testdata/credential-install-mixed-local-cred.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ secret2value
44
SECRET_THREE: xyzzy
55
/var/secret_three/data.txt
66
xyzzy
7-
Application "mixed-local-cred" installed on context "default"
7+
App "mixed-local-cred" running on context "default"

internal/cnab/cnab.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ func GetBundle(dockerCli command.Cli, bundleStore appstore.BundleStore, name str
9696
}
9797
bndl, err := bundleStore.Read(ref)
9898
if err != nil {
99-
fmt.Fprintf(dockerCli.Err(), "Unable to find application image %q locally\n", reference.FamiliarString(ref))
99+
fmt.Fprintf(dockerCli.Err(), "Unable to find App image %q locally\n", reference.FamiliarString(ref))
100100

101101
fmt.Fprintf(dockerCli.Out(), "Pulling from registry...\n")
102102
if named, ok := ref.(reference.Named); ok {

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
}

0 commit comments

Comments
 (0)