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

OCPBUGS-23340: Add generation of updateService.yaml #746

Merged
merged 1 commit into from Dec 11, 2023

Conversation

sherine-k
Copy link
Contributor

@sherine-k sherine-k commented Dec 1, 2023

Description

The updateservice custom resource instructs a cluster to use the graph image generated by oc-mirror when it encounters the release image specified in the custom resource.

This PR does the following changes:

  • Adds UpdateServiceGenerator to the GeneratorInterface
  • Adds the UpdateService custom resource schema directly to package v2/pkg/clusterresources/updateservice/v1 instead of importing github.com/openshift/cincinnati-operator/ : the last official release v1.0.3 doesn't include the api/v1
  • Simplifies the IDMSGenerator method
  • Adds GraphImage and ReleaseImage methods to the release's CollectorInterface
    • These methods can be used by Executor during the DiskToMirror workflow, so that Executor can provide both images to the GeneratorInterface in order to create the updateservice.yaml
  • Update the Executor DiskToMirror workflow, in order to generate the custom resource updateservice.yaml if graph is true in the ImageSetConfig
    • The filename was chosen in order to match the one generated in V1

Fixes OCPBUGS-23340

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?

With the following ImageSetConfig, run the MirrorToDisk, followed by DiskToMirror:

$ ./bin/oc-mirror --v2 -c cfe-969.yml file:///home/skhoury/release 
$ ./bin/oc-mirror --v2 -c cfe-969.yml --from file:///home/skhoury/release docker://localhost:5000 --dest-tls-verify=false

Next check the /home/skhoury/release/working-dir/cluster-resources/updateService.yaml

kind: ImageSetConfiguration
apiVersion: mirror.openshift.io/v1alpha2
mirror:
  platform:
    channels:
    - name: stable-4.14
      minVersion: 4.14.2
      maxVersion: 4.14.2
    graph: true
  operators:
  - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.14
    packages:
    - name: aws-load-balancer-operator
  additionalImages:
  - name: registry.redhat.io/ubi8/ubi:latest

Expected Outcome

apiVersion: updateservice.operator.openshift.io/v1
kind: UpdateService
metadata:
  name: update-service-oc-mirror
spec:
  graphDataImage: localhost:55000/openshift/graph-image:latest
  releases: quay.io/openshift-release-dev/ocp-release
  replicas: 2
status: {}

@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 Dec 1, 2023
@openshift-ci-robot
Copy link

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

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.15.0) matches configured target version for branch (4.15.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, POST)

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

The updateservice custom resource instructs a cluster to use the graph image generated by oc-mirror when it encounters the release image specified in the custom resource.

This PR does the following changes:

  • Adds UpdateServiceGenerator to the GeneratorInterface
  • Adds the UpdateService custom resource schema directly to package v2/pkg/clusterresources/updateservice/v1 instead of importing github.com/openshift/cincinnati-operator/ : the last official release v1.0.3 doesn't include the api/v1
  • Adds GraphImage and ReleaseImage methods to the release's CollectorInterface
  • These methods can be used by Executor during the DiskToMirror workflow, so that Executor can provide both images to the GeneratorInterface in order to create the updateservice.yaml
  • Update the Executor DiskToMirror workflow, in order to generate the custom resource updateservice.yaml if graph is true in the ImageSetConfig
  • The filename was chosen in order to match the one generated in V1

Fixes OCPBUGS-23340

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?

With the following ImageSetConfig, run the MirrorToDisk, followed by DiskToMirror:

$ ./bin/oc-mirror --v2 -c cfe-969.yml file:///home/skhoury/release 
$ ./bin/oc-mirror --v2 -c cfe-969.yml --from file:///home/skhoury/release docker://localhost:5000 --dest-tls-verify=false

Next check the /home/skhoury/release/working-dir/cluster-resources/updateService.yaml

kind: ImageSetConfiguration
apiVersion: mirror.openshift.io/v1alpha2
mirror:
 platform:
   channels:
   - name: stable-4.14
     minVersion: 4.14.2
     maxVersion: 4.14.2
   graph: true
 operators:
 - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.14
   packages:
   - name: aws-load-balancer-operator
 additionalImages:
 - name: registry.redhat.io/ubi8/ubi:latest

Expected Outcome

apiVersion: updateservice.operator.openshift.io/v1
kind: UpdateService
metadata:
 name: update-service-oc-mirror
spec:
 graphDataImage: localhost:55000/openshift/graph-image:latest
 releases: quay.io/openshift-release-dev/ocp-release
 replicas: 2
status: {}

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 Dec 1, 2023
@openshift-ci-robot
Copy link

@sherine-k: This pull request references Jira Issue OCPBUGS-23340, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.15.0) matches configured target version for branch (4.15.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @zhouying7780

In response to this:

Description

The updateservice custom resource instructs a cluster to use the graph image generated by oc-mirror when it encounters the release image specified in the custom resource.

This PR does the following changes:

  • Adds UpdateServiceGenerator to the GeneratorInterface
  • Adds the UpdateService custom resource schema directly to package v2/pkg/clusterresources/updateservice/v1 instead of importing github.com/openshift/cincinnati-operator/ : the last official release v1.0.3 doesn't include the api/v1
  • Simplifies the IDMSGenerator interface
  • Adds GraphImage and ReleaseImage methods to the release's CollectorInterface
  • These methods can be used by Executor during the DiskToMirror workflow, so that Executor can provide both images to the GeneratorInterface in order to create the updateservice.yaml
  • Update the Executor DiskToMirror workflow, in order to generate the custom resource updateservice.yaml if graph is true in the ImageSetConfig
  • The filename was chosen in order to match the one generated in V1

Fixes OCPBUGS-23340

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?

With the following ImageSetConfig, run the MirrorToDisk, followed by DiskToMirror:

$ ./bin/oc-mirror --v2 -c cfe-969.yml file:///home/skhoury/release 
$ ./bin/oc-mirror --v2 -c cfe-969.yml --from file:///home/skhoury/release docker://localhost:5000 --dest-tls-verify=false

Next check the /home/skhoury/release/working-dir/cluster-resources/updateService.yaml

kind: ImageSetConfiguration
apiVersion: mirror.openshift.io/v1alpha2
mirror:
 platform:
   channels:
   - name: stable-4.14
     minVersion: 4.14.2
     maxVersion: 4.14.2
   graph: true
 operators:
 - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.14
   packages:
   - name: aws-load-balancer-operator
 additionalImages:
 - name: registry.redhat.io/ubi8/ubi:latest

Expected Outcome

apiVersion: updateservice.operator.openshift.io/v1
kind: UpdateService
metadata:
 name: update-service-oc-mirror
spec:
 graphDataImage: localhost:55000/openshift/graph-image:latest
 releases: quay.io/openshift-release-dev/ocp-release
 replicas: 2
status: {}

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.

@lmzuccarelli
Copy link
Contributor

@sherine-k - nice separation of concerns !!!

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 4, 2023
@lmzuccarelli
Copy link
Contributor

@sherine-k - needs a rebase

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Dec 4, 2023
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Dec 4, 2023
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 4, 2023
@sherine-k
Copy link
Contributor Author

/lgtm

Copy link

openshift-ci bot commented Dec 4, 2023

@sherine-k: you cannot LGTM your own PR.

In response to this:

/lgtm

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.

@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 Dec 6, 2023
@lmzuccarelli
Copy link
Contributor

/lgtm

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

openshift-ci bot commented Dec 11, 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

Copy link

openshift-ci bot commented Dec 11, 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.

@openshift-merge-bot openshift-merge-bot bot merged commit 2311da0 into openshift:main Dec 11, 2023
5 checks passed
@openshift-ci-robot
Copy link

@sherine-k: Jira Issue OCPBUGS-23340: All pull requests linked via external trackers have merged:

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

In response to this:

Description

The updateservice custom resource instructs a cluster to use the graph image generated by oc-mirror when it encounters the release image specified in the custom resource.

This PR does the following changes:

  • Adds UpdateServiceGenerator to the GeneratorInterface
  • Adds the UpdateService custom resource schema directly to package v2/pkg/clusterresources/updateservice/v1 instead of importing github.com/openshift/cincinnati-operator/ : the last official release v1.0.3 doesn't include the api/v1
  • Simplifies the IDMSGenerator method
  • Adds GraphImage and ReleaseImage methods to the release's CollectorInterface
  • These methods can be used by Executor during the DiskToMirror workflow, so that Executor can provide both images to the GeneratorInterface in order to create the updateservice.yaml
  • Update the Executor DiskToMirror workflow, in order to generate the custom resource updateservice.yaml if graph is true in the ImageSetConfig
  • The filename was chosen in order to match the one generated in V1

Fixes OCPBUGS-23340

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?

With the following ImageSetConfig, run the MirrorToDisk, followed by DiskToMirror:

$ ./bin/oc-mirror --v2 -c cfe-969.yml file:///home/skhoury/release 
$ ./bin/oc-mirror --v2 -c cfe-969.yml --from file:///home/skhoury/release docker://localhost:5000 --dest-tls-verify=false

Next check the /home/skhoury/release/working-dir/cluster-resources/updateService.yaml

kind: ImageSetConfiguration
apiVersion: mirror.openshift.io/v1alpha2
mirror:
 platform:
   channels:
   - name: stable-4.14
     minVersion: 4.14.2
     maxVersion: 4.14.2
   graph: true
 operators:
 - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.14
   packages:
   - name: aws-load-balancer-operator
 additionalImages:
 - name: registry.redhat.io/ubi8/ubi:latest

Expected Outcome

apiVersion: updateservice.operator.openshift.io/v1
kind: UpdateService
metadata:
 name: update-service-oc-mirror
spec:
 graphDataImage: localhost:55000/openshift/graph-image:latest
 releases: quay.io/openshift-release-dev/ocp-release
 replicas: 2
status: {}

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-bot
Copy link
Contributor

[ART PR BUILD NOTIFIER]

This PR has been included in build oc-mirror-plugin-container-v4.16.0-202312111513.p0.g2311da0.assembly.stream for distgit oc-mirror-plugin.
All builds following this will include this PR.

@sherine-k
Copy link
Contributor Author

/cherry-pick release-4.15

@openshift-cherrypick-robot

@sherine-k: new pull request created: #759

In response to this:

/cherry-pick release-4.15

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.

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-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

7 participants