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-764 : Introduce v1alpha2.Operator.TargetCatalog #565

Merged
merged 2 commits into from Feb 28, 2023

Conversation

sherine-k
Copy link
Contributor

@sherine-k sherine-k commented Feb 21, 2023

TargetCatalog can contain several component-paths, allowing the user to set the namespace to which the catalog will be copied.

It will later replace TargetName.

Changes to be committed:
modified: pkg/api/v1alpha2/types_config.go
new file: pkg/api/v1alpha2/types_config_test.go
modified: pkg/cli/mirror/fbc_operators.go
modified: pkg/cli/mirror/fbc_operators_test.go
modified: pkg/cli/mirror/manifests.go

Description

See https://issues.redhat.com/browse/CFE-764?filter=-1 for relevant motivation and context.

Fixes # CFE-764

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

Changes in GetUniqueName and ICSP generation (determining namespace scope of mirrored images) have been changed for catalogs. This might have impacts on the way images are mirrored or contents of ICSP.

How Has This Been Tested?

  • Simple flow - cmd1, IMSTCFG=imstcfg1.yaml
  • Simple flow with namespace - cmd2, IMSTCFG=imstcfg1.yaml
  • Simple flow with TargetCatalog - cmd1, IMSTCFG=imstcfg2.yaml
  • OCI FBC flow - cmd1, IMSTCFG=imstcfg3.yaml
  • OCI FBC flow with namespace - cmd2, IMSTCFG=imstcfg3.yaml

PS: /tmp/storageBackend was cleaned after each test. Otherwise, an issue was found reading the metadata. This didn't seem related to the PR, and we think will be fixed with #564

Test Configuration:

  • command lines
Name Command
cmd1 ./bin/oc-mirror -c $IMSTCFG docker://localhost:5000 --dest-skip-tls --dest-use-http --use-oci-feature
cmd2 ./bin/oc-mirror -c $IMSTCFG docker://localhost:5000/test-namespace --dest-skip-tls --dest-use-http --use-oci-feature
  • imstcfg1.yaml:
kind: ImageSetConfiguration
apiVersion: mirror.openshift.io/v1alpha2
storageConfig:
  local:
    path: /tmp/storageBackend
mirror:
  operators:
  - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.12
    packages:
    - name: aws-load-balancer-operator
  • imstcfg2.yaml:
kind: ImageSetConfiguration
apiVersion: mirror.openshift.io/v1alpha2
storageConfig:
  local:
    path: /tmp/storageBackend
mirror:
  operators:
  - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.12
    targetCatalog: abc/redhat-operator-index
    packages:
    - name: aws-load-balancer-operator
  • imstcfg3.yaml:
kind: ImageSetConfiguration
apiVersion: mirror.openshift.io/v1alpha2
storageConfig:
  local:
    path: /tmp/storageBackend
mirror:
  operators:
  - catalog: oci:///home/skhoury/oci-catalog2
    targetCatalog: mno/redhat-operator-index
    targetTag: v4.12
     packages:
    - name: aws-load-balancer-operator

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

@zhouying7780
Copy link

pre-merge test done, no issue found

@zhouying7780
Copy link

/label qe-approved

@openshift-ci openshift-ci bot added the qe-approved Signifies that QE has signed off on this PR label Feb 23, 2023
@sherine-k
Copy link
Contributor Author

/assign @jchunkins
/assign @lmzuccarelli

@lmzuccarelli
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Feb 23, 2023
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.

/approve

@openshift-ci
Copy link

openshift-ci bot commented Feb 27, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sherine-k, 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:

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 Feb 27, 2023
…rgetName

TargetCatalog can contain several component-paths, allowing the user to set the namespace to which the catalog will be copied.
Changes to be committed:
	modified:   pkg/api/v1alpha2/types_config.go
	new file:   pkg/api/v1alpha2/types_config_test.go
	modified:   pkg/cli/mirror/fbc_operators.go
	modified:   pkg/cli/mirror/fbc_operators_test.go
	modified:   pkg/cli/mirror/manifests.go
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Feb 27, 2023
@openshift-ci
Copy link

openshift-ci bot commented Feb 27, 2023

@sherine-k: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test e2e
  • /test images
  • /test sanity
  • /test unit

The following commands are available to trigger optional jobs:

  • /test integration

Use /test all to run the following jobs that were automatically triggered:

  • pull-ci-openshift-oc-mirror-main-e2e
  • pull-ci-openshift-oc-mirror-main-images
  • pull-ci-openshift-oc-mirror-main-sanity
  • pull-ci-openshift-oc-mirror-main-unit

In response to this:

/test ci/prow/images

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.

@sherine-k
Copy link
Contributor Author

/test images

@openshift-ci
Copy link

openshift-ci bot commented Feb 28, 2023

@sherine-k: 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.

@lmzuccarelli
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Feb 28, 2023
@openshift-merge-robot openshift-merge-robot merged commit 7534b8a into openshift:main Feb 28, 2023
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. 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