Bug 1885620 - CRDs with preserveUnknownFields:true don't reflect in status that they are non-structural
Summary: CRDs with preserveUnknownFields:true don't reflect in status that they are no...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: kube-apiserver
Version: 4.5
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ---
: 4.6.z
Assignee: Stefan Schimanski
QA Contact: Ke Wang
URL:
Whiteboard:
Depends On: 1848358
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-10-06 14:17 UTC by OpenShift BugZilla Robot
Modified: 2021-01-12 09:34 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-01-12 09:34:12 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Comment 2 Ke Wang 2020-10-29 11:11:20 UTC
First read Stefan's https://kubernetes.io/blog/2019/06/20/crd-structural-schema/ about structural and non-structural schema.

This bug's PR is dev-approved and not yet merged, so I'm following issue DPTP-660 to do the pre-merge verifying for QE pre-merge verification goal of issue OCPQE-815 by using the bot to launch one 4.6 cluster with the open PR. after the cluster is ready, did the following verification steps:

To create a CRD in apiextensions.k8s.io/v1beta1:

- with a structural schema
- but without preserveUnknownFields being set at all
$ cat crd.yaml
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
  name: testcrs.example.com
spec:
  group: example.com
  names:
    kind: TestCR
    plural: testcrs
  scope: Namespaced
  validation:
    openAPIV3Schema:
      type: object
      description: this is description for the crd
      properties:
        spec:
          type: object
          description: this is description for spec
          properties:
            a:
              type: string
              description: this is description for field a
  version: v1
  versions:
  - name: v1
    served: true
    storage: true

$ oc create -f crd.yaml

Then check oc explain, indeed cannot show description of fields.
Then check oc get crd testcrs.example.com -o yaml, 4.6.0-0.ci.test-2020-10-29-093230-ci-ln-hw6j6fb env shows condition NonStructuralSchema as below, this is expected by the PR (4.6.0-0.nightly-2020-10-14-095718 env does not show it).
...
spec:
...
  preserveUnknownFields: true
...
  conditions:
  ...
  - lastTransitionTime: "2020-10-29T10:52:41Z"
  message: 'spec.preserveUnknownFields: Invalid value: true: must be false'
  reason: Violations
  status: "True"
  type: NonStructuralSchema

So the bug is pre-merge verified. After the PR gets merged, the bug will be moved to VERIFIED by the bot automatically or, if not working, by me manually.

Comment 4 Stefan Schimanski 2021-01-12 09:34:12 UTC
This will be solved in 4.7. We won't backport it due to complexity and capacity. Severity is low.


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