Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1822115

Summary: kubeapiserver logs show all prom-operator custom resources have an "has invalid property: anyOf"
Product: OpenShift Container Platform Reporter: Lili Cosic <lcosic>
Component: MonitoringAssignee: Paul Gier <pgier>
Status: CLOSED DUPLICATE QA Contact: Junqi Zhao <juzhao>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.5CC: alegrand, anpicker, erooth, kakkoyun, lcosic, mloibl, pkrupa, sttts, surbania
Target Milestone: ---   
Target Release: 4.5.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: groom
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-04-30 06:49:09 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:

Description Lili Cosic 2020-04-08 09:57:39 UTC
Description of problem:
We are seeing a lot of errors in the kubeapiserver logs that there is an invalid property.

Version-Release number of selected component (if applicable):
4.5. nightly (4.5.0-0.nightly-2020-04-08-045556)

How reproducible:
Everytime.


Steps to Reproduce:
1. Start a 4.5 nightly cluster
2. Look at openshift-kube-apiserver namespace for the kubeapiserver logs.
3. See the error logs there.

Actual results:
> ERROR $root.definitions.com.coreos.monitoring.v1.ThanosRuler.properties.spec.properties.containers.items.<array>.properties.livenessProbe.properties.tcpSocket.properties.port has invalid property: anyOf

ERROR $root.definitions.com.coreos.monitoring.v1.Alertmanager.properties.spec.properties.initContainers.items.<array>.properties.readinessProbe.properties.tcpSocket.properties.port has invalid property: anyOf
ERROR $root.definitions.com.coreos.monitoring.v1.Prometheus.properties.spec.properties.initContainers.items.<array>.properties.startupProbe.properties.httpGet.properties.port has invalid property: anyOf

Expected results:
I expect to not see any error logs in kubeapiserver.

Additional info:
This is most likely do to bump of controller-tools in prom-operator, as thats where we have seen the anyOf changes. https://github.com/coreos/prometheus-operator/pull/3107/files#diff-d0ed67a283513afcb330df155d406ec1R749

Comment 1 Lili Cosic 2020-04-08 09:59:14 UTC
Paul since you worked on this, I assigned it to you as you are most familiar with that part, but bugboss feel free to assign to someone else as well.

Comment 2 Lili Cosic 2020-04-08 11:15:14 UTC
Note: I suspect this has to do with the CRD v1 vs CRD v1beta1 bug we have been seeing, the CRD is registered agains the v1beta1, we should try to switch to v1 CRD api in prom-operator and see if this is fixed by that.

Comment 4 Paul Gier 2020-04-29 21:03:30 UTC
This seems to be related to the switch to a structural schema.  We've been using the "anyOf" property since before the use of controller-gen, however, the switch to a structural schema via "preserveUnknownFields: false" the API server is doing additional validation that was not done previously.  AFAICT, our CRD specification is correct according to the docs, but I'm still investigating how to fix this error.

Comment 5 Stefan Schimanski 2020-04-30 06:49:09 UTC

*** This bug has been marked as a duplicate of bug 1786269 ***