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

Commit b27d358

Browse files
author
Jean-Christophe Sirot
committed
Replace com.docker.app.status action by io.cnab.status and adapt unit and e2e tests. The com.docker.app.status is still supported by the CLI and invocation image for the backward compatibility but new apps do not expose this action in the CNAB bundle anymore.
Signed-off-by: Jean-Christophe Sirot <[email protected]>
1 parent 7eea32b commit b27d358

File tree

7 files changed

+25
-20
lines changed

7 files changed

+25
-20
lines changed

cmd/cnab-run/main.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,13 @@ type cnabAction func(string) error
1212

1313
var (
1414
cnabActions = map[string]cnabAction{
15-
"install": installAction,
16-
"upgrade": installAction, // upgrade is implemented as reinstall.
17-
"uninstall": uninstallAction,
18-
internal.ActionStatusName: statusAction,
19-
internal.ActionInspectName: inspectAction,
20-
internal.ActionRenderName: renderAction,
15+
"install": installAction,
16+
"upgrade": installAction, // upgrade is implemented as reinstall.
17+
"uninstall": uninstallAction,
18+
internal.ActionStatusNameDeprecated: statusAction,
19+
internal.ActionStatusName: statusAction,
20+
internal.ActionInspectName: inspectAction,
21+
internal.ActionRenderName: renderAction,
2122
}
2223
)
2324

e2e/testdata/bundle-with-tag.json.golden

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"com.docker.app.render": {
4343
"stateless": true
4444
},
45-
"com.docker.app.status": {}
45+
"io.cnab.status": {}
4646
},
4747
"parameters": {
4848
"api_host": {
@@ -65,7 +65,7 @@
6565
"install",
6666
"upgrade",
6767
"uninstall",
68-
"com.docker.app.status"
68+
"io.cnab.status"
6969
]
7070
},
7171
"com.docker.app.orchestrator": {
@@ -86,7 +86,7 @@
8686
"install",
8787
"upgrade",
8888
"uninstall",
89-
"com.docker.app.status"
89+
"io.cnab.status"
9090
]
9191
},
9292
"com.docker.app.render-format": {

e2e/testdata/cnab-with-docker-status/bundle.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
"modifies": false
1313
}
1414
}
15-
}
15+
}

e2e/testdata/simple-bundle.json.golden

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"com.docker.app.render": {
4343
"stateless": true
4444
},
45-
"com.docker.app.status": {}
45+
"io.cnab.status": {}
4646
},
4747
"parameters": {
4848
"api_host": {
@@ -65,7 +65,7 @@
6565
"install",
6666
"upgrade",
6767
"uninstall",
68-
"com.docker.app.status"
68+
"io.cnab.status"
6969
]
7070
},
7171
"com.docker.app.orchestrator": {
@@ -86,7 +86,7 @@
8686
"install",
8787
"upgrade",
8888
"uninstall",
89-
"com.docker.app.status"
89+
"io.cnab.status"
9090
]
9191
},
9292
"com.docker.app.render-format": {

internal/commands/status.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ import (
2222
var (
2323
knownStatusActions = []string{
2424
internal.ActionStatusName,
25-
// TODO: Extract this constant to the cnab-go library
26-
"io.cnab.status",
25+
internal.ActionStatusNameDeprecated,
2726
}
2827
)
2928

internal/names.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,14 @@ const (
2424

2525
// Namespace is the reverse DNS namespace used with labels and CNAB custom actions.
2626
Namespace = "com.docker.app."
27+
// CnabNamespace is the namespace used with the CNAB well known custom actions
28+
CnabNamespace = "io.cnab."
2729

28-
// ActionStatusName is the name of the custom "status" action
29-
ActionStatusName = Namespace + "status"
30+
// ActionStatusNameDeprecated is the name of the docker custom "status" action
31+
// Deprecated: use ActionStatusName instead
32+
ActionStatusNameDeprecated = Namespace + "status"
33+
// ActionStatusName is the name of the CNAB well known custom "status" action - TODO: Extract this constant to the cnab-go library
34+
ActionStatusName = CnabNamespace + "status"
3035
// ActionInspectName is the name of the custom "inspect" action
3136
ActionInspectName = Namespace + "inspect"
3237
// ActionRenderName is the name of the custom "render" action

internal/packager/testdata/bundle-json.golden

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"com.docker.app.render": {
4848
"stateless": true
4949
},
50-
"com.docker.app.status": {}
50+
"io.cnab.status": {}
5151
},
5252
"parameters": {
5353
"com.docker.app.kubernetes-namespace": {
@@ -63,7 +63,7 @@
6363
"install",
6464
"upgrade",
6565
"uninstall",
66-
"com.docker.app.status"
66+
"io.cnab.status"
6767
]
6868
},
6969
"com.docker.app.orchestrator": {
@@ -84,7 +84,7 @@
8484
"install",
8585
"upgrade",
8686
"uninstall",
87-
"com.docker.app.status"
87+
"io.cnab.status"
8888
]
8989
},
9090
"com.docker.app.render-format": {

0 commit comments

Comments
 (0)