From b7badedd0f6536e68db47b674f46e57a8994b36d Mon Sep 17 00:00:00 2001 From: savitaashture Date: Tue, 27 Oct 2020 08:41:44 +0530 Subject: [PATCH] Update TestPipelineRunWithServiceAccountNameAndTaskRunSpec to use different podtemplate field --- test/serviceaccount_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/serviceaccount_test.go b/test/serviceaccount_test.go index bca6d4b5b86..6457c2c328d 100644 --- a/test/serviceaccount_test.go +++ b/test/serviceaccount_test.go @@ -262,6 +262,7 @@ func TestPipelineRunWithServiceAccountNameAndTaskRunSpec(t *testing.T) { t.Fatalf("Failed to create Pipeline `%s`: %s", pipeline.Name, err) } + dnsPolicy := corev1.DNSClusterFirst // Create a PipelineRun that uses those ServiceAccount pipelineRun := &v1beta1.PipelineRun{ ObjectMeta: metav1.ObjectMeta{Name: "pipelinerunwithasas", Namespace: namespace}, @@ -271,14 +272,13 @@ func TestPipelineRunWithServiceAccountNameAndTaskRunSpec(t *testing.T) { TaskRunSpecs: []v1beta1.PipelineTaskRunSpec{{ PipelineTaskName: "task1", TaskPodTemplate: &v1beta1.PodTemplate{ - HostNetwork: true, + DNSPolicy: &dnsPolicy, }, }}, }, } - _, err := c.PipelineRunClient.Create(ctx, pipelineRun, metav1.CreateOptions{}) - if err != nil { + if _, err := c.PipelineRunClient.Create(ctx, pipelineRun, metav1.CreateOptions{}); err != nil { t.Fatalf("Failed to create PipelineRun `%s`: %s", pipelineRun.Name, err) }