Skip to content
This repository has been archived by the owner on Jun 13, 2021. It is now read-only.

Fix output to have a consistent naming #750

Merged
merged 1 commit into from
Nov 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions e2e/commands_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ func TestDockerAppLifecycle(t *testing.T) {
cmd.Command = dockerCli.Command("app", "ls")
checkContains(t, icmd.RunCmd(cmd).Assert(t, icmd.Success).Combined(),
[]string{
`INSTALLATION\s+APPLICATION\s+LAST ACTION\s+RESULT\s+CREATED\s+MODIFIED\s+REFERENCE`,
`RUNNING APP\s+APP NAME\s+LAST ACTION\s+RESULT\s+CREATED\s+MODIFIED\s+REFERENCE`,
fmt.Sprintf(`%s\s+simple \(1.1.0-beta1\)\s+install\s+failure\s+.+second[s]?\sago\s+.+second[s]?\sago\s+`, appName),
})

Expand Down Expand Up @@ -344,7 +344,7 @@ func TestDockerAppLifecycle(t *testing.T) {
cmd.Command = dockerCli.Command("app", "ls")
checkContains(t, icmd.RunCmd(cmd).Assert(t, icmd.Success).Combined(),
[]string{
`INSTALLATION\s+APPLICATION\s+LAST ACTION\s+RESULT\s+CREATED\s+MODIFIED\s+REFERENCE`,
`RUNNING APP\s+APP NAME\s+LAST ACTION\s+RESULT\s+CREATED\s+MODIFIED\s+REFERENCE`,
fmt.Sprintf(`%s\s+simple \(1.1.0-beta1\)\s+install\s+success\s+.+second[s]?\sago\s+.+second[s]?\sago\s+`, appName),
})

Expand Down
2 changes: 1 addition & 1 deletion examples/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Examples

This is a collection of [Docker App](./README.MD) examples. Most of them are fairly simple, and intended to illustrate various aspects of the Docker App product.
This is a collection of [Docker App](../README.MD) examples. Most of them are fairly simple, and intended to illustrate various aspects of the Docker App product.

### [Hello World: Starting example](hello-world)

Expand Down
6 changes: 3 additions & 3 deletions examples/hello-world/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ Next, you can check the list of running Apps:

```shell
$ docker app ls
INSTALLATION APPLICATION LAST ACTION RESULT CREATED MODIFIED REFERENCE
RUNNING APP APP NAME LAST ACTION RESULT CREATED MODIFIED REFERENCE
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wondering if APP NAME should become APP IMAGE at some point

Copy link
Contributor Author

@carolinebriaud carolinebriaud Nov 18, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here it is actually the app name coming from the metadata, so really this has nothing to do with the name you give to the app image when you build

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still unclear to me what this metadata name is for. I can't imagine much scenario where it's anything else but the repository name image is published to.

myhelloworld hello-world (0.1.0) install success About a minute ago About a minute ago docker.io/myrepo/hello-world:0.1.0
```

Expand All @@ -147,7 +147,7 @@ Finally you can get detailed information about a running App using the `docker a

```shell
$ docker app inspect myhelloworld --pretty
Installation:
Running App:
Name: myhelloworld
Created: 3 minutes ago
Modified: 3 minutes ago
Expand All @@ -156,7 +156,7 @@ Installation:
Result: success
Ochestrator: swarm
Application:
App:
Name: hello-world
Version: 0.1.0
Image Reference: docker.io/myrepo/hello-world:0.1.0
Expand Down
4 changes: 2 additions & 2 deletions internal/commands/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ var (
header string
value func(i *store.Installation) string
}{
{"INSTALLATION", func(i *store.Installation) string { return i.Name }},
{"APPLICATION", func(i *store.Installation) string { return fmt.Sprintf("%s (%s)", i.Bundle.Name, i.Bundle.Version) }},
{"RUNNING APP", func(i *store.Installation) string { return i.Name }},
{"APP NAME", func(i *store.Installation) string { return fmt.Sprintf("%s (%s)", i.Bundle.Name, i.Bundle.Version) }},
{"LAST ACTION", func(i *store.Installation) string { return i.Result.Action }},
{"RESULT", func(i *store.Installation) string { return i.Result.Status }},
{"CREATED", func(i *store.Installation) string {
Expand Down
4 changes: 2 additions & 2 deletions internal/inspect/inspect.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ type Application struct {
}

type AppInfo struct {
Installation Installation `yaml:"Installation,omitempty" json:"Installation,omitempty"`
Application Application `yaml:"Application,omitempty" json:"Application,omitempty"`
Installation Installation `yaml:"Running App,omitempty" json:"RunningApp,omitempty"`
Application Application `yaml:"App,omitempty" json:"App,omitempty"`
Parameters map[string]interface{} `yaml:"Parameters,omitempty" json:"Parameters,omitempty"`
}

Expand Down
4 changes: 2 additions & 2 deletions internal/inspect/testdata/inspect-app-json.golden
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"Installation": {
"RunningApp": {
"Name": "hello-world",
"Created": "1 day ago",
"Modified": "17 hours ago",
Expand All @@ -8,7 +8,7 @@
"Result": "success",
"Orchestrator": "swarm"
},
"Application": {
"App": {
"Name": "hello-world",
"Version": "0.1.0",
"ImageReference": "docker.io/sirot/hello-world:0.1.0"
Expand Down
4 changes: 2 additions & 2 deletions internal/inspect/testdata/inspect-app-pretty.golden
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Installation:
Running App:
Name: hello-world
Created: 1 day ago
Modified: 17 hours ago
Expand All @@ -7,7 +7,7 @@ Installation:
Result: success
Ochestrator: swarm

Application:
App:
Name: hello-world
Version: 0.1.0
Image Reference: docker.io/sirot/hello-world:0.1.0
Expand Down