Bug 1855339 - Wrong version of ocs-storagecluster
Summary: Wrong version of ocs-storagecluster
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenShift Data Foundation
Classification: Red Hat Storage
Component: ocs-operator
Version: 4.4
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
: ODF 4.13.0
Assignee: Nikhil Ladha
QA Contact: Petr Balogh
URL: https://github.com/openshift/ocs-oper...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-07-09 15:14 UTC by Filip Balák
Modified: 2023-08-09 17:00 UTC (History)
15 users (show)

Fixed In Version: 4.13.1-1
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-06-21 15:22:14 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift ocs-operator pull 1246 0 None Merged Update OCS operator version at build time 2023-01-23 05:48:33 UTC
Github red-hat-storage ocs-operator pull 1447 0 None closed Report versioning errors in StorageCluster's status 2023-01-23 05:48:34 UTC
Github red-hat-storage ocs-operator pull 1706 0 None Merged Deprecate StorageCluster's `spec.version` field 2023-01-23 05:48:35 UTC
Github red-hat-storage ocs-operator pull 1921 0 None Merged Report versioning errors in StorageCluster's Status 2023-03-06 12:53:55 UTC
Red Hat Product Errata RHBA-2023:3742 0 None None None 2023-06-21 15:22:53 UTC

Description Filip Balák 2020-07-09 15:14:41 UTC
Description of problem (please be detailed as possible and provide log
snippests):
Version of ocs-storagecluster should be set to 4.4.1 when using OCS 4.4.1 but it is set to 4.4.0.

Version of all relevant components (if applicable):
OCP 4.5.0-rc.7
OCS ocs-operator.v4.4.1-476.ci

Does this issue impact your ability to continue to work with the product
(please explain in detail what is the user impact)?
no

Is there any workaround available to the best of your knowledge?
no

Rate from 1 - 5 the complexity of the scenario you performed that caused this
bug (1 - very simple, 5 - very complex)?
1

Can this issue reproducible?
yes

Can this issue reproduce from the UI?


If this is a regression, please provide more details to justify this:


Steps to Reproduce:
1. Check in terminal:
  $ oc get -n openshift-storage storagecluster
  NAME                 AGE   PHASE   CREATED AT             VERSION
  ocs-storagecluster   86m   Ready   2020-07-09T13:43:09Z   4.4.0


Actual results:
Version is set to 4.4.0

Expected results:
  $ oc get -n openshift-storage storagecluster
  NAME                 AGE   PHASE   CREATED AT             VERSION
  ocs-storagecluster   86m   Ready   2020-07-09T13:43:09Z   4.4.1

Additional info:

Comment 2 Michael Adam 2020-07-10 10:35:59 UTC
was this installed with 4.4.0 and then upgraded to 4.4.1?

@Filip?

I thought we had a similar BZ recently where it was explained that this version has no relevance and is only set once upon installation and not changed in upgrades. But I can not find the BZ right now.

@Jose?

Comment 3 Filip Balák 2020-07-10 10:46:39 UTC
No, it was without upgrade.

Comment 4 Mudit Agarwal 2020-07-14 09:32:46 UTC
(In reply to Michael Adam from comment #2)
> was this installed with 4.4.0 and then upgraded to 4.4.1?
> 
> @Filip?
> 
> I thought we had a similar BZ recently where it was explained that this
> version has no relevance and is only set once upon installation and not
> changed in upgrades. But I can not find the BZ right now.
> 
> @Jose?

I think this is the BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1839988 but we are talking about a fresh installation here not an upgrade.

Comment 5 Mudit Agarwal 2020-07-17 04:26:18 UTC
CSV picks up the proper version but storage cluster doesn't.

[muagarwa@dhcp53-217 agarwal-mudit]$ oc get csv -n openshift-storage
NAME                            DISPLAY                       VERSION   REPLACES                        PHASE
lib-bucket-provisioner.v2.0.0   lib-bucket-provisioner        2.0.0     lib-bucket-provisioner.v1.0.0   Succeeded
ocs-operator.v4.4.1             OpenShift Container Storage   4.4.1                                     Installing


[muagarwa@dhcp53-217 agarwal-mudit]$ oc get storagecluster -A
NAMESPACE           NAME                 AGE    PHASE   CREATED AT             VERSION
openshift-storage   ocs-storagecluster   8m5s   Ready   2020-07-17T04:11:59Z   4.4.0
[muagarwa@dhcp53-217 agarwal-mudit]$ 


I guess storagecluster CR is created during OCS installation and at least GUI doesn't display minor versions as an option and hence this should be expected but I am no expert, moving it to ocs-operator.

See also: https://bugzilla.redhat.com/show_bug.cgi?id=1839988

Comment 6 Mudit Agarwal 2020-07-17 06:04:27 UTC
Looks like version comes from github.com/openshift/ocs-operator/version/version.go which is not updated for minor versions.

In pkg/controller/storagecluster/reconcile.go:
-----
// versionCheck populates the `.Spec.Version` field                                                                                               
func versionCheck(sc *ocsv1.StorageCluster, reqLogger logr.Logger) error {                                                                        
    if sc.Spec.Version == "" {                                                                                                                    
        sc.Spec.Version = version.Version   
-----

Comment 13 Petr Balogh 2021-09-29 10:23:02 UTC
I am not sure I can verify this without additional scratch build for 4.9.0-129.ci.

When I checked the version of storageCluster in one of the 4.9 build:
http://magna002.ceph.redhat.com/ocsci-jenkins/openshift-clusters/dnd-jopinto-aws-perf-reruns/dnd-jopinto-aws-perf-reruns_20210927T103353/logs/deployment_1632739410/ocs_must_gather/quay-io-rhceph-dev-ocs-must-gather-sha256-763a982dce2ab3c61da7f08e9bb4f02e8bb33f85430a09f6d37484656f608242/namespaces/openshift-storage/oc_output/storagecluster.yaml

It's:
version: 4.9.0


After upgrade from 4.8 to 4.9 I still see it's reported as 4.8.0 here:
http://magna002.ceph.redhat.com/ocsci-jenkins/openshift-clusters/j-013vue1cslv33-uan/j-013vue1cslv33-uan_20210922T210338/logs/deployment_1632345146/ocs_must_gather/quay-io-rhceph-dev-ocs-must-gather-sha256-bfb5c6e78f74c584cf169e1f431d687314ab48472dddc46fe6767a836ea4bb3e/namespaces/openshift-storage/oc_output/storagecluster.yaml

But AFAIU this bug is not about to fix this issue when upgrade but for fresh deployment.



Boris and Mudit,
can we get some scratch build for 4.9.1 to be able to verify this BZ?

Thanks

Comment 14 Mudit Agarwal 2021-10-04 05:50:09 UTC
I guess we need 4.9.1 build for the internal build upgrade issue also, Boris please help.

Comment 15 Petr Balogh 2021-10-04 08:51:42 UTC
I am not sure if this fix will also fix the upgrade. I remember for upgrade there was other bug (opened even longer time ago), but cannot find it now :(

Comment 16 Petr Balogh 2021-10-11 08:22:34 UTC
@

Comment 17 Petr Balogh 2021-10-11 08:25:06 UTC
@branto any update here please? I cannot continue with verification so I am moving it back to Assigned as without scratch build of 4.9.1 I cannot test it.

Comment 18 Mudit Agarwal 2021-10-11 08:34:49 UTC
We still have the fix in the downstream branch, so MODIFIED is the apt state here till it is testable by QA.
Again non-testability doesn't make it FailedQA, its just not testable atm.

Boris, can we provide a build here?

Comment 19 Andrew Schoen 2021-10-11 15:48:09 UTC
(In reply to Mudit Agarwal from comment #18)
> We still have the fix in the downstream branch, so MODIFIED is the apt state
> here till it is testable by QA.
> Again non-testability doesn't make it FailedQA, its just not testable atm.
> 
> Boris, can we provide a build here?

I've started a 4.9.1 build here: https://ceph-downstream-jenkins-csb-storage.apps.ocp4.prod.psi.redhat.com/view/OCS%204.X%20CI%20CD/job/OCS%20Build%20Pipeline%204.9/184/

Thanks,
Andrew

Comment 20 Andrew Schoen 2021-10-11 19:46:08 UTC
A testing build for 4.9.1 is now available: 4.9.1-186.ci

Comment 21 Petr Balogh 2021-10-13 09:01:21 UTC
Thanks,
running verification here:
https://ocs4-jenkins-csb-ocsqe.apps.ocp4.prod.psi.redhat.com/job/qe-deploy-ocs-cluster/6660/

Will check storageCluster CR once it's deployed and paused.

Comment 22 Petr Balogh 2021-10-13 10:31:12 UTC
bug-storageCluster $ oc get -n openshift-storage storagecluster
NAME                 AGE   PHASE   EXTERNAL   CREATED AT             VERSION
ocs-storagecluster   32m   Ready              2021-10-13T09:57:07Z   4.9.0


bug-storageCluster $ oc get csv -n openshift-storage
NAME                     DISPLAY                       VERSION   REPLACES              PHASE
noobaa-operator.v4.9.1   NooBaa Operator               4.9.1                           Succeeded
ocs-operator.v4.9.1      OpenShift Container Storage   4.9.1     ocs-operator.v4.9.0   Succeeded
odf-operator.v4.9.1      OpenShift Data Foundation     4.9.1


I see that in this build the version of storageCluster was not updated to 4.9.1. Not sure if it's problem of how testing build 4.9.1-186.ci was done.

Anyway with what I got I have to FAIL QE.

Comment 23 Mudit Agarwal 2021-10-13 14:10:08 UTC
Looks like this is not yet fixed and is not that important to make it a blocker for 4.9

We can give it a try again in 4.10 if it is still relevant.

Comment 31 Jose A. Rivera 2022-01-31 14:50:36 UTC
At present ocs-operator gets its versioning from a version.go file:

https://github.com/red-hat-storage/ocs-operator/blob/main/version/version.go
https://github.com/red-hat-storage/ocs-operator/blob/release-4.10/version/version.go
https://github.com/red-hat-storage/ocs-operator/blob/release-4.9/version/version.go

So we need to update all branches with the appropriate values. Just changing the string should be sufficient.

Comment 32 Pranshu Srivastava 2022-01-31 15:02:57 UTC
version.Version is assigned a value at build time here: [0]

I opened a PR for this because changes to the above env var were only reflected in the status field, not spec.version (as only status was updated: [1]), but its on hold for now because we need to rework the version logic a bit: [2].

[0]: https://github.com/red-hat-storage/ocs-operator/blob/0580908d99610dfddfc46c09ed9cb67effadb127/hack/go-build.sh#L10
[1]: https://github.com/red-hat-storage/ocs-operator/pull/1447/files#diff-4160c186e4e6b63623e530892b0aa7f6385e7f60f45a5f3da944492ea6211787L163
[2]: https://github.com/red-hat-storage/ocs-operator/pull/1447#pullrequestreview-847397536

Comment 33 Mudit Agarwal 2022-02-22 14:46:08 UTC
Can't be fixed before 4.10 dev freeze

Comment 37 Jose A. Rivera 2022-06-01 01:39:47 UTC
The main thing that needs consideration is upgrade, and specifically that you can't remove fields (only deprecate). So you would need to retain the Spec field when you add the Status field. Then you would need some logic to update the StorageCluster CR to use the new Status field and clear the Spec field.

I suppose we would also need to update our CRD display information to pull the version from the Status as well.

If we have buy-in from the Console devs, we should be able to do it all in the same release, otherwise we would add the new field in one release and then the upgrade logic later. They just have to be able to deal with it the new field by the time we officially deprecate it.

Comment 47 Mudit Agarwal 2022-12-06 13:30:38 UTC
Not a 4.12 blocker

Comment 64 Malay Kumar parida 2023-03-09 06:27:13 UTC
The fix should be available to test on all ODF 4.13 build after 4.13.0-93. As QE acks are already there moving to ON_QA

Comment 66 Petr Balogh 2023-05-03 20:34:16 UTC
In order to test this we need to have some dummy 4.13.1 dummy build. @branto , can you please provide such build?

Comment 78 errata-xmlrpc 2023-06-21 15:22:14 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Red Hat OpenShift Data Foundation 4.13.0 enhancement and bug fix update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2023:3742


Note You need to log in before you can comment on or make changes to this bug.