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

Commit 6f5f315

Browse files
committed
Update cnab-to-oci and cnab-go to latest
Signed-off-by: Djordje Lukic <[email protected]>
1 parent 384883a commit 6f5f315

File tree

28 files changed

+657
-449
lines changed

28 files changed

+657
-449
lines changed

Gopkg.lock

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Gopkg.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ required = ["github.com/wadey/gocovmerge"]
2929

3030
[[override]]
3131
name = "github.com/docker/cnab-to-oci"
32-
branch = "master"
32+
version = "v0.1.0-beta2"
3333

3434
[[override]]
3535
name = "github.com/containerd/containerd"
@@ -41,7 +41,7 @@ required = ["github.com/wadey/gocovmerge"]
4141

4242
[[override]]
4343
name = "github.com/deislabs/cnab-go"
44-
branch = "master"
44+
version = "v0.3.2-beta1"
4545

4646
[[constraint]]
4747
name = "github.com/sirupsen/logrus"

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

Lines changed: 55 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -46,63 +46,61 @@
4646
"io.cnab.status": {}
4747
},
4848
"parameters": {
49-
"fields": {
50-
"api_host": {
51-
"definition": "api_host",
52-
"destination": {
53-
"env": "docker_param1"
54-
}
55-
},
56-
"com.docker.app.kubernetes-namespace": {
57-
"definition": "com.docker.app.kubernetes-namespace",
58-
"applyTo": [
59-
"install",
60-
"upgrade",
61-
"uninstall",
62-
"io.cnab.status"
63-
],
64-
"destination": {
65-
"env": "DOCKER_KUBERNETES_NAMESPACE"
66-
}
67-
},
68-
"com.docker.app.orchestrator": {
69-
"definition": "com.docker.app.orchestrator",
70-
"applyTo": [
71-
"install",
72-
"upgrade",
73-
"uninstall",
74-
"io.cnab.status"
75-
],
76-
"destination": {
77-
"env": "DOCKER_STACK_ORCHESTRATOR"
78-
}
79-
},
80-
"com.docker.app.render-format": {
81-
"definition": "com.docker.app.render-format",
82-
"applyTo": [
83-
"com.docker.app.render"
84-
],
85-
"destination": {
86-
"env": "DOCKER_RENDER_FORMAT"
87-
}
88-
},
89-
"com.docker.app.share-registry-creds": {
90-
"definition": "com.docker.app.share-registry-creds",
91-
"destination": {
92-
"env": "DOCKER_SHARE_REGISTRY_CREDS"
93-
}
94-
},
95-
"static_subdir": {
96-
"definition": "static_subdir",
97-
"destination": {
98-
"env": "docker_param2"
99-
}
100-
},
101-
"web_port": {
102-
"definition": "web_port",
103-
"destination": {
104-
"env": "docker_param3"
105-
}
49+
"api_host": {
50+
"definition": "api_host",
51+
"destination": {
52+
"env": "docker_param1"
53+
}
54+
},
55+
"com.docker.app.kubernetes-namespace": {
56+
"definition": "com.docker.app.kubernetes-namespace",
57+
"applyTo": [
58+
"install",
59+
"upgrade",
60+
"uninstall",
61+
"io.cnab.status"
62+
],
63+
"destination": {
64+
"env": "DOCKER_KUBERNETES_NAMESPACE"
65+
}
66+
},
67+
"com.docker.app.orchestrator": {
68+
"definition": "com.docker.app.orchestrator",
69+
"applyTo": [
70+
"install",
71+
"upgrade",
72+
"uninstall",
73+
"io.cnab.status"
74+
],
75+
"destination": {
76+
"env": "DOCKER_STACK_ORCHESTRATOR"
77+
}
78+
},
79+
"com.docker.app.render-format": {
80+
"definition": "com.docker.app.render-format",
81+
"applyTo": [
82+
"com.docker.app.render"
83+
],
84+
"destination": {
85+
"env": "DOCKER_RENDER_FORMAT"
86+
}
87+
},
88+
"com.docker.app.share-registry-creds": {
89+
"definition": "com.docker.app.share-registry-creds",
90+
"destination": {
91+
"env": "DOCKER_SHARE_REGISTRY_CREDS"
92+
}
93+
},
94+
"static_subdir": {
95+
"definition": "static_subdir",
96+
"destination": {
97+
"env": "docker_param2"
98+
}
99+
},
100+
"web_port": {
101+
"definition": "web_port",
102+
"destination": {
103+
"env": "docker_param3"
106104
}
107105
}
108106
},

e2e/testdata/cnab-parameters/bundle.json

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -23,30 +23,28 @@
2323
}
2424
},
2525
"parameters": {
26-
"fields": {
27-
"boolParam": {
28-
"definition": "boolParam_type",
29-
"destination": {
30-
"env": "BOOL_PARAM"
31-
}
32-
},
33-
"stringParam": {
34-
"definition": "stringParam_type",
35-
"destination": {
36-
"env": "STRING_PARAM"
37-
}
38-
},
39-
"intParam": {
40-
"definition": "intParam_type",
41-
"destination": {
42-
"env": "INT_PARAM"
43-
}
44-
},
45-
"floatParam": {
46-
"definition": "floatParam_type",
47-
"destination": {
48-
"env": "FLOAT_PARAM"
49-
}
26+
"boolParam": {
27+
"definition": "boolParam_type",
28+
"destination": {
29+
"env": "BOOL_PARAM"
30+
}
31+
},
32+
"stringParam": {
33+
"definition": "stringParam_type",
34+
"destination": {
35+
"env": "STRING_PARAM"
36+
}
37+
},
38+
"intParam": {
39+
"definition": "intParam_type",
40+
"destination": {
41+
"env": "INT_PARAM"
42+
}
43+
},
44+
"floatParam": {
45+
"definition": "floatParam_type",
46+
"destination": {
47+
"env": "FLOAT_PARAM"
5048
}
5149
}
5250
}

e2e/testdata/credential-install-bundle.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313
"env" :"SECRET_ONE"
1414
},
1515
"secret2": {
16-
"path": "/var/secret_two/data.txt"
16+
"path": "/var/secret_two/data.txt",
17+
"required": true
1718
},
1819
"secret3": {
1920
"env": "SECRET_THREE",
2021
"path": "/var/secret_three/data.txt"
2122
}
2223
}
2324
}
24-

e2e/testdata/simple-bundle.json.golden

Lines changed: 55 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -46,63 +46,61 @@
4646
"io.cnab.status": {}
4747
},
4848
"parameters": {
49-
"fields": {
50-
"api_host": {
51-
"definition": "api_host",
52-
"destination": {
53-
"env": "docker_param1"
54-
}
55-
},
56-
"com.docker.app.kubernetes-namespace": {
57-
"definition": "com.docker.app.kubernetes-namespace",
58-
"applyTo": [
59-
"install",
60-
"upgrade",
61-
"uninstall",
62-
"io.cnab.status"
63-
],
64-
"destination": {
65-
"env": "DOCKER_KUBERNETES_NAMESPACE"
66-
}
67-
},
68-
"com.docker.app.orchestrator": {
69-
"definition": "com.docker.app.orchestrator",
70-
"applyTo": [
71-
"install",
72-
"upgrade",
73-
"uninstall",
74-
"io.cnab.status"
75-
],
76-
"destination": {
77-
"env": "DOCKER_STACK_ORCHESTRATOR"
78-
}
79-
},
80-
"com.docker.app.render-format": {
81-
"definition": "com.docker.app.render-format",
82-
"applyTo": [
83-
"com.docker.app.render"
84-
],
85-
"destination": {
86-
"env": "DOCKER_RENDER_FORMAT"
87-
}
88-
},
89-
"com.docker.app.share-registry-creds": {
90-
"definition": "com.docker.app.share-registry-creds",
91-
"destination": {
92-
"env": "DOCKER_SHARE_REGISTRY_CREDS"
93-
}
94-
},
95-
"static_subdir": {
96-
"definition": "static_subdir",
97-
"destination": {
98-
"env": "docker_param2"
99-
}
100-
},
101-
"web_port": {
102-
"definition": "web_port",
103-
"destination": {
104-
"env": "docker_param3"
105-
}
49+
"api_host": {
50+
"definition": "api_host",
51+
"destination": {
52+
"env": "docker_param1"
53+
}
54+
},
55+
"com.docker.app.kubernetes-namespace": {
56+
"definition": "com.docker.app.kubernetes-namespace",
57+
"applyTo": [
58+
"install",
59+
"upgrade",
60+
"uninstall",
61+
"io.cnab.status"
62+
],
63+
"destination": {
64+
"env": "DOCKER_KUBERNETES_NAMESPACE"
65+
}
66+
},
67+
"com.docker.app.orchestrator": {
68+
"definition": "com.docker.app.orchestrator",
69+
"applyTo": [
70+
"install",
71+
"upgrade",
72+
"uninstall",
73+
"io.cnab.status"
74+
],
75+
"destination": {
76+
"env": "DOCKER_STACK_ORCHESTRATOR"
77+
}
78+
},
79+
"com.docker.app.render-format": {
80+
"definition": "com.docker.app.render-format",
81+
"applyTo": [
82+
"com.docker.app.render"
83+
],
84+
"destination": {
85+
"env": "DOCKER_RENDER_FORMAT"
86+
}
87+
},
88+
"com.docker.app.share-registry-creds": {
89+
"definition": "com.docker.app.share-registry-creds",
90+
"destination": {
91+
"env": "DOCKER_SHARE_REGISTRY_CREDS"
92+
}
93+
},
94+
"static_subdir": {
95+
"definition": "static_subdir",
96+
"destination": {
97+
"env": "docker_param2"
98+
}
99+
},
100+
"web_port": {
101+
"definition": "web_port",
102+
"destination": {
103+
"env": "docker_param3"
106104
}
107105
}
108106
},

internal/commands/parameters.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,15 +104,15 @@ func mergeBundleParameters(installation *store.Installation, ops ...mergeBundleO
104104
if err != nil {
105105
return err
106106
}
107-
installation.Parameters, err = bundle.ValuesOrDefaults(mergedValues, installation.Parameters, bndl)
107+
installation.Parameters, err = bundle.ValuesOrDefaults(mergedValues, bndl)
108108
return err
109109
}
110110

111-
func getParameterFromBundle(name string, bndl *bundle.Bundle) (bundle.ParameterDefinition, bool) {
111+
func getParameterFromBundle(name string, bndl *bundle.Bundle) (bundle.Parameter, bool) {
112112
if bndl.Parameters == nil {
113-
return bundle.ParameterDefinition{}, false
113+
return bundle.Parameter{}, false
114114
}
115-
param, found := bndl.Parameters.Fields[name]
115+
param, found := bndl.Parameters[name]
116116
return param, found
117117
}
118118

0 commit comments

Comments
 (0)