Make the warning about pod name clearer

Previously this was cut-paste from deployment.  It didn't make much
sense for pod.
This commit is contained in:
Tim Hockin 2022-12-25 14:16:44 -08:00
parent d2504c94a0
commit 7c7d79b058
No known key found for this signature in database

View File

@ -114,7 +114,7 @@ func (podStrategy) WarningsOnCreate(ctx context.Context, obj runtime.Object) []s
newPod := obj.(*api.Pod)
var warnings []string
if msgs := utilvalidation.IsDNS1123Label(newPod.Name); len(msgs) != 0 {
warnings = append(warnings, fmt.Sprintf("metadata.name: this is used in Pod names and hostnames, which can result in surprising behavior; a DNS label is recommended: %v", msgs))
warnings = append(warnings, fmt.Sprintf("metadata.name: this is used in the Pod's hostname, which can result in surprising behavior; a DNS label is recommended: %v", msgs))
}
warnings = append(warnings, podutil.GetWarningsForPod(ctx, newPod, nil)...)
return warnings