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

CFE-956: [v2] feat: adds tags on the related images #695

Merged
merged 1 commit into from Sep 18, 2023

Conversation

aguidirh
Copy link
Contributor

Description

Before this implementation the related images were being stored only by digest. Now the related images are going to have a tag that is the 12 first chars of its digest.

Fixes # (issue)

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?

apiVersion: mirror.openshift.io/v1alpha2
kind: ImageSetConfiguration
mirror:
  operators:
    - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.12
      packages:
        - name: aws-load-balancer-operator
  additionalImages: 
    - name: registry.redhat.io/ubi8/ubi
    - name: registry.redhat.io/ubi9/ubi

MirrorToDisk

./bin/oc-mirror -c /home/aguidi/go/src/github.com/aguidirh/oc-mirror/alex-isc/isc.yaml file:///home/aguidi/go/src/github.com/aguidirh/oc-mirror/CFE-956-v2 --v2

DiskToMirror

./bin/oc-mirror -c /home/aguidi/go/src/github.com/aguidirh/oc-mirror/alex-isc/isc-additional-image.yaml --from /home/aguidi/go/src/github.com/aguidirh/oc-mirror/CFE-956-v2 docker://localhost:9000 --v2

One example of tags with the first 12 chars of the digest:

[aguidi@fedora oc-mirror]$ curl -X GET http://localhost:9000/v2/registry.redhat.io/albo/aws-load-balancer-controller-rhel8/tags/list | jq
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   124  100   124    0     0  25218      0 --:--:-- --:--:-- --:--:-- 31000
{
  "name": "registry.redhat.io/albo/aws-load-balancer-controller-rhel8",
  "tags": [
    "d7bc36451217",
    "cfd210a2cb70",
    "cad8f6380b4d"
  ]
}

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-robot
Copy link

openshift-ci-robot commented Sep 15, 2023

@aguidirh: This pull request references CFE-956 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the sub-task to target the "4.15.0" version, but no target version was set.

In response to this:

Description

Before this implementation the related images were being stored only by digest. Now the related images are going to have a tag that is the 12 first chars of its digest.

Fixes # (issue)

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?

apiVersion: mirror.openshift.io/v1alpha2
kind: ImageSetConfiguration
mirror:
 operators:
   - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.12
     packages:
       - name: aws-load-balancer-operator
 additionalImages: 
   - name: registry.redhat.io/ubi8/ubi
   - name: registry.redhat.io/ubi9/ubi

MirrorToDisk

./bin/oc-mirror -c /home/aguidi/go/src/github.com/aguidirh/oc-mirror/alex-isc/isc.yaml file:///home/aguidi/go/src/github.com/aguidirh/oc-mirror/CFE-956-v2 --v2

DiskToMirror

./bin/oc-mirror -c /home/aguidi/go/src/github.com/aguidirh/oc-mirror/alex-isc/isc-additional-image.yaml --from /home/aguidi/go/src/github.com/aguidirh/oc-mirror/CFE-956-v2 docker://localhost:9000 --v2

One example of tags with the first 12 chars of the digest:

[aguidi@fedora oc-mirror]$ curl -X GET http://localhost:9000/v2/registry.redhat.io/albo/aws-load-balancer-controller-rhel8/tags/list | jq
 % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                Dload  Upload   Total   Spent    Left  Speed
100   124  100   124    0     0  25218      0 --:--:-- --:--:-- --:--:-- 31000
{
 "name": "registry.redhat.io/albo/aws-load-balancer-controller-rhel8",
 "tags": [
   "d7bc36451217",
   "cfd210a2cb70",
   "cad8f6380b4d"
 ]
}

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

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.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Sep 15, 2023
Copy link
Contributor

@lmzuccarelli lmzuccarelli left a comment

Choose a reason for hiding this comment

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

great work @aguidirh 👍

v2/pkg/additional/new.go Show resolved Hide resolved
v2/pkg/additional/local_stored_collector.go Show resolved Hide resolved
v2/pkg/cli/executor.go Show resolved Hide resolved
v2/pkg/operator/local_stored_collector.go Show resolved Hide resolved
v2/pkg/operator/local_stored_collector.go Outdated Show resolved Hide resolved
@aguidirh aguidirh force-pushed the CFE-956 branch 2 times, most recently from 4f41b23 to c14d1b6 Compare September 18, 2023 08:05
@lmzuccarelli
Copy link
Contributor

/approve

@openshift-ci
Copy link

openshift-ci bot commented Sep 18, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: aguidirh, lmzuccarelli

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:

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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 18, 2023
Copy link
Contributor

@sherine-k sherine-k left a comment

Choose a reason for hiding this comment

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

Thanks Alex,
This clarifies the code by much and fixes this issue we've been having with pulling the images!

v2/pkg/additional/new.go Show resolved Hide resolved
v2/pkg/additional/local_stored_collector.go Show resolved Hide resolved
v2/pkg/operator/local_stored_collector.go Outdated Show resolved Hide resolved
v2/pkg/operator/local_stored_collector.go Outdated Show resolved Hide resolved
@openshift-ci
Copy link

openshift-ci bot commented Sep 18, 2023

@aguidirh: 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.

@aguidirh aguidirh changed the title CFE-956: feat: adds tags on the related images CFE-956: [v2] feat: adds tags on the related images Sep 18, 2023
@sherine-k
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Sep 18, 2023
@openshift-merge-robot openshift-merge-robot merged commit 01ad930 into openshift:main Sep 18, 2023
5 checks passed
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. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. 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

5 participants