Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add applyTo to Credentials #407

Merged
merged 1 commit into from
Feb 19, 2021
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
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