Bug 1755125 - Schema change in ClusterResourceQuota from 4.1 to 4.2 results in breakage
Summary: Schema change in ClusterResourceQuota from 4.1 to 4.2 results in breakage
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: openshift-apiserver
Version: 4.2.0
Hardware: Unspecified
OS: Unspecified
urgent
urgent
Target Milestone: ---
: 4.2.0
Assignee: Stefan Schimanski
QA Contact: Peter Ruan
URL:
Whiteboard:
Depends On: 1756417
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-09-24 20:13 UTC by Lisa Seelye
Modified: 2019-10-16 06:42 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-10-16 06:41:50 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift cluster-config-operator pull 91 0 None None None 2019-09-25 08:52:36 UTC
Red Hat Product Errata RHBA-2019:2922 0 None None None 2019-10-16 06:42:07 UTC

Description Lisa Seelye 2019-09-24 20:13:51 UTC
Description of problem:

While using build 4.2.0-0.nightly-2019-09-17-212934 (verified later with 4.2.0-0.nightly-2019-09-23-154647) it was noticed that the schema appears to have changed for the ClusterResourceQuota object compared to 4.1.16. Specifically, spec.quota.hard.

The change appears to be a requirement that the value of that attribute be expressed as a string, when previously, an integer was acceptable. This causes a breakage for SRE on new OSD clusters created with a 4.2 image as the cluster quota configuration is applied (c.f., https://github.com/openshift/managed-cluster-config/blob/840d1c7dd7dfb268dbf678ff3ff8135540a4e1db/deploy/resource-quotas/15-resource.clusterresourcequota.yaml)

The behaviour of clusters upgraded from 4.1.16 to 4.2 is that for ClusterResourceQuota configurations which were already applied, they have no error.


Version-Release number of selected component (if applicable):

* 4.2.0-0.nightly-2019-09-17-212934
* 4.2.0-0.nightly-2019-09-23-154647

I don't know if this is apparent in earlier versions.

How reproducible:

Every time.


Steps to Reproduce:
1. Install a new cluster with a 4.2.0 nightly image and attempt to apply this manifest:

kind: ClusterResourceQuota
apiVersion: quota.openshift.io/v1
metadata:
  name: loadbalancer-quota
spec:
  selector:
    annotations: null
    labels:
      matchExpressions:
      - key: managed.openshift.io/service-lb-quota-exempt
        operator: DoesNotExist
  quota:
    hard:
      services.loadbalancers: 2


2. Observe error:
The ClusterResourceQuota "loadbalancer-quota" is invalid: []: Invalid value: map[string]interface {}{"apiVersion":"quota.openshift.io/v1", "kind":"ClusterResourceQuota", "metadata":map[string]interface {}{"annotations":map[string]interface {}{"kubectl.kubernetes.io/last-applied-configuration":"{\"apiVersion\":\"quota.openshift.io/v1\",\"kind\":\"ClusterResourceQuota\",\"metadata\":{\"annotations\":{},\"name\":\"loadbalancer-quota\"},\"spec\":{\"quota\":{\"hard\":{\"services.loadbalancers\":2}},\"selector\":{\"annotations\":null,\"labels\":{\"matchExpressions\":[{\"key\":\"managed.openshift.io/service-lb-quota-exempt\",\"operator\":\"DoesNotExist\"}]}}}}\n"}, "creationTimestamp":"2019-09-24T20:10:26Z", "generation":1, "name":"loadbalancer-quota", "uid":"58e43920-df07-11e9-942e-02f4d851fc82"}, "spec":map[string]interface {}{"quota":map[string]interface {}{"hard":map[string]interface {}{"services.loadbalancers":2}}, "selector":map[string]interface {}{"annotations":interface {}(nil), "labels":map[string]interface {}{"matchExpressions":[]interface {}{map[string]interface {}{"key":"managed.openshift.io/service-lb-quota-exempt", "operator":"DoesNotExist"}}}}}}: validation failure list:
spec.quota.hard.services.loadbalancers in body must be of type string: "integer"




Actual results:

spec.quota.hard.services.loadbalancers in body must be of type string: "integer"


Expected results:

clusterresourcequota.quota.openshift.io/loadbalancer-quota created


Additional info:

Comment 8 Peter Ruan 2019-10-01 19:12:43 UTC
verified with 

oc apply -f <yaml_above>

Client Version: openshift-clients-4.3.0-201909231341
Server Version: 4.2.0-0.nightly-2019-10-01-124419
Kubernetes Version: v1.14.6+b136e8b

Comment 9 errata-xmlrpc 2019-10-16 06:41:50 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, 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:2922


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