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

Commit 7ab554b

Browse files
Add Apply-To actions indication to custom parameters, which restricts these parameters to the listed actions.
Signed-off-by: Silvin Lubecki <[email protected]>
1 parent 0967cd4 commit 7ab554b

File tree

2 files changed

+27
-2
lines changed

2 files changed

+27
-2
lines changed

e2e/testdata/simple-bundle.json.golden

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,13 @@
7474
"destination": {
7575
"path": "",
7676
"env": "DOCKER_KUBERNETES_NAMESPACE"
77-
}
77+
},
78+
"apply-to": [
79+
"install",
80+
"upgrade",
81+
"uninstall",
82+
"com.docker.app.status"
83+
]
7884
},
7985
"com.docker.app.orchestrator": {
8086
"type": "string",
@@ -91,7 +97,13 @@
9197
"destination": {
9298
"path": "",
9399
"env": "DOCKER_STACK_ORCHESTRATOR"
94-
}
100+
},
101+
"apply-to": [
102+
"install",
103+
"upgrade",
104+
"uninstall",
105+
"com.docker.app.status"
106+
]
95107
},
96108
"static_subdir": {
97109
"type": "string",

internal/packager/cnab.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ func ToCNAB(app *types.App, invocationImageName string) (*bundle.Bundle, error)
2626
Metadata: &bundle.ParameterMetadata{
2727
Description: "Orchestrator on which to deploy",
2828
},
29+
ApplyTo: []string{
30+
"install",
31+
"upgrade",
32+
"uninstall",
33+
internal.Namespace + "status",
34+
},
2935
},
3036
internal.Namespace + "kubernetes-namespace": {
3137
DataType: "string",
@@ -36,6 +42,13 @@ func ToCNAB(app *types.App, invocationImageName string) (*bundle.Bundle, error)
3642
Metadata: &bundle.ParameterMetadata{
3743
Description: "Namespace in which to deploy",
3844
},
45+
ApplyTo: []string{
46+
"install",
47+
"upgrade",
48+
"uninstall",
49+
internal.Namespace + "status",
50+
},
51+
},
3952
},
4053
}
4154
for name, envVar := range mapping.ParameterToCNABEnv {

0 commit comments

Comments
 (0)