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

bundle: add ocs-client-operator as olm dependency #380

Merged
merged 2 commits into from
Mar 22, 2024

Conversation

leelavg
Copy link
Contributor

@leelavg leelavg commented Mar 15, 2024

install ocs-client-operator as a dependency of odf-operator and we don't need to manage the subscription since ocs-client-operator channel name changes will go through a webhook will be dployed by ocs-client-operator itself.

part of [RHSTOR-5487]

@leelavg
Copy link
Contributor Author

leelavg commented Mar 15, 2024

@iamniting wrt CI failure

2024/03/15 12:15:01 render reference "quay.io/ocs-dev/ocs-client-operator-bundle:v4.15.0": error resolving name : unexpected status code [manifests v4.15.0]: 401 UNAUTHORIZED

  • do we need to push the bundle once to this repo or is that an automated process?

@iamniting
Copy link
Member

@leelavg Can you pls make changes to the other files as well, pls take a look at for your ref #379

@iamniting
Copy link
Member

@iamniting wrt CI failure

2024/03/15 12:15:01 render reference "quay.io/ocs-dev/ocs-client-operator-bundle:v4.15.0": error resolving name : unexpected status code [manifests v4.15.0]: 401 UNAUTHORIZED

  • do we need to push the bundle once to this repo or is that an automated process?

Bundle image should be pullable

Copy link
Member

@iamniting iamniting left a comment

Choose a reason for hiding this comment

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

pls make the e2e tests changes as well as a separate commit.

@leelavg
Copy link
Contributor Author

leelavg commented Mar 22, 2024

I'm able to build catalog w/o any issues, should CI be retrigerred?

# make catalog-build
/root/toolbox/orc/odf-operator/bin/opm render --output=yaml quay.io/ocs-dev/odf-operator-bundle:latest  > catalog/odf.yaml
/root/toolbox/orc/odf-operator/bin/opm render --output=yaml quay.io/ocs-dev/ocs-operator-bundle:v4.15.0  > catalog/ocs.yaml
/root/toolbox/orc/odf-operator/bin/opm render --output=yaml quay.io/ocs-dev/ocs-client-operator-bundle:v4.15.0  > catalog/ocs-client.yaml
/root/toolbox/orc/odf-operator/bin/opm render --output=yaml quay.io/ibmodffs/ibm-storage-odf-operator-bundle:1.4.1  > catalog/ibm.yaml
/root/toolbox/orc/odf-operator/bin/opm render --output=yaml quay.io/noobaa/noobaa-operator-bundle:v5.14.0  > catalog/noobaa.yaml
/root/toolbox/orc/odf-operator/bin/opm render --output=yaml quay.io/csiaddons/k8s-bundle:v0.7.0  > catalog/csiaddons.yaml
/root/toolbox/orc/odf-operator/bin/opm render --output=yaml quay.io/ocs-dev/rook-ceph-operator-bundle:v4.15.0  > catalog/rook.yaml
/root/toolbox/orc/odf-operator/bin/opm render --output=yaml quay.io/ocs-dev/odf-prometheus-operator-bundle:v4.10.0  > catalog/prometheus.yaml
/root/toolbox/orc/odf-operator/bin/opm validate catalog
docker build -f catalog.Dockerfile -t quay.io/ocs-dev/odf-operator-catalog:latest .
[+] Building 21.1s (7/7) FINISHED                                                                                                                              docker:default
 => [internal] load build definition from catalog.Dockerfile                                                                                                             0.1s
 => => transferring dockerfile: 505B                                                                                                                                     0.0s
 => [internal] load metadata for quay.io/operator-framework/opm:v1.26.0                                                                                                  3.0s
 => [internal] load .dockerignore                                                                                                                                        0.1s
 => => transferring context: 253B                                                                                                                                        0.0s
 => [internal] load build context                                                                                                                                        0.1s
 => => transferring context: 1.33MB                                                                                                                                      0.0s
 => [1/2] FROM quay.io/operator-framework/opm:v1.26.0@sha256:9ca4c21b09140f5e3df284966fa51eaf242be0d9476631ba1de1f51c587dc77c                                           14.0s
 => => resolve quay.io/operator-framework/opm:v1.26.0@sha256:9ca4c21b09140f5e3df284966fa51eaf242be0d9476631ba1de1f51c587dc77c                                            0.0s
 => => sha256:0ac0743f1b30888aff479ea2021b01c0b64de6be3152dfe2717f61f527513339 1.37kB / 1.37kB                                                                           0.0s
 => => sha256:33210af9f9ca2deff3da7c369d67be9a315c56cce319e8b22161a029692136f7 1.59kB / 1.59kB                                                                           0.0s
 => => sha256:0a602d5f6ca3de9b0e0d4d64e8857e504ec7a8c47f1ec617d82a81f6c64b0fe8 801.01kB / 801.01kB                                                                       0.7s
 => => sha256:79b31aa0ab4a25d55c28bff4030b502cf9cacd8ed08080e3afdc2b5a74b9ca04 741.82kB / 741.82kB                                                                       1.0s
 => => sha256:1bd22bd9263d22523f351b0300b997898b818f31d04425407b33173159964ead 3.92MB / 3.92MB                                                                          12.9s
 => => sha256:9ca4c21b09140f5e3df284966fa51eaf242be0d9476631ba1de1f51c587dc77c 1.36kB / 1.36kB                                                                           0.0s
 => => extracting sha256:0a602d5f6ca3de9b0e0d4d64e8857e504ec7a8c47f1ec617d82a81f6c64b0fe8                                                                                0.5s
 => => sha256:102b85d373c8b2a03779bb848d57ad3070c95436f42ffae5e0c14b722e58cc29 158B / 158B                                                                               2.6s
 => => sha256:d4d93e8691947c69b3851e8642d2e60d96f127acf89b78441e6be96eb1b5d8b6 15.89MB / 15.89MB                                                                         5.5s
 => => extracting sha256:79b31aa0ab4a25d55c28bff4030b502cf9cacd8ed08080e3afdc2b5a74b9ca04                                                                                0.1s
 => => extracting sha256:1bd22bd9263d22523f351b0300b997898b818f31d04425407b33173159964ead                                                                                0.1s
 => => extracting sha256:102b85d373c8b2a03779bb848d57ad3070c95436f42ffae5e0c14b722e58cc29                                                                                0.0s
 => => extracting sha256:d4d93e8691947c69b3851e8642d2e60d96f127acf89b78441e6be96eb1b5d8b6                                                                                0.5s
 => [2/2] COPY catalog /configs                                                                                                                                          3.3s
 => exporting to image                                                                                                                                                   0.3s
 => => exporting layers                                                                                                                                                  0.2s
 => => writing image sha256:2a7cef566a7f864b7bd6ad1c7a5ab57a84226d04c859225107aa4ec6661f8603                                                                             0.0s
 => => naming to quay.io/ocs-dev/odf-operator-catalog:latest    

@leelavg leelavg requested a review from iamniting March 22, 2024 04:44
controllers/subscriptions.go Outdated Show resolved Hide resolved
controllers/subscriptions.go Outdated Show resolved Hide resolved
@iamniting
Copy link
Member

/test odf-operator-e2e-aws

@leelavg leelavg force-pushed the install-client-dep branch from 2cf145d to 593e8ab Compare March 22, 2024 06:10
@leelavg
Copy link
Contributor Author

leelavg commented Mar 22, 2024

@ezio-auditore could you pls take a look at first commit in this PR, let me know if the prom starting csv isn't an intentional miss. thanks.

leelavg added 2 commits March 22, 2024 11:55
Ran below commands from
red-hat-storage/ocs-client-operator/tree/release-4.15 (ff31e31) and
resulting images/values are used in this commit.

export CLUSTER_ENV=openshift
export VERSION=4.15.0
export IMG=quay.io/ocs-dev/ocs-client-operator:v${VERSION}
export OCS_CLIENT_CONSOLE_IMG=\
quay.io/ocs-dev/ocs-client-console:v${VERSION}
export CSI_ADDONS_PACKAGE_VERSION=0.7.0
export BUNDLE_IMG=quay.io/ocs-dev/ocs-client-operator-bundle:v${VERSION}

make container-build container-push
make bundle-build bundle-push

Signed-off-by: Leela Venkaiah G <[email protected]>
Update e2e tests for deploying ocs-client subscription and csv while
installing odf-operator

Signed-off-by: Leela Venkaiah G <[email protected]>
@leelavg leelavg force-pushed the install-client-dep branch from 593e8ab to 461b72b Compare March 22, 2024 06:25
@leelavg
Copy link
Contributor Author

leelavg commented Mar 22, 2024

@ezio-auditore could you pls take a look at first commit in this PR, let me know if the prom starting csv isn't an intentional miss. thanks.

  • removed from my PR as there are misses in some other places and told to raise separate PR.

@leelavg
Copy link
Contributor Author

leelavg commented Mar 22, 2024

Testing:

---
apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
  name: odf-catsrc
  namespace: openshift-marketplace
spec:
  displayName: OpenShift Data Foundation
  # image: quay.io/rhceph-dev/ocs-registry:4.16.0-26
  image: quay.io/rhn_support_lgangava/code:odf-cat-380
  publisher: Red Hat
  sourceType: grpc
---
apiVersion: v1
kind: Namespace
metadata:
  labels:
    openshift.io/cluster-monitoring: "true"
  name: openshift-storage
spec: {}
---
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
  name: odf
  namespace: openshift-storage
spec:
  targetNamespaces:
  - openshift-storage
---
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
  name: odf
  namespace: openshift-storage
spec:
  channel: alpha
  name: odf-operator
  source: odf-catsrc
  sourceNamespace: openshift-marketplace
catalogsource.operators.coreos.com/odf-catsrc created
namespace/openshift-storage created
operatorgroup.operators.coreos.com/odf created
subscription.operators.coreos.com/odf created


# ko get csv
NAME                              DISPLAY                            VERSION   REPLACES   PHASE
csi-addons.v0.7.0                 CSI Addons                         0.7.0                Succeeded
noobaa-operator.v5.14.0           NooBaa Operator                    5.14.0               Succeeded
ocs-client-operator.v4.15.0       OpenShift Data Foundation Client   4.15.0               Succeeded
ocs-operator.v4.15.0              OpenShift Container Storage        4.15.0               Succeeded
odf-operator.v4.15.0              OpenShift Data Foundation          4.15.0               Succeeded
odf-prometheus-operator.v4.10.0   Prometheus Operator                4.10.0               Succeeded
rook-ceph-operator.v4.15.0        Rook-Ceph                          4.15.0               Succeeded

# ko get sub -oyaml | yq -r '.items.[] | del(.status)'
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
  annotations:
    olm.generated-by: install-bsk44
  creationTimestamp: "2024-03-22T06:56:33Z"
  generation: 2
  labels:
    olm.managed: "true"
    operators.coreos.com/csi-addons.openshift-storage: ""
  name: csi-addons-alpha-odf-catsrc-openshift-marketplace
  namespace: openshift-storage
  ownerReferences:
    - apiVersion: operators.coreos.com/v1alpha1
      blockOwnerDeletion: true
      controller: true
      kind: Subscription
      name: odf
      uid: 888ee9a9-8dd6-495f-80ea-0f289e969162
  resourceVersion: "37006"
  uid: 76595ae8-7a1d-4641-9588-75360c5837db
spec:
  channel: alpha
  config:
    tolerations:
      - effect: NoSchedule
        key: node.ocs.openshift.io/storage
        operator: Equal
        value: "true"
  installPlanApproval: Automatic
  name: csi-addons
  source: odf-catsrc
  sourceNamespace: openshift-marketplace
  startingCSV: csi-addons.v0.7.0
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
  annotations:
    olm.generated-by: install-bsk44
  creationTimestamp: "2024-03-22T06:56:33Z"
  generation: 2
  labels:
    olm.managed: "true"
    operators.coreos.com/noobaa-operator.openshift-storage: ""
  name: noobaa-operator-alpha-odf-catsrc-openshift-marketplace
  namespace: openshift-storage
  ownerReferences:
    - apiVersion: operators.coreos.com/v1alpha1
      blockOwnerDeletion: true
      controller: true
      kind: Subscription
      name: odf
      uid: 888ee9a9-8dd6-495f-80ea-0f289e969162
  resourceVersion: "37096"
  uid: b85b19b0-e21d-447d-aa75-52a8c9504139
spec:
  channel: alpha
  config: {}
  installPlanApproval: Automatic
  name: noobaa-operator
  source: odf-catsrc
  sourceNamespace: openshift-marketplace
  startingCSV: noobaa-operator.v5.14.0
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
  annotations:
    olm.generated-by: install-bsk44
  creationTimestamp: "2024-03-22T06:56:33Z"
  generation: 2
  labels:
    olm.managed: "true"
    operators.coreos.com/ocs-client-operator.openshift-storage: ""
  name: ocs-client-operator-alpha-odf-catsrc-openshift-marketplace
  namespace: openshift-storage
  ownerReferences:
    - apiVersion: operators.coreos.com/v1alpha1
      blockOwnerDeletion: true
      controller: true
      kind: Subscription
      name: odf
      uid: 888ee9a9-8dd6-495f-80ea-0f289e969162
  resourceVersion: "37034"
  uid: ea63a755-ebd0-43a7-9460-5ebb82273fa5
spec:
  channel: alpha
  config: {}
  installPlanApproval: Automatic
  name: ocs-client-operator
  source: odf-catsrc
  sourceNamespace: openshift-marketplace
  startingCSV: ocs-client-operator.v4.15.0
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
  annotations:
    olm.generated-by: install-bsk44
  creationTimestamp: "2024-03-22T06:56:33Z"
  generation: 2
  labels:
    olm.managed: "true"
    operators.coreos.com/ocs-operator.openshift-storage: ""
  name: ocs-operator-alpha-odf-catsrc-openshift-marketplace
  namespace: openshift-storage
  ownerReferences:
    - apiVersion: operators.coreos.com/v1alpha1
      blockOwnerDeletion: true
      controller: true
      kind: Subscription
      name: odf
      uid: 888ee9a9-8dd6-495f-80ea-0f289e969162
  resourceVersion: "36855"
  uid: e3759184-c326-49bc-b8d8-76456c59df1b
spec:
  channel: alpha
  config: {}
  installPlanApproval: Automatic
  name: ocs-operator
  source: odf-catsrc
  sourceNamespace: openshift-marketplace
  startingCSV: ocs-operator.v4.15.0
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
  creationTimestamp: "2024-03-22T06:55:58Z"
  generation: 1
  labels:
    operators.coreos.com/odf-operator.openshift-storage: ""
  name: odf
  namespace: openshift-storage
  resourceVersion: "35437"
  uid: 888ee9a9-8dd6-495f-80ea-0f289e969162
spec:
  channel: alpha
  name: odf-operator
  source: odf-catsrc
  sourceNamespace: openshift-marketplace
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
  annotations:
    olm.generated-by: install-bsk44
  creationTimestamp: "2024-03-22T06:56:33Z"
  generation: 2
  labels:
    olm.managed: "true"
    operators.coreos.com/odf-prometheus-operator.openshift-storage: ""
  name: odf-prometheus-operator-beta-odf-catsrc-openshift-marketplace
  namespace: openshift-storage
  ownerReferences:
    - apiVersion: operators.coreos.com/v1alpha1
      blockOwnerDeletion: true
      controller: true
      kind: Subscription
      name: odf
      uid: 888ee9a9-8dd6-495f-80ea-0f289e969162
  resourceVersion: "36824"
  uid: 88c0f937-dba0-4d42-9f7b-86c4034388ca
spec:
  channel: beta
  config: {}
  installPlanApproval: Automatic
  name: odf-prometheus-operator
  source: odf-catsrc
  sourceNamespace: openshift-marketplace
  startingCSV: odf-prometheus-operator.v4.10.0
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
  annotations:
    olm.generated-by: install-bsk44
  creationTimestamp: "2024-03-22T06:56:33Z"
  generation: 2
  labels:
    olm.managed: "true"
    operators.coreos.com/rook-ceph-operator.openshift-storage: ""
  name: rook-ceph-operator-alpha-odf-catsrc-openshift-marketplace
  namespace: openshift-storage
  ownerReferences:
    - apiVersion: operators.coreos.com/v1alpha1
      blockOwnerDeletion: true
      controller: true
      kind: Subscription
      name: odf
      uid: 888ee9a9-8dd6-495f-80ea-0f289e969162
  resourceVersion: "36857"
  uid: 641d934c-43ff-4258-a0fd-bd73315dac6a
spec:
  channel: alpha
  config: {}
  installPlanApproval: Automatic
  name: rook-ceph-operator
  source: odf-catsrc
  sourceNamespace: openshift-marketplace
  startingCSV: rook-ceph-operator.v4.15.0

# ko get sub
NAME                                                            PACKAGE                   SOURCE       CHANNEL
csi-addons-alpha-odf-catsrc-openshift-marketplace               csi-addons                odf-catsrc   alpha
noobaa-operator-alpha-odf-catsrc-openshift-marketplace          noobaa-operator           odf-catsrc   alpha
ocs-client-operator-alpha-odf-catsrc-openshift-marketplace      ocs-client-operator       odf-catsrc   alpha
ocs-operator-alpha-odf-catsrc-openshift-marketplace             ocs-operator              odf-catsrc   alpha
odf                                                             odf-operator              odf-catsrc   alpha
odf-prometheus-operator-beta-odf-catsrc-openshift-marketplace   odf-prometheus-operator   odf-catsrc   beta
rook-ceph-operator-alpha-odf-catsrc-openshift-marketplace       rook-ceph-operator        odf-catsrc   alpha

--- updated the catsrc
# ko get cm odf-operator-manager-config -oyaml | grep -i ocs_client
  OCS_CLIENT_SUBSCRIPTION_CATALOGSOURCE: odf-catsrc
  OCS_CLIENT_SUBSCRIPTION_CATALOGSOURCE_NAMESPACE: openshift-marketplace
  OCS_CLIENT_SUBSCRIPTION_CHANNEL: alpha
  OCS_CLIENT_SUBSCRIPTION_NAME: ocs-client-operator
  OCS_CLIENT_SUBSCRIPTION_PACKAGE: ocs-client-operator
  OCS_CLIENT_SUBSCRIPTION_STARTINGCSV: ocs-client-operator.v4.15.0

# ko delete po odf-operator-controller-manager-5fc5ccd7d4-6749t
pod "odf-operator-controller-manager-5fc5ccd7d4-6749t" deleted

# ko delete sub ocs-client-operator-alpha-odf-catsrc-openshift-marketplace
subscription.operators.coreos.com "ocs-client-operator-alpha-odf-catsrc-openshift-marketplace" deleted

# ko get sub | grep ocs-client
ocs-client-operator                                             ocs-client-operator       odf-catsrc   alpha

@iamniting
Copy link
Member

/test odf-operator-e2e-aws

Comment on lines +11 to +13
value:
packageName: ocs-client-operator
version: ">=4.14.0 <4.15.0 || 4.15.0"
Copy link

Choose a reason for hiding this comment

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

@leelavg Wouldn't this create issues for us when it comes to updating the client via the desired channel mechanism?

Copy link
Contributor Author

@leelavg leelavg Mar 22, 2024

Choose a reason for hiding this comment

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

Due to earlier work w/ operator condition odf-operator update itself will not get triggered if there will be unsupported clients.

So, native client-op subscription to be managed by odf-op is a safe operation and it should not create any issue w/ webhook.

@leelavg
Copy link
Contributor Author

leelavg commented Mar 22, 2024

/test odf-operator-e2e-aws

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Mar 22, 2024
Copy link
Contributor

openshift-ci bot commented Mar 22, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: iamniting, leelavg

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 Mar 22, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit f3575bb into red-hat-storage:main Mar 22, 2024
16 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. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants