|
| 1 | +apiVersion: apiextensions.k8s.io/v1 # Hack because controller-gen complains if we don't have this |
| 2 | +name: "[TechPreview] InternalReleaseImage" |
| 3 | +crdName: internalreleaseimages.machineconfiguration.openshift.io |
| 4 | +featureGate: NoRegistryClusterOperations |
| 5 | +tests: |
| 6 | + onCreate: |
| 7 | + - name: Should be able to create a minimal InternalReleaseImage |
| 8 | + initial: | |
| 9 | + apiVersion: machineconfiguration.openshift.io/v1alpha1 |
| 10 | + kind: InternalReleaseImage |
| 11 | + spec: |
| 12 | + releases: |
| 13 | + - name: ocp-release-bundle-4.18.0-x86_64 |
| 14 | + expected: | |
| 15 | + apiVersion: machineconfiguration.openshift.io/v1alpha1 |
| 16 | + kind: InternalReleaseImage |
| 17 | + spec: |
| 18 | + releases: |
| 19 | + - name: ocp-release-bundle-4.18.0-x86_64 |
| 20 | + - name: Invalid undefined releases |
| 21 | + initial: | |
| 22 | + apiVersion: machineconfiguration.openshift.io/v1alpha1 |
| 23 | + kind: InternalReleaseImage |
| 24 | + spec: |
| 25 | + expectedError: "spec: Required value" |
| 26 | + - name: Invalid empty release name |
| 27 | + initial: | |
| 28 | + apiVersion: machineconfiguration.openshift.io/v1alpha1 |
| 29 | + kind: InternalReleaseImage |
| 30 | + spec: |
| 31 | + releases: |
| 32 | + - name: "" |
| 33 | + expectedError: "Invalid value: \"\": spec.releases[0].name in body should be at least 1 chars long" |
| 34 | + - name: Should reject duplicate releases |
| 35 | + initial: | |
| 36 | + apiVersion: machineconfiguration.openshift.io/v1alpha1 |
| 37 | + kind: InternalReleaseImage |
| 38 | + spec: |
| 39 | + releases: |
| 40 | + - name: ocp-release-bundle-4.18.0-x86_64 |
| 41 | + - name: ocp-release-bundle-4.18.0-x86_64 |
| 42 | + expectedError: "Duplicate value: map[string]interface {}{\"name\":\"ocp-release-bundle-4.18.0-x86_64\"}" |
| 43 | + |
0 commit comments