mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 04:06:03 +00:00
Merge pull request #54218 from CaoShuFeng/stra
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. fix error message of custrom resource validation /assign @deads2k /assign @sttts **Release note**: ``` NONE ```
This commit is contained in:
commit
194f3983f0
@ -135,7 +135,7 @@ func (a customResourceValidator) Validate(ctx genericapirequest.Context, obj run
|
||||
return field.ErrorList{field.Invalid(field.NewPath("kind"), typeAccessor.GetKind(), fmt.Sprintf("must be %v", a.kind.Kind))}
|
||||
}
|
||||
if typeAccessor.GetAPIVersion() != a.kind.Group+"/"+a.kind.Version {
|
||||
return field.ErrorList{field.Invalid(field.NewPath("apiVersion"), typeAccessor.GetKind(), fmt.Sprintf("must be %v", a.kind.Group+"/"+a.kind.Version))}
|
||||
return field.ErrorList{field.Invalid(field.NewPath("apiVersion"), typeAccessor.GetAPIVersion(), fmt.Sprintf("must be %v", a.kind.Group+"/"+a.kind.Version))}
|
||||
}
|
||||
|
||||
customResourceObject, ok := obj.(*unstructured.Unstructured)
|
||||
@ -169,7 +169,7 @@ func (a customResourceValidator) ValidateUpdate(ctx genericapirequest.Context, o
|
||||
return field.ErrorList{field.Invalid(field.NewPath("kind"), typeAccessor.GetKind(), fmt.Sprintf("must be %v", a.kind.Kind))}
|
||||
}
|
||||
if typeAccessor.GetAPIVersion() != a.kind.Group+"/"+a.kind.Version {
|
||||
return field.ErrorList{field.Invalid(field.NewPath("apiVersion"), typeAccessor.GetKind(), fmt.Sprintf("must be %v", a.kind.Group+"/"+a.kind.Version))}
|
||||
return field.ErrorList{field.Invalid(field.NewPath("apiVersion"), typeAccessor.GetAPIVersion(), fmt.Sprintf("must be %v", a.kind.Group+"/"+a.kind.Version))}
|
||||
}
|
||||
|
||||
customResourceObject, ok := obj.(*unstructured.Unstructured)
|
||||
|
Loading…
Reference in New Issue
Block a user