Merge pull request #97020 from mikedanese/errfix

hoist error message change in token registry to noderestriction
This commit is contained in:
Kubernetes Prow Robot 2020-12-08 21:06:42 -08:00 committed by GitHub
commit 96efb71094
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -535,7 +535,7 @@ func (p *Plugin) admitServiceAccount(nodeName string, a admission.Attributes) er
return admission.NewForbidden(a, err) return admission.NewForbidden(a, err)
} }
if ref.UID != pod.UID { if ref.UID != pod.UID {
return admission.NewForbidden(a, fmt.Errorf("the UID in the bound object reference (%s) does not match the UID in record (%s). The object might have been deleted and then recreated", ref.UID, pod.UID)) return admission.NewForbidden(a, fmt.Errorf("the UID in the bound object reference (%s) does not match the UID in record. The object might have been deleted and then recreated", ref.UID))
} }
if pod.Spec.NodeName != nodeName { if pod.Spec.NodeName != nodeName {
return admission.NewForbidden(a, fmt.Errorf("node requested token bound to a pod scheduled on a different node")) return admission.NewForbidden(a, fmt.Errorf("node requested token bound to a pod scheduled on a different node"))