Bug 1861636
| Summary: | CRD is not re-marked automatically if we un-mark it after installing operator | ||
|---|---|---|---|
| Product: | OpenShift Container Platform | Reporter: | kuiwang |
| Component: | OLM | Assignee: | Nick Hale <nhale> |
| OLM sub component: | OLM | QA Contact: | kuiwang |
| Status: | CLOSED ERRATA | Docs Contact: | |
| Severity: | low | ||
| Priority: | medium | CC: | nhale |
| Version: | 4.6 | ||
| Target Milestone: | --- | ||
| Target Release: | 4.6.0 | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2020-10-27 16:21:20 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
Hi Kui, Is the CRD eventually re-adopted if you wait long enough? Hi Nick It will be not re-adopted after waiting long enough (for example, more than 20 minutes) Thanks verify it on 4.6. LGTM
--
kuiwang@Kuis-MacBook-Pro 1861636 % oc get clusterversion
NAME VERSION AVAILABLE PROGRESSING SINCE STATUS
version 4.6.0-0.nightly-2020-08-11-194853 True False 108m Cluster version is 4.6.0-0.nightly-2020-08-11-194853
kuiwang@Kuis-MacBook-Pro 1861636 % oc get pod -n openshift-operator-lifecycle-manager
NAME READY STATUS RESTARTS AGE
catalog-operator-7955644dfc-r94tt 1/1 Running 0 104m
olm-operator-cc769fcff-8zpk6 1/1 Running 0 104m
packageserver-5846888748-j8lzg 1/1 Running 0 105m
packageserver-5846888748-vb5gh 1/1 Running 0 104m
kuiwang@Kuis-MacBook-Pro 1861636 % oc exec olm-operator-cc769fcff-8zpk6 -n openshift-operator-lifecycle-manager -- olm --version
OLM version: 0.16.0
git commit: 9b6e7a34527996144a6565753cb93be6b95d8964
kuiwang@Kuis-MacBook-Pro 1861636 % cat og-single.yaml
kind: OperatorGroup
apiVersion: operators.coreos.com/v1
metadata:
name: og-single
namespace: default
spec:
targetNamespaces:
- default
kuiwang@Kuis-MacBook-Pro 1861636 % oc apply -f og-single.yaml
operatorgroup.operators.coreos.com/og-single created
kuiwang@Kuis-MacBook-Pro 1861636 % cat catsrc.yaml
apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
name: olm-cock-catalog
namespace: openshift-marketplace
spec:
displayName: cock Operator Catalog
image: quay.io/kuiwang/cockroachdb-index:33176
publisher: QE
sourceType: grpc
kuiwang@Kuis-MacBook-Pro 1861636 % oc apply -f catsrc.yaml
catalogsource.operators.coreos.com/olm-cock-catalog created
kuiwang@Kuis-MacBook-Pro 1861636 % cat cockroachdb-sub.yaml
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: cock
namespace: default
spec:
channel: alpha
installPlanApproval: Automatic
name: cockroachdb
source: olm-cock-catalog
sourceNamespace: openshift-marketplace
startingCSV: cockroachdb.v2.0.9
kuiwang@Kuis-MacBook-Pro 1861636 % oc apply -f cockroachdb-sub.yaml
subscription.operators.coreos.com/cock created
kuiwang@Kuis-MacBook-Pro 1861636 % oc get sub
NAME PACKAGE SOURCE CHANNEL
cock cockroachdb olm-cock-catalog alpha
kuiwang@Kuis-MacBook-Pro 1861636 % oc get csv
No resources found in default namespace.
kuiwang@Kuis-MacBook-Pro 1861636 % oc get csv
NAME DISPLAY VERSION REPLACES PHASE
cockroachdb.v2.0.9 CockroachDB 2.0.9 Succeeded
kuiwang@Kuis-MacBook-Pro 1861636 % oc get operator
NAME AGE
cockroachdb.default 59s
kuiwang@Kuis-MacBook-Pro 1861636 % oc get operator cockroachdb.default -o yaml
apiVersion: operators.coreos.com/v1
kind: Operator
metadata:
creationTimestamp: "2020-08-12T05:24:35Z"
generation: 1
managedFields:
- apiVersion: operators.coreos.com/v1
fieldsType: FieldsV1
fieldsV1:
f:spec: {}
f:status:
.: {}
f:components:
.: {}
f:labelSelector:
.: {}
f:matchExpressions: {}
f:refs: {}
manager: olm
operation: Update
time: "2020-08-12T05:25:05Z"
name: cockroachdb.default
resourceVersion: "136873"
selfLink: /apis/operators.coreos.com/v1/operators/cockroachdb.default
uid: dccf1f68-5b7b-4dc9-adbc-da97fd48ae7a
spec: {}
status:
components:
labelSelector:
matchExpressions:
- key: operators.coreos.com/cockroachdb.default
operator: Exists
refs:
- apiVersion: apps/v1
conditions:
- lastTransitionTime: "2020-08-12T05:25:05Z"
lastUpdateTime: "2020-08-12T05:25:05Z"
message: Deployment has minimum availability.
reason: MinimumReplicasAvailable
status: "True"
type: Available
- lastTransitionTime: "2020-08-12T05:24:57Z"
lastUpdateTime: "2020-08-12T05:25:05Z"
message: ReplicaSet "cockroachdb-operator-748d9bb77c" has successfully progressed.
reason: NewReplicaSetAvailable
status: "True"
type: Progressing
kind: Deployment
name: cockroachdb-operator
namespace: default
- apiVersion: v1
kind: ServiceAccount
name: cockroachdb-operator
namespace: default
- apiVersion: v1
kind: Secret
name: mysecret
namespace: default
- apiVersion: v1
kind: ConfigMap
name: my-config-map
namespace: default
- apiVersion: rbac.authorization.k8s.io/v1
kind: Role
name: cockroachdb.v2.0.9-cockroachdb-operator-65d79d45f6
namespace: default
- apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
name: cockroachdb.v2.0.9-cockroachdb-operator-65d79d45f6
namespace: default
- apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
name: cockroachdb.v2.0.9-8c87d9d5c
- apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
name: cockroachdb.v2.0.9-8c87d9d5c
- apiVersion: apiextensions.k8s.io/v1
conditions:
- lastTransitionTime: "2020-08-12T05:24:57Z"
message: no conflicts found
reason: NoConflicts
status: "True"
type: NamesAccepted
- lastTransitionTime: "2020-08-12T05:24:57Z"
message: the initial names have been accepted
reason: InitialNamesAccepted
status: "True"
type: Established
- lastTransitionTime: "2020-08-12T05:24:57Z"
message: protected groups must have approval annotation "api-approved.kubernetes.io", see https://github.com/kubernetes/enhancements/pull/1111
reason: MissingAnnotation
status: "False"
type: KubernetesAPIApprovalPolicyConformant
kind: CustomResourceDefinition
name: cockroachdbs.charts.helm.k8s.io
- apiVersion: operators.coreos.com/v1alpha1
conditions:
- lastTransitionTime: "2020-08-12T05:24:36Z"
message: all available catalogsources are healthy
reason: AllCatalogSourcesHealthy
status: "False"
type: CatalogSourcesUnhealthy
kind: Subscription
name: cock
namespace: default
- apiVersion: operators.coreos.com/v1alpha1
conditions:
- lastTransitionTime: "2020-08-12T05:24:57Z"
lastUpdateTime: "2020-08-12T05:24:57Z"
status: "True"
type: Installed
kind: InstallPlan
name: install-4rmlt
namespace: default
- apiVersion: operators.coreos.com/v1alpha1
conditions:
- lastTransitionTime: "2020-08-12T05:24:57Z"
lastUpdateTime: "2020-08-12T05:24:57Z"
message: requirements not yet checked
reason: RequirementsUnknown
status: ""
type: ""
- lastTransitionTime: "2020-08-12T05:24:57Z"
lastUpdateTime: "2020-08-12T05:24:57Z"
message: all requirements found, attempting install
reason: AllRequirementsMet
status: ""
type: ""
- lastTransitionTime: "2020-08-12T05:24:57Z"
lastUpdateTime: "2020-08-12T05:24:57Z"
message: waiting for install components to report healthy
reason: InstallSucceeded
status: ""
type: ""
- lastTransitionTime: "2020-08-12T05:24:57Z"
lastUpdateTime: "2020-08-12T05:24:58Z"
message: |
installing: waiting for deployment cockroachdb-operator to become ready: Waiting for rollout to finish: 0 of 1 updated replicas are available...
reason: InstallWaiting
status: ""
type: ""
- lastTransitionTime: "2020-08-12T05:25:05Z"
lastUpdateTime: "2020-08-12T05:25:05Z"
message: install strategy completed with no errors
reason: InstallSucceeded
status: ""
type: ""
kind: ClusterServiceVersion
name: cockroachdb.v2.0.9
namespace: default
kuiwang@Kuis-MacBook-Pro 1861636 % oc get operator cockroachdb.default -o yaml|grep kind|grep -v Operator
kind: Deployment
kind: ServiceAccount
kind: Secret
kind: ConfigMap
kind: Role
kind: RoleBinding
kind: ClusterRole
kind: ClusterRoleBinding
kind: CustomResourceDefinition
kind: Subscription
kind: InstallPlan
kind: ClusterServiceVersion
kuiwang@Kuis-MacBook-Pro 1861636 % rln="crd";rlk="cockroachdbs";rlw=`oc get $rln |grep $rlk| cut -d" " -f1`;oc label $rln $rlw operators.coreos.com/cockroachdb.default-;oc get $rln $rlw -o yaml|grep "operators.coreos.com/cockroachdb.default";date
customresourcedefinition.apiextensions.k8s.io/cockroachdbs.charts.helm.k8s.io labeled
operators.coreos.com/cockroachdb.default: ""
f:operators.coreos.com/cockroachdb.default: {}
Wed Aug 12 13:27:45 CST 2020
kuiwang@Kuis-MacBook-Pro 1861636 % oc get operator cockroachdb.default -o yaml|grep kind|grep -v Operator
kind: Deployment
kind: ServiceAccount
kind: Secret
kind: ConfigMap
kind: Role
kind: RoleBinding
kind: ClusterRole
kind: ClusterRoleBinding
kind: CustomResourceDefinition
kind: Subscription
kind: InstallPlan
kind: ClusterServiceVersion
--
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 (OpenShift Container Platform 4.6 GA Images), 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-2020:4196 |
Description of problem: After installing operator, the generated resource is marked automatically. If we unmark a generated resource, it should be re-marked automatically. But CRD is not re-marked automatically. Version-Release number of selected component (if applicable): 4.6 How reproducible: always Steps to Reproduce: kuiwang@Kuis-MacBook-Pro OCP-33176 % cat og-single.yaml kind: OperatorGroup apiVersion: operators.coreos.com/v1 metadata: name: og-single namespace: default spec: targetNamespaces: - default kuiwang@Kuis-MacBook-Pro OCP-33176 % oc apply -f og-single.yaml operatorgroup.operators.coreos.com/og-single created kuiwang@Kuis-MacBook-Pro OCP-33176 % cat catsrc.yaml apiVersion: operators.coreos.com/v1alpha1 kind: CatalogSource metadata: name: olm-cock-catalog namespace: openshift-marketplace spec: displayName: cock Operator Catalog image: quay.io/kuiwang/cockroachdb-index:33176 publisher: QE sourceType: grpc kuiwang@Kuis-MacBook-Pro OCP-33176 % oc apply -f catsrc.yaml catalogsource.operators.coreos.com/olm-cock-catalog created kuiwang@Kuis-MacBook-Pro OCP-33176 % cat cockroachdb-sub.yaml apiVersion: operators.coreos.com/v1alpha1 kind: Subscription metadata: name: cock namespace: default spec: channel: alpha installPlanApproval: Automatic name: cockroachdb source: olm-cock-catalog sourceNamespace: openshift-marketplace startingCSV: cockroachdb.v2.0.9 kuiwang@Kuis-MacBook-Pro OCP-33176 % oc apply -f cockroachdb-sub.yaml subscription.operators.coreos.com/cock created kuiwang@Kuis-MacBook-Pro OCP-33176 % oc get sub NAME PACKAGE SOURCE CHANNEL cock cockroachdb olm-cock-catalog alpha kuiwang@Kuis-MacBook-Pro OCP-33176 % oc get csv NAME DISPLAY VERSION REPLACES PHASE cockroachdb.v2.0.9 CockroachDB 2.0.9 Installing kuiwang@Kuis-MacBook-Pro OCP-33176 % oc get csv NAME DISPLAY VERSION REPLACES PHASE cockroachdb.v2.0.9 CockroachDB 2.0.9 Succeeded kuiwang@Kuis-MacBook-Pro OCP-33176 % oc get operator NAME AGE cockroachdb.default 45s kuiwang@Kuis-MacBook-Pro OCP-33176 % oc get operator cockroachdb.default -o yaml apiVersion: operators.coreos.com/v2alpha1 kind: Operator metadata: creationTimestamp: "2020-07-29T05:44:32Z" generation: 1 managedFields: - apiVersion: operators.coreos.com/v2alpha1 fieldsType: FieldsV1 fieldsV1: f:spec: {} f:status: .: {} f:components: .: {} f:labelSelector: .: {} f:matchExpressions: {} f:refs: {} manager: olm operation: Update time: "2020-07-29T05:44:59Z" name: cockroachdb.default resourceVersion: "405362" selfLink: /apis/operators.coreos.com/v2alpha1/operators/cockroachdb.default uid: 6f052c0a-6c42-4651-b1dd-2cd052a42346 spec: {} status: components: labelSelector: matchExpressions: - key: operators.coreos.com/cockroachdb.default operator: Exists refs: - apiVersion: apps/v1 conditions: - lastTransitionTime: "2020-07-29T05:44:58Z" lastUpdateTime: "2020-07-29T05:44:58Z" message: Deployment has minimum availability. reason: MinimumReplicasAvailable status: "True" type: Available - lastTransitionTime: "2020-07-29T05:44:52Z" lastUpdateTime: "2020-07-29T05:44:58Z" message: ReplicaSet "cockroachdb-operator-748d9bb77c" has successfully progressed. reason: NewReplicaSetAvailable status: "True" type: Progressing kind: Deployment name: cockroachdb-operator namespace: default - apiVersion: v1 kind: ServiceAccount name: cockroachdb-operator namespace: default - apiVersion: v1 kind: Secret name: mysecret namespace: default - apiVersion: v1 kind: ConfigMap name: my-config-map namespace: default - apiVersion: rbac.authorization.k8s.io/v1 kind: Role name: cockroachdb.v2.0.9-cockroachdb-operator-65d79d45f6 namespace: default - apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding name: cockroachdb.v2.0.9-cockroachdb-operator-65d79d45f6 namespace: default - apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole name: cockroachdb.v2.0.9-8c87d9d5c - apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding name: cockroachdb.v2.0.9-8c87d9d5c - apiVersion: apiextensions.k8s.io/v1 conditions: - lastTransitionTime: "2020-07-29T05:44:51Z" message: protected groups must have approval annotation "api-approved.kubernetes.io", see https://github.com/kubernetes/enhancements/pull/1111 reason: MissingAnnotation status: "False" type: KubernetesAPIApprovalPolicyConformant - lastTransitionTime: "2020-07-29T05:44:51Z" message: no conflicts found reason: NoConflicts status: "True" type: NamesAccepted - lastTransitionTime: "2020-07-29T05:44:51Z" message: the initial names have been accepted reason: InitialNamesAccepted status: "True" type: Established kind: CustomResourceDefinition name: cockroachdbs.charts.helm.k8s.io - apiVersion: operators.coreos.com/v1alpha1 conditions: - lastTransitionTime: "2020-07-29T05:44:32Z" message: all available catalogsources are healthy reason: AllCatalogSourcesHealthy status: "False" type: CatalogSourcesUnhealthy kind: Subscription name: cock namespace: default - apiVersion: operators.coreos.com/v1alpha1 conditions: - lastTransitionTime: "2020-07-29T05:44:51Z" lastUpdateTime: "2020-07-29T05:44:51Z" message: requirements not yet checked reason: RequirementsUnknown status: "" type: "" - lastTransitionTime: "2020-07-29T05:44:51Z" lastUpdateTime: "2020-07-29T05:44:51Z" message: all requirements found, attempting install reason: AllRequirementsMet status: "" type: "" - lastTransitionTime: "2020-07-29T05:44:52Z" lastUpdateTime: "2020-07-29T05:44:52Z" message: waiting for install components to report healthy reason: InstallSucceeded status: "" type: "" - lastTransitionTime: "2020-07-29T05:44:52Z" lastUpdateTime: "2020-07-29T05:44:52Z" message: | installing: waiting for deployment cockroachdb-operator to become ready: Waiting for deployment spec update to be observed... reason: InstallWaiting status: "" type: "" - lastTransitionTime: "2020-07-29T05:44:59Z" lastUpdateTime: "2020-07-29T05:44:59Z" message: install strategy completed with no errors reason: InstallSucceeded status: "" type: "" kind: ClusterServiceVersion name: cockroachdb.v2.0.9 namespace: default kuiwang@Kuis-MacBook-Pro OCP-33176 % oc get operator cockroachdb.default -o yaml|grep kind|grep -v Operator kind: Deployment kind: ServiceAccount kind: Secret kind: ConfigMap kind: Role kind: RoleBinding kind: ClusterRole kind: ClusterRoleBinding kind: CustomResourceDefinition kind: Subscription kind: ClusterServiceVersion kuiwang@Kuis-MacBook-Pro OCP-33176 % rln="crd";rlk="cockroachdbs";rlw=`oc get $rln |grep $rlk| cut -d" " -f1`;oc label $rln $rlw operators.coreos.com/cockroachdb.default-;oc get $rln $rlw -o yaml|grep "operators.coreos.com/cockroachdb.default";date customresourcedefinition.apiextensions.k8s.io/cockroachdbs.charts.helm.k8s.io labeled Wed Jul 29 14:03:39 CST 2020 kuiwang@Kuis-MacBook-Pro OCP-33176 % oc get operator cockroachdb.default -o yaml|grep kind|grep -v Operator kind: Deployment kind: ServiceAccount kind: Secret kind: ConfigMap kind: Role kind: RoleBinding kind: ClusterRole kind: ClusterRoleBinding kind: Subscription kind: ClusterServiceVersion Actual results: The CRD is not re-marked automatically, so we do not view it via Operator Expected results: The CRD is re-marked automatically, so we can view it via Operator Additional info: