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

Support running custom actions without installing the bundle #821

Closed
carolynvs opened this issue Dec 4, 2019 · 0 comments · Fixed by #828
Closed

Support running custom actions without installing the bundle #821

carolynvs opened this issue Dec 4, 2019 · 0 comments · Fixed by #828
Labels
cnab Related to the CNAB spec

Comments

@carolynvs
Copy link
Member

carolynvs commented Dec 4, 2019

The spec allows for executing a stateless custom action when a bundle is not installed.

The stateless field indicates that the runtime will bypass credentials requirements (the user MAY or MAY NOT pass any credentials), and will not keep track of this action. If credentials are supplied, the runtime SHOULD pass the credentials to the invocation image (as in stateful actions). An invocation image MAY exit with an error if the necessary credentials are not supplied. However, the runtime MUST NOT fail to invoke the invocation image because of missing credentials.

The primary intention of a stateless action is to allow invocation bundles to provide dry-run or detailed help functionalities. Stateless actions can be invoked on a non-existing installation. In this case, the name passed to the runtime need not exist, and MUST not result in the creation of a name record. Runtimes MAY ignore name if supplied.

However cnab-go is currently written to want a claim:

https://github.com/cnabio/cnab-go/blob/2fdc546bd3c7400a68b251c79831097fc1500c4d/action/run_custom.go#L30

Let's update Porter to make it work!

make it work

  • Allow running custom actions when there isn't a claim.
  • If the custom action is stateless, at the end of the action, a claim should not be persisted. Otherwise a claim should be persisted.
  • upgrade still requires install to be run first.
  • Since there is uncertainty about changing cnab-go's design (see related issues below), for this issue, let's workaround it's current design in Porter for now.

See related discussions in duffle-land

@carolynvs carolynvs added the cnab Related to the CNAB spec label Dec 4, 2019
@carolynvs carolynvs added this to Inbox in Porter and Mixins [OLD] via automation Dec 4, 2019
jeremyrickard added a commit to jeremyrickard/porter that referenced this issue Dec 10, 2019
Fixes: getporter#821

Signed-off-by: Jeremy Rickard <jeremy.rickard@microsoft.com>
Porter and Mixins [OLD] automation moved this from Inbox to Done Dec 12, 2019
jeremyrickard added a commit that referenced this issue Dec 12, 2019
…aim (#828)

* Update invoke logic to support running stateless actions without a claim

Fixes: #821

Signed-off-by: Jeremy Rickard <jeremy.rickard@microsoft.com>

* Update import

* Updated imports, addressed comments

Signed-off-by: Jeremy Rickard <jeremy.rickard@microsoft.com>
@vdice vdice removed this from Done in Porter and Mixins [OLD] Sep 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cnab Related to the CNAB spec
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant