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

feat(image): adds method to create Associations from remote sources #342

Conversation

jpower432
Copy link
Contributor

@jpower432 jpower432 commented Mar 1, 2022

Signed-off-by: Jennifer Power barnabei.jennifer@gmail.com

Description

This PR adds methods to allow AssociationSet information to be gathered from local and remote sources.

Related to #302

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

  • Unit tests added for remote layer association collection

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 1, 2022
@openshift-ci openshift-ci bot requested review from afflom and deejross March 1, 2022 22:48
@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 1, 2022
@jpower432 jpower432 changed the title [WIP] feat(image): adds method to create Associations from remote sources feat(image): adds method to create Associations from remote sources Mar 2, 2022
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 2, 2022
Signed-off-by: Jennifer Power <barnabei.jennifer@gmail.com>
@jpower432 jpower432 force-pushed the feat/remote-association-gathering branch from 9080921 to 56b2a94 Compare March 2, 2022 20:07
@jpower432
Copy link
Contributor Author

cc @afflom this is ready for logic review

Copy link
Contributor

@afflom afflom left a comment

Choose a reason for hiding this comment

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

I was able to test this with m2d and d2m workflows. It works as advertised. Over to @deejross for code review.

@jpower432
Copy link
Contributor Author

jpower432 commented Mar 16, 2022

@soltysh PTAL (priority 1). Thanks!

@jpower432 jpower432 requested a review from soltysh March 16, 2022 18:00
@jpower432 jpower432 added the kind/feature Categorizes issue or PR as related to a new feature. label Mar 16, 2022
Copy link
Member

@soltysh soltysh left a comment

Choose a reason for hiding this comment

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

A couple of nits
/lgtm


skipParse := func(ref string) bool {
seen := bundleAssociations.SetContainsKey(ref)
return seen
Copy link
Member

Choose a reason for hiding this comment

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

Nit return bundleAssociations.SetContainsKey(ref) will be more readable.

func GetImageFromBlob(as AssociationSet, digest string) string {
for imageName, assocs := range as {
for _, assoc := range assocs {
for _, dgst := range assoc.LayerDigests {
Copy link
Member

Choose a reason for hiding this comment

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

Why not use AssociationSet#GetDigest instead of manually iterating over AssociaciationSet's?

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Mar 17, 2022
@openshift-ci
Copy link

openshift-ci bot commented Mar 17, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: afflom, jpower432, soltysh

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [afflom,jpower432,soltysh]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci
Copy link

openshift-ci bot commented Mar 17, 2022

@jpower432: all tests passed!

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@openshift-merge-robot openshift-merge-robot merged commit 3a9f99f into openshift:main Mar 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants