Description of problem: Could save Architectures|Install Type|Management State in samplesresources.status to invalid value. Version-Release number of selected component (if applicable): version 0.0.1-2018-12-08-172651 True False 33m Cluster version is 0.0.1-2018-12-08-172651 quay.io/openshift-release-dev/ocp-v4.0@sha256:d46de909247d8002e92e7d1ad6e3f32d3b4e439e44ebe4ae9bd63a39bf9d4276 How reproducible: always Steps to Reproduce: 1.Config samplesresources.status.Architectures to ppc64le when the samplesresources.spec.Architectures have set to x86_64 2.Check samplesresources 3.Check cvo status Actual results: cvo treats this as invalid configure. $ oc describe samplesresources Name: openshift-samples Namespace: Labels: <none> Annotations: <none> API Version: samplesoperator.config.openshift.io/v1alpha1 Kind: SamplesResource Metadata: Creation Timestamp: 2018-12-13T05:16:16Z Finalizers: samplesoperator.config.openshift.io/finalizer Generation: 1 Resource Version: 1324563 Self Link: /apis/samplesoperator.config.openshift.io/v1alpha1/samplesresources/openshift-samples UID: 376716ef-fe96-11e8-8c40-0aaa93c407fa Spec: Architectures: x86_64 Install Type: centos Management State: Managed Status: Architectures: ppc64le Conditions: Last Transition Time: 2018-12-14T02:44:30Z Last Update Time: 2018-12-14T02:44:30Z Status: True Type: SamplesExist Last Transition Time: 2018-12-14T02:54:43Z Last Update Time: 2018-12-14T02:54:43Z Status: True Type: ImportCredentialsExists Last Transition Time: 2018-12-14T06:09:24Z Last Update Time: 2018-12-14T06:09:24Z Message: cannot change architectures from []string{"ppc64le"} to []string{"x86_64"} Status: False Type: ConfigurationValid Last Transition Time: 2018-12-14T03:32:54Z Last Update Time: 2018-12-14T03:32:54Z Status: False Type: ChangesInProgress Last Transition Time: 2018-12-13T05:16:13Z Last Update Time: 2018-12-13T05:16:13Z Status: False Type: PendingRemove Install Type: centos Management State: Managed Events: <none> $ oc describe clusteroperator openshift-cluster-samples-operator Name: openshift-cluster-samples-operator Namespace: Labels: <none> Annotations: <none> API Version: config.openshift.io/v1 Kind: ClusterOperator Metadata: Creation Timestamp: 2018-12-13T05:16:16Z Generation: 1 Resource Version: 1324564 Self Link: /apis/config.openshift.io/v1/clusteroperators/openshift-cluster-samples-operator UID: 378c4e9f-fe96-11e8-8c40-0aaa93c407fa Spec: Status: Conditions: Last Transition Time: 2018-12-14T06:09:27Z Message: The samples operator configuration is invalid Status: True Type: Failing Last Transition Time: 2018-12-14T03:32:58Z Message: The samples operator is not in the process of initiating changes to the imagestreams Status: False Type: Progressing Last Transition Time: 2018-12-14T02:44:33Z Message: Samples exist in the openshift project Status: True Type: Available Extension: <nil> Version: Events: <none> Expected results: Should forbidden update samplesresources.status Additional info: The warning message should be more simple. cannot change architectures from []string{"ppc64le"} to []string{"x86_64"}
Gabe I can give you some guidance on this, you're not going to be able to fix it until we move off the operator SDK though.
@Ben - now that we have a non-SDK version cooking (even if not merged yet), is it time to go over that guidance you mentioned last month? Or do we want to punt on this for 4.0 ?
I'd like to fix it, it's relatively simple. But let's not add it to your current in flight PR. you can see a general idea of the things that are involved here: https://github.com/openshift/cluster-image-registry-operator/pull/118 1) add status subresource to CRD definition 2) add rbac rules so your operator can edit the status subresource 3) when you want to update the status fields, you need to call UpdateStatus instead of Update
PR https://github.com/openshift/cluster-samples-operator/pull/77 is up
PR has merged
Can't reproduce this bug. Couldn't update status of configs.samples.operator.openshift.io. oc get clusterversion NAME VERSION AVAILABLE PROGRESSING SINCE STATUS version 4.0.0-0.alpha-2019-01-14-015843 True False 37m Cluster version is 4.0.0-0.alpha-2019-01-14-015843 configs.samples.operator.openshift.io 4.0.0-alpha1-f76f4f23b
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, 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-2019:0758