-
Notifications
You must be signed in to change notification settings - Fork 213
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
Do not assume that all bundles have a supported porter.yaml file #1974
Merged
carolynvs
merged 3 commits into
getporter:release/v1
from
carolynvs:remove-manifest-from-cache
Mar 16, 2022
Merged
Do not assume that all bundles have a supported porter.yaml file #1974
carolynvs
merged 3 commits into
getporter:release/v1
from
carolynvs:remove-manifest-from-cache
Mar 16, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
It's important that we should be able to pull a bundle and fall back to working with it as a vanilla cnab bundle when it was built with an unsupported porter version. This removes trying to load the manifest from the bundle cache and each calling command will need to decide how to gracefully handle the bundle it pulls from the cache (i.e. some commands have to require a supported version, like build, but others like install can still work without a manifest). Signed-off-by: Carolyn Van Slyck <[email protected]>
b5f7957
to
8a0bcdc
Compare
/azp run porter-integration |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run porter-integration |
Azure Pipelines successfully started running 1 pipeline(s). |
The porter struct has always had a Manifest field that is great at causing nil pointer exceptions because it's essentially a global variable and not all code paths populate it. Since we need to support bundles that may not be able to populate a manifest, i.e. it's an unsupported manifest schema, or a vanilla CNAB bundle, I've removed it and made any commands that need the manifest to load it themselves instead of relying on this global. Signed-off-by: Carolyn Van Slyck <[email protected]>
Signed-off-by: Carolyn Van Slyck <[email protected]>
844b521
to
9302eb6
Compare
vdice
approved these changes
Mar 16, 2022
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.
LGTM
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this change
These are changes necessary to have
porter explain
andporter inspect
work with bundles created with an unsupported porter version.Do not require a supported porter.yaml file in the bundle cache
It's important that we should be able to pull a bundle and fall back to working with it as a vanilla cnab bundle when it was built with an unsupported porter version. This removes trying to load the manifest from the bundle cache and each calling command will need to decide how to gracefully handle the bundle it pulls from the cache (i.e. some commands have to require a supported version, like build, but others like install can still work without a manifest).
Remove Porter.Manifest field
The porter struct has always had a Manifest field that is great at causing nil pointer exceptions (which is why I also fixed Porter to print out panic stack traces) because it's essentially a global variable and not all code paths populate it.
Since we need to support bundles that may not be able to populate a manifest, i.e. it's an unsupported manifest schema, or a vanilla CNAB bundle, I've removed it and made any commands that need the manifest to load it themselves instead of relying on this global.
What issue does it fix
Part of #1956
Notes for the reviewer
N/A
Checklist
Reviewer Checklist