|
| 1 | +apiVersion: apiextensions.k8s.io/v1 # Hack because controller-gen complains if we don't have this |
| 2 | +name: "[TechPreview] OSStreams" |
| 3 | +crdName: machineconfigpools.machineconfiguration.openshift.io |
| 4 | +featureGates: |
| 5 | +- OSStreams |
| 6 | +tests: |
| 7 | + onCreate: |
| 8 | + - name: Should be able to create a minimal MachineConfigPool |
| 9 | + initial: | |
| 10 | + apiVersion: machineconfiguration.openshift.io/v1 |
| 11 | + kind: MachineConfigPool |
| 12 | + spec: {} # No spec is required for a MachineConfigPool |
| 13 | + expected: | |
| 14 | + apiVersion: machineconfiguration.openshift.io/v1 |
| 15 | + kind: MachineConfigPool |
| 16 | + spec: {} |
| 17 | + - name: Should be able to select a non-default osImageStream |
| 18 | + initial: | |
| 19 | + apiVersion: machineconfiguration.openshift.io/v1 |
| 20 | + kind: MachineConfigPool |
| 21 | + spec: |
| 22 | + osImageStream: "rhel10-coreos" |
| 23 | + expected: | |
| 24 | + apiVersion: machineconfiguration.openshift.io/v1 |
| 25 | + kind: MachineConfigPool |
| 26 | + spec: |
| 27 | + osImageStream: "rhel10-coreos" |
| 28 | + - name: If given, the osImageStream must be non-empty |
| 29 | + initial: | |
| 30 | + apiVersion: machineconfiguration.openshift.io/v1 |
| 31 | + kind: MachineConfigPool |
| 32 | + spec: |
| 33 | + osImageStream: "" |
| 34 | + expectedError: "spec.osImageStream in body should be at least 1 chars long" |
| 35 | + - name: If given, the osImageStream should be composed only by alphanumeric chars, hyphens and dots |
| 36 | + initial: | |
| 37 | + apiVersion: machineconfiguration.openshift.io/v1 |
| 38 | + kind: MachineConfigPool |
| 39 | + spec: |
| 40 | + osImageStream: "rhel10#1-coreos" |
| 41 | + expectedError: "spec.osImageStream: Invalid value: \"string\": The osImageStream must start with a letter and contain only alphanumeric characters, hyphens ('-'), and dots ('.')." |
| 42 | + - name: If given, the osImageStream should not exceed 70 characters |
| 43 | + initial: | |
| 44 | + apiVersion: machineconfiguration.openshift.io/v1 |
| 45 | + kind: MachineConfigPool |
| 46 | + spec: |
| 47 | + osImageStream: "rhel-coreos32131e2ddf34f44r3r3r4f43tg54frg54tg45454g4g45gt34f43g54g45g3" |
| 48 | + expectedError: "Too long: may not be more than 70 bytes" |
| 49 | + onUpdate: |
| 50 | + - name: If given, the osImageStream can be removed |
| 51 | + initial: | |
| 52 | + apiVersion: machineconfiguration.openshift.io/v1 |
| 53 | + kind: MachineConfigPool |
| 54 | + spec: |
| 55 | + osImageStream: "rhel10-coreos" |
| 56 | + updated: | |
| 57 | + apiVersion: machineconfiguration.openshift.io/v1 |
| 58 | + kind: MachineConfigPool |
| 59 | + spec: {} |
| 60 | + expected: | |
| 61 | + apiVersion: machineconfiguration.openshift.io/v1 |
| 62 | + kind: MachineConfigPool |
| 63 | + spec: {} |
| 64 | + - name: If not present, the osImageStream can be added to the pool |
| 65 | + initial: | |
| 66 | + apiVersion: machineconfiguration.openshift.io/v1 |
| 67 | + kind: MachineConfigPool |
| 68 | + spec: {} |
| 69 | + updated: | |
| 70 | + apiVersion: machineconfiguration.openshift.io/v1 |
| 71 | + kind: MachineConfigPool |
| 72 | + spec: |
| 73 | + osImageStream: "rhel10-coreos" |
| 74 | + expected: | |
| 75 | + apiVersion: machineconfiguration.openshift.io/v1 |
| 76 | + kind: MachineConfigPool |
| 77 | + spec: |
| 78 | + osImageStream: "rhel10-coreos" |
0 commit comments