diff --git a/pkg/pod/creds_init.go b/pkg/pod/creds_init.go index 376a1508473..eb3b853fbf4 100644 --- a/pkg/pod/creds_init.go +++ b/pkg/pod/creds_init.go @@ -65,7 +65,7 @@ func credsInit(credsImage string, serviceAccountName, namespace string, kubeclie } if matched { - name := names.SimpleNameGenerator.RestrictLength(fmt.Sprintf("tekton-internal-secret-volume-%s", secret.Name)) + name := names.SimpleNameGenerator.RestrictLengthWithRandomSuffix(fmt.Sprintf("tekton-internal-secret-volume-%s", secret.Name)) volumeMounts = append(volumeMounts, corev1.VolumeMount{ Name: name, MountPath: credentials.VolumeName(secret.Name), diff --git a/pkg/pod/creds_init_test.go b/pkg/pod/creds_init_test.go index 22fa8ad53cd..b72681bb5fe 100644 --- a/pkg/pod/creds_init_test.go +++ b/pkg/pod/creds_init_test.go @@ -110,7 +110,7 @@ func TestCredsInit(t *testing.T) { }, Env: envVars, VolumeMounts: append(volumeMounts, corev1.VolumeMount{ - Name: "tekton-internal-secret-volume-my-creds", + Name: "tekton-internal-secret-volume-my-creds-9l9zj", MountPath: "/tekton/creds-secrets/my-creds", }), }, diff --git a/pkg/pod/pod_test.go b/pkg/pod/pod_test.go index 942c4a2e700..8bd14f1a86c 100644 --- a/pkg/pod/pod_test.go +++ b/pkg/pod/pod_test.go @@ -45,11 +45,11 @@ func TestMakePod(t *testing.T) { names.TestingSeed() secretsVolumeMount := corev1.VolumeMount{ - Name: "tekton-internal-secret-volume-multi-creds", + Name: "tekton-internal-secret-volume-multi-creds-9l9zj", MountPath: "/tekton/creds-secrets/multi-creds", } secretsVolume := corev1.Volume{ - Name: "tekton-internal-secret-volume-multi-creds", + Name: "tekton-internal-secret-volume-multi-creds-9l9zj", VolumeSource: corev1.VolumeSource{Secret: &corev1.SecretVolumeSource{SecretName: "multi-creds"}}, } diff --git a/pkg/reconciler/taskrun/taskrun.go b/pkg/reconciler/taskrun/taskrun.go index 30823d88f96..526a7e459b9 100644 --- a/pkg/reconciler/taskrun/taskrun.go +++ b/pkg/reconciler/taskrun/taskrun.go @@ -539,7 +539,7 @@ func (c *Reconciler) createPod(tr *v1alpha1.TaskRun, rtr *resources.ResolvedTask pod, err := podconvert.MakePod(c.Images, tr, *ts, c.KubeClientSet, c.entrypointCache) if err != nil { - return nil, fmt.Errorf("translating Build to Pod: %w", err) + return nil, fmt.Errorf("translating TaskSpec to Pod: %w", err) } return c.KubeClientSet.CoreV1().Pods(tr.Namespace).Create(pod)