7777 defaultRuntime: runc
7878 logLevel: info
7979 onUpdate :
80- - name : Should not be able to update from default to invalid value
80+ - name : Case 1 - Change another field - Should be able to update other parameters with invalid defaultRuntime
8181 initialCRDPatches :
8282 - op : remove
8383 path : /spec/versions/0/schema/openAPIV3Schema/properties/spec/properties/containerRuntimeConfig/properties/defaultRuntime/enum
8686 kind: ContainerRuntimeConfig
8787 spec:
8888 containerRuntimeConfig:
89- defaultRuntime: crun
89+ defaultRuntime: docker
9090 logLevel: fatal
9191 updated : |
9292 apiVersion: machineconfiguration.openshift.io/v1
@@ -95,26 +95,14 @@ tests:
9595 containerRuntimeConfig:
9696 defaultRuntime: docker
9797 logLevel: info
98- expectedError : " Unsupported value: \" docker\" : supported values: \" crun\" , \" runc\" "
99- - name : Should be able to update from not set to default when other params are set
100- initial : |
101- apiVersion: machineconfiguration.openshift.io/v1
102- kind: ContainerRuntimeConfig
103- spec:
104- containerRuntimeConfig: {}
105- updated : |
106- apiVersion: machineconfiguration.openshift.io/v1
107- kind: ContainerRuntimeConfig
108- spec:
109- containerRuntimeConfig:
110- logLevel: info
11198 expected : |
11299 apiVersion: machineconfiguration.openshift.io/v1
113100 kind: ContainerRuntimeConfig
114101 spec:
115102 containerRuntimeConfig:
103+ defaultRuntime: docker
116104 logLevel: info
117- - name : Should be able to update from runc to crun with other parameters
105+ - name : Case 2 - Remove the field - Should be able to update from invalid to removed
118106 initialCRDPatches :
119107 - op : remove
120108 path : /spec/versions/0/schema/openAPIV3Schema/properties/spec/properties/containerRuntimeConfig/properties/defaultRuntime/enum
@@ -123,23 +111,18 @@ tests:
123111 kind: ContainerRuntimeConfig
124112 spec:
125113 containerRuntimeConfig:
126- defaultRuntime: runc
127- logLevel: fatal
114+ defaultRuntime: docker
128115 updated : |
129116 apiVersion: machineconfiguration.openshift.io/v1
130117 kind: ContainerRuntimeConfig
131118 spec:
132- containerRuntimeConfig:
133- defaultRuntime: crun
134- logLevel: info
119+ containerRuntimeConfig: {}
135120 expected : |
136121 apiVersion: machineconfiguration.openshift.io/v1
137122 kind: ContainerRuntimeConfig
138123 spec:
139- containerRuntimeConfig:
140- defaultRuntime: crun
141- logLevel: info
142- - name : Should be able to update other parameters with invalid defaultRuntime
124+ containerRuntimeConfig: {}
125+ - name : Case 3 - Update the field - Should be able to update from invalid to correct value
143126 initialCRDPatches :
144127 - op : remove
145128 path : /spec/versions/0/schema/openAPIV3Schema/properties/spec/properties/containerRuntimeConfig/properties/defaultRuntime/enum
@@ -149,18 +132,15 @@ tests:
149132 spec:
150133 containerRuntimeConfig:
151134 defaultRuntime: docker
152- logLevel: fatal
153135 updated : |
154136 apiVersion: machineconfiguration.openshift.io/v1
155137 kind: ContainerRuntimeConfig
156138 spec:
157139 containerRuntimeConfig:
158- defaultRuntime: docker
159- logLevel: info
140+ defaultRuntime: runc
160141 expected : |
161142 apiVersion: machineconfiguration.openshift.io/v1
162143 kind: ContainerRuntimeConfig
163144 spec:
164145 containerRuntimeConfig:
165- defaultRuntime: docker
166- logLevel: info
146+ defaultRuntime: runc
0 commit comments