mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-12 01:14:22 +00:00
Merge pull request #482 from Liujingfang1/validators
fix kustomize edit add label bug
This commit is contained in:
@@ -37,7 +37,7 @@ func NewKustValidator() *KustValidator {
|
|||||||
func (v *KustValidator) MakeAnnotationValidator() func(map[string]string) error {
|
func (v *KustValidator) MakeAnnotationValidator() func(map[string]string) error {
|
||||||
return func(x map[string]string) error {
|
return func(x map[string]string) error {
|
||||||
errs := apivalidation.ValidateAnnotations(x, field.NewPath("field"))
|
errs := apivalidation.ValidateAnnotations(x, field.NewPath("field"))
|
||||||
if errs != nil {
|
if len(errs) > 0 {
|
||||||
return errors.New(errs.ToAggregate().Error())
|
return errors.New(errs.ToAggregate().Error())
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
@@ -48,7 +48,7 @@ func (v *KustValidator) MakeAnnotationValidator() func(map[string]string) error
|
|||||||
func (v *KustValidator) MakeLabelValidator() func(map[string]string) error {
|
func (v *KustValidator) MakeLabelValidator() func(map[string]string) error {
|
||||||
return func(x map[string]string) error {
|
return func(x map[string]string) error {
|
||||||
errs := v1validation.ValidateLabels(x, field.NewPath("field"))
|
errs := v1validation.ValidateLabels(x, field.NewPath("field"))
|
||||||
if errs != nil {
|
if len(errs) > 0 {
|
||||||
return errors.New(errs.ToAggregate().Error())
|
return errors.New(errs.ToAggregate().Error())
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
Reference in New Issue
Block a user