@@ -149,8 +149,11 @@ func getCodecForObject(obj runtime.Object) (runtime.Codec, error) {
149
149
150
150
func validateObject (obj runtime.Object ) (errors field.ErrorList ) {
151
151
podValidationOptions := validation.PodValidationOptions {
152
- AllowMultipleHugePageResources : true ,
153
- AllowDownwardAPIHugePages : true ,
152
+ AllowDownwardAPIHugePages : true ,
153
+ AllowInvalidPodDeletionCost : false ,
154
+ AllowIndivisibleHugePagesValues : true ,
155
+ AllowWindowsHostProcessField : true ,
156
+ AllowExpandedDNSConfig : true ,
154
157
}
155
158
156
159
quotaValidationOptions := validation.ResourceQuotaValidationOptions {
@@ -182,20 +185,23 @@ func validateObject(obj runtime.Object) (errors field.ErrorList) {
182
185
case * api.Namespace :
183
186
errors = validation .ValidateNamespace (t )
184
187
case * api.PersistentVolume :
185
- errors = validation .ValidatePersistentVolume (t )
188
+ opts := validation.PersistentVolumeSpecValidationOptions {
189
+ AllowReadWriteOncePod : true ,
190
+ }
191
+ errors = validation .ValidatePersistentVolume (t , opts )
186
192
case * api.PersistentVolumeClaim :
187
193
if t .Namespace == "" {
188
194
t .Namespace = api .NamespaceDefault
189
195
}
190
- errors = validation .ValidatePersistentVolumeClaim (t )
196
+ opts := validation.PersistentVolumeClaimSpecValidationOptions {
197
+ AllowReadWriteOncePod : true ,
198
+ }
199
+ errors = validation .ValidatePersistentVolumeClaim (t , opts )
191
200
case * api.Pod :
192
201
if t .Namespace == "" {
193
202
t .Namespace = api .NamespaceDefault
194
203
}
195
- opts := validation.PodValidationOptions {
196
- AllowMultipleHugePageResources : true ,
197
- }
198
- errors = validation .ValidatePodCreate (t , opts )
204
+ errors = validation .ValidatePodCreate (t , podValidationOptions )
199
205
case * api.PodList :
200
206
for i := range t .Items {
201
207
errors = append (errors , validateObject (& t .Items [i ])... )
0 commit comments