...
1apiVersion: apiextensions.k8s.io/v1 # Hack because controller-gen complains if we don't have this
2name: "[Stable] ClusterVersion"
3crd: 0000_00_cluster-version-operator_01_clusterversion.crd.yaml
4tests:
5 onCreate:
6 - name: Should be able to create a minimal ClusterVersion
7 initial: |
8 apiVersion: config.openshift.io/v1
9 kind: ClusterVersion
10 spec:
11 clusterID: foo
12 expected: |
13 apiVersion: config.openshift.io/v1
14 kind: ClusterVersion
15 spec:
16 clusterID: foo
17 - name: Should allow image to be set
18 initial: |
19 apiVersion: config.openshift.io/v1
20 kind: ClusterVersion
21 spec:
22 clusterID: foo
23 desiredUpdate:
24 image: bar
25 expected: |
26 apiVersion: config.openshift.io/v1
27 kind: ClusterVersion
28 spec:
29 clusterID: foo
30 desiredUpdate:
31 image: bar
32 - name: Should allow version to be set
33 initial: |
34 apiVersion: config.openshift.io/v1
35 kind: ClusterVersion
36 spec:
37 clusterID: foo
38 desiredUpdate:
39 version: 4.11.1
40 expected: |
41 apiVersion: config.openshift.io/v1
42 kind: ClusterVersion
43 spec:
44 clusterID: foo
45 desiredUpdate:
46 version: 4.11.1
47 - name: Should allow architecture to be empty
48 initial: |
49 apiVersion: config.openshift.io/v1
50 kind: ClusterVersion
51 spec:
52 clusterID: foo
53 desiredUpdate:
54 architecture: ""
55 version: 4.11.1
56 expected: |
57 apiVersion: config.openshift.io/v1
58 kind: ClusterVersion
59 spec:
60 clusterID: foo
61 desiredUpdate:
62 architecture: ""
63 version: 4.11.1
64 - name: Should allow architecture and version to be set
65 initial: |
66 apiVersion: config.openshift.io/v1
67 kind: ClusterVersion
68 spec:
69 clusterID: foo
70 desiredUpdate:
71 architecture: Multi
72 version: 4.11.1
73 expected: |
74 apiVersion: config.openshift.io/v1
75 kind: ClusterVersion
76 spec:
77 clusterID: foo
78 desiredUpdate:
79 architecture: Multi
80 version: 4.11.1
81 - name: Version must be set if architecture is set
82 initial: |
83 apiVersion: config.openshift.io/v1
84 kind: ClusterVersion
85 spec:
86 clusterID: foo
87 desiredUpdate:
88 architecture: Multi
89 expectedError: "Version must be set if Architecture is set"
90 - name: Should not allow image and architecture to be set
91 initial: |
92 apiVersion: config.openshift.io/v1
93 kind: ClusterVersion
94 spec:
95 clusterID: foo
96 desiredUpdate:
97 architecture: Multi
98 version: 4.11.1
99 image: bar
100 expectedError: "cannot set both Architecture and Image"
101 onUpdate:
102 - name: Should not allow image to be set if architecture set
103 initial: |
104 apiVersion: config.openshift.io/v1
105 kind: ClusterVersion
106 spec:
107 clusterID: foo
108 desiredUpdate:
109 architecture: Multi
110 version: 4.11.1
111 updated: |
112 apiVersion: config.openshift.io/v1
113 kind: ClusterVersion
114 spec:
115 clusterID: foo
116 desiredUpdate:
117 architecture: Multi
118 version: 4.11.1
119 image: bar
120 expectedError: "cannot set both Architecture and Image"
121 - name: Should not allow architecture to be set if image set
122 initial: |
123 apiVersion: config.openshift.io/v1
124 kind: ClusterVersion
125 spec:
126 clusterID: foo
127 desiredUpdate:
128 image: bar
129 updated: |
130 apiVersion: config.openshift.io/v1
131 kind: ClusterVersion
132 spec:
133 clusterID: foo
134 desiredUpdate:
135 architecture: Multi
136 version: 4.11.1
137 image: bar
138 expectedError: "cannot set both Architecture and Image"
View as plain text