Description of problem: Shouldn't be allowed to create MDB with negative number of minAvailable Version-Release number of selected component (if applicable): 4.2.0-0.nightly-2019-07-25-053632 How reproducible: Always Steps to Reproduce: 1. Create MDB with negative number of minAvailable: apiVersion: healthchecking.openshift.io/v1alpha1 kind: MachineDisruptionBudget metadata: name: mdb-test1 namespace: openshift-machine-api spec: selector: matchLabels: machine.openshift.io/cluster-api-machine-role: worker minAvailable: -3 Actual results: Create success. Expected results: Should fail. Additional info:
Until OpenAPI v3 validation schemas are beta in 1.15 or we introduce webhook validation we can only fail and report accordingly
This constrain can be fortunately already expressed in CRD: https://github.com/openshift/machine-api-operator/pull/364
Verified. $ oc get clusterversion NAME VERSION AVAILABLE PROGRESSING SINCE STATUS version 4.2.0-0.nightly-2019-07-31-162901 True False 8m4s Cluster version is 4.2.0-0.nightly-2019-07-31-162901 $ oc create -f mdb.yaml The MachineDisruptionBudget "mdb-test1" is invalid: []: Invalid value: map[string]interface {}{"apiVersion":"healthchecking.openshift.io/v1alpha1", "kind":"MachineDisruptionBudget", "metadata":map[string]interface {}{"creationTimestamp":"2019-08-01T01:25:40Z", "generation":1, "name":"mdb-test1", "namespace":"openshift-machine-api", "uid":"464434d1-b3fb-11e9-9c63-022d83138dda"}, "spec":map[string]interface {}{"minAvailable":-3, "selector":map[string]interface {}{"matchLabels":map[string]interface {}{"machine.openshift.io/cluster-api-machine-role":"worker"}}}}: validation failure list: spec.minAvailable in body should be greater than or equal to 0
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