mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-04 09:49:50 +00:00
stricter swagger validation
This commit is contained in:
parent
d63e35247f
commit
8cdd403d9d
@ -123,10 +123,7 @@ func (s *SwaggerSchema) ValidateObject(obj interface{}, apiVersion, fieldName, t
|
|||||||
for key, value := range fields {
|
for key, value := range fields {
|
||||||
details, ok := properties.At(key)
|
details, ok := properties.At(key)
|
||||||
if !ok {
|
if !ok {
|
||||||
glog.Infof("unknown field: %s", key)
|
allErrs = append(allErrs, fmt.Errorf("found invalid field %s for %s", key, typeName))
|
||||||
// Some properties can be missing because of
|
|
||||||
// https://github.com/GoogleCloudPlatform/kubernetes/issues/6842.
|
|
||||||
glog.Info("this may be a false alarm, see https://github.com/GoogleCloudPlatform/kubernetes/issues/6842")
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if details.Type == nil && details.Ref == nil {
|
if details.Type == nil && details.Ref == nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user