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

Update bundle action commands to work with the installation record #1724

Merged

Conversation

carolynvs
Copy link
Member

@carolynvs carolynvs commented Aug 20, 2021

What does this change

Update bundle action commands to work with the installation record

Install now persists extra information to the installation record. The others, invoke, upgrade and uninstall all now load up the record and have the action work against that. Upgrade also now supports porter upgrade INSTALLATION --version. It will handle updating the installation to the desired version and then executing the bundle to get to that version.

Add ExtendedBundle Wrapper

This wraps the cnab-go bundle and adds support for custom extensions that porter supports. It will help us wean off of using the porter manifest at runtime, which is a huge problem because then our support for spec extensions only works when it was authored in Porter.

More work is needed to fix this, but this is just a refactoring to get the data in the right place, i.e. when we do pass around a bundle, it's a bundle that knows how to deal with extensions.

I am still saving a cnab bundle document so that if we change the structure of the wrapper it doesn't impact the stored document.

Include bundle reference and digest in the cache

We want to be able to compare the bundle digest provided during install with the digest of the bundle in the cache.

What issue does it fix

This is part of supporting a reconcile command in porter.

Notes for the reviewer

Checklist

  • Unit Tests
  • Documentation
  • Schema (porter.yaml)

@carolynvs carolynvs force-pushed the actions-edit-installation-record branch 2 times, most recently from 53cd8fe to 82994a9 Compare August 25, 2021 15:06
@carolynvs
Copy link
Member Author

/azp run porter-integration

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@carolynvs carolynvs force-pushed the actions-edit-installation-record branch 2 times, most recently from 84c7924 to 3033511 Compare August 25, 2021 21:09
We want to be able to compare the bundle digest provided during install
with the digest of the bundle in the cache.

Signed-off-by: Carolyn Van Slyck <[email protected]>
1. Persist additional installation metadata on install

* bundle digest
* bundle version
* user-specified parameters
* names of parameter and credential sets

2. Support changing the bundle version with upgrade --version

3. Update invoke and uninstall to use an installation record.

Signed-off-by: Carolyn Van Slyck <[email protected]>
Signed-off-by: Carolyn Van Slyck <[email protected]>
Signed-off-by: Carolyn Van Slyck <[email protected]>
@carolynvs carolynvs force-pushed the actions-edit-installation-record branch from 3033511 to fafa39e Compare August 26, 2021 18:57
@carolynvs carolynvs marked this pull request as ready for review August 26, 2021 18:58
@carolynvs
Copy link
Member Author

/azp run porter-integration

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@@ -8,7 +8,7 @@ import (

type BundlePullOptions struct {
Reference string
ref cnab.OCIReference
_ref *cnab.OCIReference
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious as to the _* naming convention for this field? I'm anticipating this is Golang knowledge I need to acquire :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was stealing from python's naming convention. Fields with an underscore shouldn't be used outside of the struct's own methods. It's just a way to indicate, hey if you found this via autocomplete, you probably shouldn't be using it.

It's a fake private field essentially since there's only exported/unexported at the package level but no concept of private. It really was just to help me refactor and not accidentally use it (since I was using that field elsewhere in the package previously).

@carolynvs carolynvs merged commit 26170ff into getporter:release/v1 Aug 27, 2021
@carolynvs carolynvs deleted the actions-edit-installation-record branch August 27, 2021 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants