fix/log-severity
Signed-off-by: learner0810 <zhongjun.li@daocloud.io>
This commit is contained in:
parent
721215c3e1
commit
3ffa9dc95f
|
@ -35,14 +35,14 @@ func (v *ValidatingAdmission) Handle(ctx context.Context, req admission.Request)
|
|||
|
||||
if errs := validation.ValidateClusterName(cluster.Name); len(errs) != 0 {
|
||||
errMsg := fmt.Sprintf("invalid cluster name(%s): %s", cluster.Name, strings.Join(errs, ";"))
|
||||
klog.Info(errMsg)
|
||||
klog.Error(errMsg)
|
||||
return admission.Denied(errMsg)
|
||||
}
|
||||
|
||||
if len(cluster.Spec.ProxyURL) > 0 {
|
||||
if errs := validation.ValidateClusterProxyURL(cluster.Spec.ProxyURL); len(errs) != 0 {
|
||||
errMsg := fmt.Sprintf("invalid proxy URL(%s): %s", cluster.Spec.ProxyURL, strings.Join(errs, ";"))
|
||||
klog.Info(errMsg)
|
||||
klog.Error(errMsg)
|
||||
return admission.Denied(errMsg)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -41,13 +41,13 @@ func (v *ValidatingAdmission) Handle(ctx context.Context, req admission.Request)
|
|||
return admission.Errored(http.StatusBadRequest, err)
|
||||
}
|
||||
if !equality.Semantic.DeepEqual(policy.Spec.ResourceSelectors, oldPolicy.Spec.ResourceSelectors) {
|
||||
klog.Info(helper.DenyReasonResourceSelectorsModify)
|
||||
klog.Error(helper.DenyReasonResourceSelectorsModify)
|
||||
return admission.Denied(helper.DenyReasonResourceSelectorsModify)
|
||||
}
|
||||
}
|
||||
|
||||
if err := helper.ValidateSpreadConstraint(policy.Spec.Placement.SpreadConstraints); err != nil {
|
||||
klog.Info(err)
|
||||
klog.Error(err)
|
||||
return admission.Denied(err.Error())
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue