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

CMP-2176: Implement replaces in bundle CSV #475

Merged
merged 1 commit into from
Feb 20, 2024

Conversation

rhmdnd
Copy link

@rhmdnd rhmdnd commented Nov 15, 2023

The replaces attribute of an operator's CSV helps OLM build
relationships between operators, making it easier for users to install
older versions of an operator (or know which version supercedes the
version they're using).

This commit reintroduces the replaces attribute, since it was being
deleted before as a side-effect of an operator-sdk update. It should be
safe to include again.

@openshift-ci-robot
Copy link
Collaborator

@rhmdnd: This pull request references CMP-2176 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 story to target either version "4.15." or "openshift-4.15.", but it targets "compliance-operator-1.4.0" instead.

In response to this:

The replaces attribute of an operator's CSV helps OLM build
relationships between operators, making it easier for users to install
older versions of an operator (or know which version supercedes the
version they're using).

This commit reintroduces the replaces attribute, since it was being
deleted before as a side-effect of an operator-sdk update. It should be
safe to include again.

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.

@rhmdnd rhmdnd requested review from yuumasato and Vincent056 and removed request for jhrozek and mrogers950 November 15, 2023 21:53
@xiaojiey
Copy link
Collaborator

/hold for test

@xiaojiey
Copy link
Collaborator

xiaojiey commented Jan 16, 2024

I think the index image generation is more related with downstream(replace the placeholder version with the last released version) not upstream.
I was not able to sqlite-based index image with two CO versions. But I was able to create a file-based index image with two CO versions. I think the final result still depends on how release team will handle the index image.

1, mkdir catalog
2, opm generate dockerfile catalog
3, create catalog-basic-veneer.yaml
$ cat catalog-basic-veneer.yaml 
---
schema: olm.package
name: compliance-operator
defaultChannel: stable
---
schema: olm.channel
package: compliance-operator
name: stable
entries:
- name: compliance-operator.v1.1.0
- name: compliance-operator.v1.2.0
  replaces: compliance-operator.v1.1.0
---
schema: olm.bundle
image: quay.io/xx/compliance-operator-bundle:pr-475
---
schema: olm.bundle
image: registry-proxy.engineering.redhat.com/rh-osbs/openshift-compliance-operator-bundle@sha256:97c96ec2481b95e189074b32837945187b4e350ce5e11902c984ae722ff06c9a
4, Generate index.yaml
opm alpha render-template basic catalog-basic-veneer.yaml -o yaml > catalog/index.yaml

5, validate catalog
opm validate catalog

6, build image
sudo docker buildx build . --push --platform linux/amd64 -f catalog.Dockerfile -t quay.io/xx/compliance-operator-catalog:pr-475

7. Verify the index images:
$ opm alpha list bundles quay.io/xx/compliance-operator-catalog:pr-475 compliance-operator
PACKAGE              CHANNEL  BUNDLE                      REPLACES                    SKIPS  SKIP RANGE  IMAGE
compliance-operator  stable   compliance-operator.v1.1.0                                                 registry-proxy.engineering.redhat.com/rh-osbs/openshift-compliance-operator-bundle@sha256:97c96ec2481b95e189074b32837945187b4e350ce5e11902c984ae722ff06c9a
compliance-operator  stable   compliance-operator.v1.2.0  compliance-operator.v1.1.0                     quay.io/xx/compliance-operator-bundle:pr-475

@xiaojiey
Copy link
Collaborator

/unhold

@xiaojiey
Copy link
Collaborator

/label qe-approved

@openshift-ci-robot
Copy link
Collaborator

@rhmdnd: This pull request references CMP-2176 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 story to target either version "4.16." or "openshift-4.16.", but it targets "compliance-operator-1.4.0" instead.

In response to this:

The replaces attribute of an operator's CSV helps OLM build
relationships between operators, making it easier for users to install
older versions of an operator (or know which version supercedes the
version they're using).

This commit reintroduces the replaces attribute, since it was being
deleted before as a side-effect of an operator-sdk update. It should be
safe to include again.

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 openshift-eng/jira-lifecycle-plugin repository.

The `replaces` attribute of an operator's CSV helps OLM build
relationships between operators, making it easier for users to install
older versions of an operator (or know which version supercedes the
version they're using).

This commit reintroduces the `replaces` attribute, since it was being
deleted before as a side-effect of an operator-sdk update. It should be
safe to include again.
@@ -1557,4 +1557,5 @@ spec:
provider:
name: Red Hat Inc.
url: www.redhat.com
version: 0.1.53
replaces: 1.3.1
Copy link
Author

Choose a reason for hiding this comment

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

These are fed into the bundle manifest as inputs, and here we're just updating them to be accurate with the most recent version of the compliance operator.

The next time we release, the replaces version should be 1.4.0 and the new version should be 1.4.1.

@rhmdnd
Copy link
Author

rhmdnd commented Feb 19, 2024

/test e2e-aws-parallel

Copy link

@Vincent056 Vincent056 left a comment

Choose a reason for hiding this comment

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

/lgtm

Copy link

openshift-ci bot commented Feb 20, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rhmdnd, sheriff-rh, Vincent056

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

@sheriff-rh sheriff-rh removed their assignment Feb 20, 2024
@rhmdnd rhmdnd merged commit 45fb1c6 into ComplianceAsCode:master Feb 20, 2024
19 of 24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants