Skip to content

Commit

Permalink
truncate pod name
Browse files Browse the repository at this point in the history
  • Loading branch information
r2k1 committed Dec 3, 2024
1 parent 4e2ed8d commit f67dcac
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions e2e/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ func getPodNetworkDebugPodNameForVMSS(ctx context.Context, kube *Kubeclient, vms

func ensurePod(ctx context.Context, s *Scenario, pod *corev1.Pod) {
kube := s.Runtime.Cluster.Kube
if len(pod.Name) > 63 {
pod.Name = pod.Name[:63]
s.T.Logf("truncated pod name to %q", pod.Name)
}
s.T.Logf("creating pod %q", pod.Name)
_, err := kube.Typed.CoreV1().Pods(pod.Namespace).Create(ctx, pod, metav1.CreateOptions{})
require.NoErrorf(s.T, err, "failed to create pod %q", pod.Name)
Expand Down

0 comments on commit f67dcac

Please sign in to comment.