-
Notifications
You must be signed in to change notification settings - Fork 214
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 state section to porter.yaml #1743
Conversation
4805848
to
eda56ee
Compare
/azp run porter-integration |
Azure Pipelines successfully started running 1 pipeline(s). |
Allow bundle authors to flag files as "state" that should be persisted by the bundle, but not exposed to the user (like a parameter or output is). Signed-off-by: Carolyn Van Slyck <me@carolynvanslyck.com>
Signed-off-by: Carolyn Van Slyck <me@carolynvanslyck.com>
Some outputs and parameters are really porter "plumbing". They are used by porter to implement things, like state or persistent parameters, but aren't intended to be set or used by the end-user. When we print out how to use a bundle with porter explain, those shoudn't be displayed. * Parameters with sources - these will be set by Porter internally. * Outputs and Parameters that support bundle state. Signed-off-by: Carolyn Van Slyck <me@carolynvanslyck.com>
/azp run porter-integration |
Azure Pipelines successfully started running 1 pipeline(s). |
Allow integration tests to also use run commands using the porter CLI. Signed-off-by: Carolyn Van Slyck <me@carolynvanslyck.com>
Signed-off-by: Carolyn Van Slyck <me@carolynvanslyck.com>
Signed-off-by: Carolyn Van Slyck <me@carolynvanslyck.com>
Signed-off-by: Carolyn Van Slyck <me@carolynvanslyck.com>
/azp run porter |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run porter-integration |
Azure Pipelines successfully started running 1 pipeline(s). |
@@ -179,7 +181,7 @@ func (c *ManifestConverter) generateBundleParameters(defs *definition.Definition | |||
if !param.Destination.IsEmpty() { | |||
p.Destination = &bundle.Location{ | |||
EnvironmentVariable: param.Destination.EnvironmentVariable, | |||
Path: param.Destination.Path, | |||
Path: manifest.ResolvePath(param.Destination.Path), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In a follow-up PR I want to use this function so that people can use relative paths not just for the state files, but for params and creds. That way we should see a lot less of hard-coding absolute paths like /cnab/app/mystuff, when they just use "mystuff" and assume that everything is relative to the bundle directory.
@@ -59,7 +59,7 @@ func TestPorter_Build(t *testing.T) { | |||
|
|||
stamp, err := configadapter.LoadStamp(bun) | |||
require.NoError(t, err) | |||
assert.Equal(t, "d421a6249dfbdba79e26e866da7533d59590565708dfdb32423cf989f588d0ea", stamp.ManifestDigest) | |||
assert.NotEmpty(t, stamp.ManifestDigest) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've gotten super tired of checking and updating the exact manifest digest. We just update it every time we tweak the bundle which isn't helpful.
} | ||
|
||
// TODO(carolynvs): hack around parameters ALWAYS being injected even when empty files mess things up |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I logged a bug against cnab-go cnabio/cnab-go#266 and will work on fixing this after I get this stuff in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome UX improvement with these changes! LGTM.
pkg/runtime/runtime-manifest.go
Outdated
return bigErr.ErrorOrNil() | ||
} | ||
|
||
// applyUnboundBundleOutputs find outputs that haven't been bound yet by a step, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// applyUnboundBundleOutputs find outputs that haven't been bound yet by a step, | |
// applyUnboundBundleOutputs finds outputs that haven't been bound yet by a step, |
What does this change
Allow bundle authors to flag files as "state" that should be persisted by the bundle, but not exposed to the user (like a parameter or output is).
Allow file parameters to be optional. When injecting a parameter into the bundle and the type is "file" do not inject the word null into the file in the bundle, omit it. I have an open issue to correct this in upstream cnab-go Optional parameters are not injected properly cnabio/cnab-go#266.
Hide porter internal from explain command. Some outputs and parameters are really porter "plumbing". They are used by porter to implement things, like state or persistent parameters, but aren't intended to be set or used by the end-user.
When we print out how to use a bundle with porter explain, those shouldn't be displayed.
What issue does it fix
Implements the new state section proposed in #1672.
Notes for the reviewer
Preview of the state docs @ https://deploy-preview-1743--porter.netlify.app/author-bundles/#state
Checklist