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

[release-4.12] OCPBUGS-14065: Fix destination image reference #650

Merged

Conversation

lmzuccarelli
Copy link
Contributor

Description

This is a fix for the change to --max-nested-paths implementation. The image reference was incorrect. This addresses the fix.

Fixes # OCPBUGS-14065

Type of change

  • [x ] 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?

Tested locally

ImageSetConfig

kind: ImageSetConfiguration
apiVersion: mirror.openshift.io/v1alpha2
storageConfig:
  local:
    path: ./oc-mirror-metadata
mirror:
  operators:
  - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.12
    packages:
    - name: local-storage-operator
      channels:
      - name: stable

Cli

oc-mirror --config isc-ocpbugs-14065.yaml docker://localhost:5000/lmz-test --max-nested-paths=2 --dest-use-http

Results

  • mapping.txt
registry.redhat.io/openshift4/ose-kube-rbac-proxy@sha256:116dbeb371324607d361d4f1a9daeb5890e44d29b96c9800b2b1d93d21635dec=localhost:5000/lmz-test/openshift4-ose-kube-rbac-proxy:ec31b7f8
registry.redhat.io/openshift4/ose-local-storage-diskmaker@sha256:398414dc2abad094c2e97a57514d69d5c80790510e19af105692f2864cc9c566=localhost:5000/lmz-test/openshift4-ose-local-storage-diskmaker:df3814e9
registry.redhat.io/openshift4/ose-local-storage-operator@sha256:5f01648146118a5c156733f174addf7f64b794b1edda8e237fb42cb353222102=localhost:5000/lmz-test/openshift4-ose-local-storage-operator:d7f3b07
registry.redhat.io/openshift4/ose-local-storage-operator-bundle@sha256:56386aaf90d66683b384a49b052f8b2ed7f969ef47d83b7e76badf2ddf5339e1=localhost:5000/lmz-test/openshift4-ose-local-storage-operator-bundle:3dbae7c1
registry.redhat.io/redhat/redhat-operator-index:v4.12=localhost:5000/lmz-test/redhat/redhat-operator-index:v4.12
  • imageContentSourcePolicy,yaml
---
apiVersion: operator.openshift.io/v1alpha1
kind: ImageContentSourcePolicy
metadata:
  labels:
    operators.openshift.org/catalog: "true"
  name: operator-0
spec:
  repositoryDigestMirrors:
  - mirrors:
    - localhost:5000/lmz-test/openshift4-ose-local-storage-operator
    source: registry.redhat.io/openshift4/ose-local-storage-operator
  - mirrors:
    - localhost:5000/lmz-test/openshift4-ose-local-storage-operator-bundle
    source: registry.redhat.io/openshift4/ose-local-storage-operator-bundle
  - mirrors:
    - localhost:5000/lmz-test/redhat/redhat-operator-index
    source: registry.redhat.io/redhat/redhat-operator-index
  - mirrors:
    - localhost:5000/lmz-test/openshift4-ose-kube-rbac-proxy
    source: registry.redhat.io/openshift4/ose-kube-rbac-proxy
  - mirrors:
    - localhost:5000/lmz-test/openshift4-ose-local-storage-diskmaker
    source: registry.redhat.io/openshift4/ose-local-storage-diskmaker
  • registry list (local docker registry server)
{
  "repositories": [
    "lmz-test/openshift4-ose-kube-rbac-proxy",
    "lmz-test/openshift4-ose-local-storage-diskmaker",
    "lmz-test/openshift4-ose-local-storage-operator",
    "lmz-test/openshift4-ose-local-storage-operator-bundle",
    "lmz-test/redhat/redhat-operator-index"
  ]
}

As can be seen with max nested paths the change is:

lmz-test/openshift4/ose-local-storage... => lmz-test/openshift4-ose-local-storage...

(slash "/" gets converted to "-" after namespace "lmz-test")

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 openshift-ci-robot added jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. labels May 30, 2023
@openshift-ci-robot
Copy link

@lmzuccarelli: This pull request references Jira Issue OCPBUGS-14065, which is valid. The bug has been moved to the POST state.

6 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.12.z) matches configured target version for branch (4.12.z)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, POST)
  • dependent bug Jira Issue OCPBUGS-13591 is in the state Verified, which is one of the valid states (VERIFIED, RELEASE PENDING, CLOSED (ERRATA), CLOSED (CURRENT RELEASE), CLOSED (DONE))
  • dependent Jira Issue OCPBUGS-13591 targets the "4.13.0" version, which is one of the valid target versions: 4.13.0, 4.13.z
  • bug has dependents

Requesting review from QA contact:
/cc @zhouying7780

The bug has been updated to refer to the pull request using the external bug tracker.

In response to this:

Description

This is a fix for the change to --max-nested-paths implementation. The image reference was incorrect. This addresses the fix.

Fixes # OCPBUGS-14065

Type of change

  • [x ] 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?

Tested locally

ImageSetConfig

kind: ImageSetConfiguration
apiVersion: mirror.openshift.io/v1alpha2
storageConfig:
 local:
   path: ./oc-mirror-metadata
mirror:
 operators:
 - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.12
   packages:
   - name: local-storage-operator
     channels:
     - name: stable

Cli

oc-mirror --config isc-ocpbugs-14065.yaml docker://localhost:5000/lmz-test --max-nested-paths=2 --dest-use-http

Results

  • mapping.txt
registry.redhat.io/openshift4/ose-kube-rbac-proxy@sha256:116dbeb371324607d361d4f1a9daeb5890e44d29b96c9800b2b1d93d21635dec=localhost:5000/lmz-test/openshift4-ose-kube-rbac-proxy:ec31b7f8
registry.redhat.io/openshift4/ose-local-storage-diskmaker@sha256:398414dc2abad094c2e97a57514d69d5c80790510e19af105692f2864cc9c566=localhost:5000/lmz-test/openshift4-ose-local-storage-diskmaker:df3814e9
registry.redhat.io/openshift4/ose-local-storage-operator@sha256:5f01648146118a5c156733f174addf7f64b794b1edda8e237fb42cb353222102=localhost:5000/lmz-test/openshift4-ose-local-storage-operator:d7f3b07
registry.redhat.io/openshift4/ose-local-storage-operator-bundle@sha256:56386aaf90d66683b384a49b052f8b2ed7f969ef47d83b7e76badf2ddf5339e1=localhost:5000/lmz-test/openshift4-ose-local-storage-operator-bundle:3dbae7c1
registry.redhat.io/redhat/redhat-operator-index:v4.12=localhost:5000/lmz-test/redhat/redhat-operator-index:v4.12
  • imageContentSourcePolicy,yaml
---
apiVersion: operator.openshift.io/v1alpha1
kind: ImageContentSourcePolicy
metadata:
 labels:
   operators.openshift.org/catalog: "true"
 name: operator-0
spec:
 repositoryDigestMirrors:
 - mirrors:
   - localhost:5000/lmz-test/openshift4-ose-local-storage-operator
   source: registry.redhat.io/openshift4/ose-local-storage-operator
 - mirrors:
   - localhost:5000/lmz-test/openshift4-ose-local-storage-operator-bundle
   source: registry.redhat.io/openshift4/ose-local-storage-operator-bundle
 - mirrors:
   - localhost:5000/lmz-test/redhat/redhat-operator-index
   source: registry.redhat.io/redhat/redhat-operator-index
 - mirrors:
   - localhost:5000/lmz-test/openshift4-ose-kube-rbac-proxy
   source: registry.redhat.io/openshift4/ose-kube-rbac-proxy
 - mirrors:
   - localhost:5000/lmz-test/openshift4-ose-local-storage-diskmaker
   source: registry.redhat.io/openshift4/ose-local-storage-diskmaker
  • registry list (local docker registry server)
{
 "repositories": [
   "lmz-test/openshift4-ose-kube-rbac-proxy",
   "lmz-test/openshift4-ose-local-storage-diskmaker",
   "lmz-test/openshift4-ose-local-storage-operator",
   "lmz-test/openshift4-ose-local-storage-operator-bundle",
   "lmz-test/redhat/redhat-operator-index"
 ]
}

As can be seen with max nested paths the change is:

lmz-test/openshift4/ose-local-storage... => lmz-test/openshift4-ose-local-storage...

(slash "/" gets converted to "-" after namespace "lmz-test")

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 openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 30, 2023
@lmzuccarelli
Copy link
Contributor Author

/assign @sherine-k

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.

/lgtm
/approve

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label May 30, 2023
@kasturinarra
Copy link

Followed steps below to verify the bug here:

  1. clone oc-mirror repo
  2. git checkout release-4.12
  3. gh pr checkout 650
  4. make build
  5. use the command ./oc-mirror --config /tmp/config.yaml docker://quay.io/knarra --max-nested-paths=2 push local-storage-operator to quay.io and see that / is replaced with - in registry as well as in ICSP file & mapping.txt
    Screenshot from 2023-05-30 23-56-54
  6. use the command ./oc-mirror --config /tmp/config.yaml docker://ec2-18-217-140-54.us-east-2.compute.amazonaws.com:5000/knarra/mynamespace --max-nested-paths=3 --dest-skip-tls to push local-storage-operator to a registry in the aws disconnected cluster and verify that / is replaced with - in registry as well as in ICSP file & mapping.txt
  7. Run the command below to witness the same in the registry too curl -X GET -u <username>:<pwd> https://ec2-18-217-140-54.us-east-2.compute.amazonaws.com:5000/v2/_catalog --insecure | jq
{
  "repositories": [
    "knarra/mynamespace/openshift4-ose-kube-rbac-proxy",
    "knarra/mynamespace/openshift4-ose-local-storage-diskmaker",
    "knarra/mynamespace/openshift4-ose-local-storage-operator",
    "knarra/mynamespace/openshift4-ose-local-storage-operator-bundle",
    "knarra/mynamespace/openshifttest-bench-army-knife",
    "knarra/mynamespace/redhat/redhat-operator-index",
    "openshift-qe-optional-operators/aosqe-index",
    "openshift-release-dev/ocp-release",
    "openshifttest/minio",
    "openshifttest/osus-graph-data-container",
    "rhel8/httpd-24",
    "rhel8/mysql-80",
    "rhscl/mysql-80-rhel7",
    "rhscl/ruby-25-rhel7",
    "ubi7/ruby-27",
    "ubi8/ruby-27",
    "ubi8/ruby-30"
  ]
}
  1. copy ImageContentSourcePolicy.yaml and catalogsource.yaml to the disconnected cluster, run commands to create icsp & catalogsource using these files
  2. Now browse through UI and install LSO operator, verify that it gets installed.

@kasturinarra
Copy link

/lgtm

@kasturinarra
Copy link

/label qe-approved

@openshift-ci openshift-ci bot added the qe-approved Signifies that QE has signed off on this PR label May 30, 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.

/label backport-risk-assessed

@openshift-ci openshift-ci bot added the backport-risk-assessed Indicates a PR to a release branch has been evaluated and considered safe to accept. label May 31, 2023
@openshift-ci
Copy link

openshift-ci bot commented May 31, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lmzuccarelli, sherine-k

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 [lmzuccarelli,sherine-k]

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

@kasturinarra
Copy link

/label cherry-pick-approved

@openshift-ci openshift-ci bot added the cherry-pick-approved Indicates a cherry-pick PR into a release branch has been approved by the release branch manager. label May 31, 2023
@openshift-ci
Copy link

openshift-ci bot commented May 31, 2023

@lmzuccarelli: 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 3ac49d9 into openshift:release-4.12 May 31, 2023
5 checks passed
@openshift-ci-robot
Copy link

@lmzuccarelli: Jira Issue OCPBUGS-14065: All pull requests linked via external trackers have merged:

Jira Issue OCPBUGS-14065 has been moved to the MODIFIED state.

In response to this:

Description

This is a fix for the change to --max-nested-paths implementation. The image reference was incorrect. This addresses the fix.

Fixes # OCPBUGS-14065

Type of change

  • [x ] 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?

Tested locally

ImageSetConfig

kind: ImageSetConfiguration
apiVersion: mirror.openshift.io/v1alpha2
storageConfig:
 local:
   path: ./oc-mirror-metadata
mirror:
 operators:
 - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.12
   packages:
   - name: local-storage-operator
     channels:
     - name: stable

Cli

oc-mirror --config isc-ocpbugs-14065.yaml docker://localhost:5000/lmz-test --max-nested-paths=2 --dest-use-http

Results

  • mapping.txt
registry.redhat.io/openshift4/ose-kube-rbac-proxy@sha256:116dbeb371324607d361d4f1a9daeb5890e44d29b96c9800b2b1d93d21635dec=localhost:5000/lmz-test/openshift4-ose-kube-rbac-proxy:ec31b7f8
registry.redhat.io/openshift4/ose-local-storage-diskmaker@sha256:398414dc2abad094c2e97a57514d69d5c80790510e19af105692f2864cc9c566=localhost:5000/lmz-test/openshift4-ose-local-storage-diskmaker:df3814e9
registry.redhat.io/openshift4/ose-local-storage-operator@sha256:5f01648146118a5c156733f174addf7f64b794b1edda8e237fb42cb353222102=localhost:5000/lmz-test/openshift4-ose-local-storage-operator:d7f3b07
registry.redhat.io/openshift4/ose-local-storage-operator-bundle@sha256:56386aaf90d66683b384a49b052f8b2ed7f969ef47d83b7e76badf2ddf5339e1=localhost:5000/lmz-test/openshift4-ose-local-storage-operator-bundle:3dbae7c1
registry.redhat.io/redhat/redhat-operator-index:v4.12=localhost:5000/lmz-test/redhat/redhat-operator-index:v4.12
  • imageContentSourcePolicy,yaml
---
apiVersion: operator.openshift.io/v1alpha1
kind: ImageContentSourcePolicy
metadata:
 labels:
   operators.openshift.org/catalog: "true"
 name: operator-0
spec:
 repositoryDigestMirrors:
 - mirrors:
   - localhost:5000/lmz-test/openshift4-ose-local-storage-operator
   source: registry.redhat.io/openshift4/ose-local-storage-operator
 - mirrors:
   - localhost:5000/lmz-test/openshift4-ose-local-storage-operator-bundle
   source: registry.redhat.io/openshift4/ose-local-storage-operator-bundle
 - mirrors:
   - localhost:5000/lmz-test/redhat/redhat-operator-index
   source: registry.redhat.io/redhat/redhat-operator-index
 - mirrors:
   - localhost:5000/lmz-test/openshift4-ose-kube-rbac-proxy
   source: registry.redhat.io/openshift4/ose-kube-rbac-proxy
 - mirrors:
   - localhost:5000/lmz-test/openshift4-ose-local-storage-diskmaker
   source: registry.redhat.io/openshift4/ose-local-storage-diskmaker
  • registry list (local docker registry server)
{
 "repositories": [
   "lmz-test/openshift4-ose-kube-rbac-proxy",
   "lmz-test/openshift4-ose-local-storage-diskmaker",
   "lmz-test/openshift4-ose-local-storage-operator",
   "lmz-test/openshift4-ose-local-storage-operator-bundle",
   "lmz-test/redhat/redhat-operator-index"
 ]
}

As can be seen with max nested paths the change is:

lmz-test/openshift4/ose-local-storage... => lmz-test/openshift4-ose-local-storage...

(slash "/" gets converted to "-" after namespace "lmz-test")

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

Fix included in accepted release 4.12.0-0.nightly-2023-05-31-232541

@lmzuccarelli lmzuccarelli deleted the OCPBUGS-14065 branch August 7, 2023 13:56
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. backport-risk-assessed Indicates a PR to a release branch has been evaluated and considered safe to accept. cherry-pick-approved Indicates a cherry-pick PR into a release branch has been approved by the release branch manager. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. 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. qe-approved Signifies that QE has signed off on this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants