mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 12:15:52 +00:00
Merge pull request #114691 from thockin/fix-pod-warning-string
Make the warning about pod name clearer
This commit is contained in:
commit
564f438892
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user