Skip to content

Commit

Permalink
Merge pull request #407 from carolynvs/applyto-creds
Browse files Browse the repository at this point in the history
Add applyTo to Credentials
  • Loading branch information
carolynvs committed Feb 19, 2021
2 parents 93d8352 + 588984a commit 762e461
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
7 changes: 5 additions & 2 deletions 101-bundle-json.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,8 @@ What follows is an example of a thick bundle. Notice how the `invocationImage` a
"path":"/etc/hostkey.txt"
},
"image_token":{
"env":"AZ_IMAGE_TOKEN"
"env":"AZ_IMAGE_TOKEN",
"applyTo": ["install"]
},
"kubeconfig":{
"path":"/home/.kube/config"
Expand Down Expand Up @@ -701,7 +702,8 @@ What about parameters such as database passwords used by the application? Proper
},
"image_token": {
"env": "AZ_IMAGE_TOKEN",
"required": true
"required": true,
"applyTo": ["install"]
},
"kubeconfig": {
"path": "/home/.kube/config"
Expand All @@ -712,6 +714,7 @@ What about parameters such as database passwords used by the application? Proper

- The `credentials` container is a map of human-friendly credential names to a description of where the invocation image expects to find them.
- The name key MUST be human-readable
- `applyTo`: restricts this credential to a given list of actions. If empty or missing, applies to all actions (OPTIONAL).
- `path` describes the _absolute path within the invocation image_ where the invocation image expects to find the credential. Specified path MUST NOT be a subpath of `/cnab/app/outputs`.
- `env` contains _the name of an environment variable_ that the invocation image expects to have available when executing the CNAB `run` tool (covered in the next section).
- `description` contains a user-friendly description of the credential.
Expand Down
3 changes: 2 additions & 1 deletion examples/101.02-bundle.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"path": "/etc/hostkey.txt"
},
"image_token": {
"env": "AZ_IMAGE_TOKEN"
"env": "AZ_IMAGE_TOKEN",
"applyTo": ["install"]
},
"kubeconfig": {
"path": "/home/.kube/config"
Expand Down
7 changes: 7 additions & 0 deletions schema/bundle.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@
"description": "A user-friendly description of this credential",
"type": "string"
},
"applyTo": {
"description": "An optional exhaustive list of actions handling this credential",
"items": {
"type": "string"
},
"type": "array"
},
"env": {
"description": "The environment variable name, such as MY_VALUE, into which the credential will be placed",
"type": "string"
Expand Down

0 comments on commit 762e461

Please sign in to comment.