-
Notifications
You must be signed in to change notification settings - Fork 212
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
Resolve bundle digests when DepV2 is enabled #3071
Conversation
Signed-off-by: Kim Christensen <[email protected]>
func (p *Porter) resolveDependencyDigest(ctx context.Context, e *yaml.Editor, opts cnabtooci.RegistryOptions) error { | ||
// find all referenced dependencies that does not have digest specified | ||
// get the digest for all of them and update the manifest with the digest | ||
return e.WalkNodes(ctx, "dependencies.requires.*", func(ctx context.Context, nc *yqlib.NodeContext) error { |
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.
My only concern is
- Should we resolve dependencies that aren't required (I feel yes?) - and:
- Are there any concerns with this and "shared dependencies", where the dependency is already installed and running (I think this should be okay)
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'm not sure I fully understand what you mean with "dependencies not required"
- I think it should be okay too, but I will create a test to verify it. It makes sense long term anyway
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.
@schristoff Number 2 Should be covered by the existing integration for shared dependencies,
func TestSharedDependencies(t *testing.T) { |
Do you agree?
return e.WriteFile(build.LOCAL_MANIFEST) | ||
} | ||
|
||
func (p *Porter) resolveDependencyDigest(ctx context.Context, e *yaml.Editor, opts cnabtooci.RegistryOptions) error { |
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.
Could this be reworked to leverage existing dependency resolution logic? - moving this into "validate" logic may help us reduce LOC and improve efficiency :)
}) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
if p.IsFeatureEnabled(experimental.FlagDependenciesV2) { |
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.
Same as below (?) - I would love to see this moved into here - we can use this too :)
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.
Thank you for working on this. I've taken a stab at it before but would get sidetracked. I would love to see it using the validate() logic, which makes this a little straightforward but long term could improve efficiency and be more "predictable" in placement.
@schristoff Are you suggesting to use |
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.
We've have a lot of conversations about this, but ultimately my forgetfulness has been holding this PR up. Let's just merge it and if I ever remember, I can refactor.
What does this change
When Dependencies V2 is enable bundle dependencies with a default bundle reference will be resolved to digests.
What issue does it fix
Closes #2676
Notes for the reviewer
Checklist