Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Yongxuanzhang committed Nov 4, 2022
1 parent 1ee6c7f commit f32c768
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions test/trusted_resources_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ spec:

// create pipelines
fqImageName := getTestImage(busyboxImage)
task := parse.MustParseTask(t, fmt.Sprintf(`
task := parse.MustParseV1beta1Task(t, fmt.Sprintf(`
metadata:
name: %s
namespace: %s
Expand All @@ -269,11 +269,11 @@ spec:
if err != nil {
t.Errorf("error getting signed task: %v", err)
}
if _, err := c.TaskClient.Create(ctx, signedTask, metav1.CreateOptions{}); err != nil {
if _, err := c.V1beta1TaskClient.Create(ctx, signedTask, metav1.CreateOptions{}); err != nil {
t.Fatalf("Failed to create Task: %s", err)
}

pipeline := parse.MustParsePipeline(t, fmt.Sprintf(`
pipeline := parse.MustParseV1beta1Pipeline(t, fmt.Sprintf(`
metadata:
name: %s
namespace: %s
Expand All @@ -290,11 +290,11 @@ spec:
t.Errorf("error getting signed pipeline: %v", err)
}

if _, err := c.PipelineClient.Create(ctx, signedPipeline, metav1.CreateOptions{}); err != nil {
if _, err := c.V1beta1PipelineClient.Create(ctx, signedPipeline, metav1.CreateOptions{}); err != nil {
t.Fatalf("Failed to create Pipeline: %s", err)
}

pr := parse.MustParsePipelineRun(t, fmt.Sprintf(`
pr := parse.MustParseV1beta1PipelineRun(t, fmt.Sprintf(`
metadata:
name: %s
namespace: %s
Expand All @@ -304,7 +304,7 @@ spec:
`, helpers.ObjectNameForTest(t), namespace, signedPipeline.Name))

t.Logf("Creating PipelineRun %s", pr.Name)
if _, err := c.PipelineRunClient.Create(ctx, pr, metav1.CreateOptions{}); err != nil {
if _, err := c.V1beta1PipelineRunClient.Create(ctx, pr, metav1.CreateOptions{}); err != nil {
t.Fatalf("Failed to create PipelineRun `%s`: %s", pr.Name, err)
}

Expand All @@ -313,7 +313,7 @@ spec:
t.Errorf("Error waiting for PipelineRun to finish: %s", err)
}

pr, err = c.PipelineRunClient.Get(ctx, pr.Name, metav1.GetOptions{})
pr, err = c.V1beta1PipelineRunClient.Get(ctx, pr.Name, metav1.GetOptions{})
if err != nil {
t.Fatalf("Couldn't get expected PipelineRun %s: %s", pr.Name, err)
}
Expand Down Expand Up @@ -355,7 +355,7 @@ spec:

// create pipelines
fqImageName := getTestImage(busyboxImage)
task := parse.MustParseTask(t, fmt.Sprintf(`
task := parse.MustParseV1beta1Task(t, fmt.Sprintf(`
metadata:
name: %s
namespace: %s
Expand All @@ -372,11 +372,11 @@ spec:
}
// modify the task to fail the verification
signedTask.Annotations["foo"] = "bar"
if _, err := c.TaskClient.Create(ctx, signedTask, metav1.CreateOptions{}); err != nil {
if _, err := c.V1beta1TaskClient.Create(ctx, signedTask, metav1.CreateOptions{}); err != nil {
t.Fatalf("Failed to create Task: %s", err)
}

pipeline := parse.MustParsePipeline(t, fmt.Sprintf(`
pipeline := parse.MustParseV1beta1Pipeline(t, fmt.Sprintf(`
metadata:
name: %s
namespace: %s
Expand All @@ -393,11 +393,11 @@ spec:
t.Errorf("error getting signed pipeline: %v", err)
}

if _, err := c.PipelineClient.Create(ctx, signedPipeline, metav1.CreateOptions{}); err != nil {
if _, err := c.V1beta1PipelineClient.Create(ctx, signedPipeline, metav1.CreateOptions{}); err != nil {
t.Fatalf("Failed to create Pipeline: %s", err)
}

pr := parse.MustParsePipelineRun(t, fmt.Sprintf(`
pr := parse.MustParseV1beta1PipelineRun(t, fmt.Sprintf(`
metadata:
name: %s
namespace: %s
Expand All @@ -407,7 +407,7 @@ spec:
`, helpers.ObjectNameForTest(t), namespace, signedPipeline.Name))

t.Logf("Creating PipelineRun %s", pr.Name)
if _, err := c.PipelineRunClient.Create(ctx, pr, metav1.CreateOptions{}); err != nil {
if _, err := c.V1beta1PipelineRunClient.Create(ctx, pr, metav1.CreateOptions{}); err != nil {
t.Fatalf("Failed to create PipelineRun `%s`: %s", pr.Name, err)
}

Expand All @@ -416,7 +416,7 @@ spec:
t.Errorf("Error waiting for PipelineRun to finish: %s", err)
}

pr, err = c.PipelineRunClient.Get(ctx, pr.Name, metav1.GetOptions{})
pr, err = c.V1beta1PipelineRunClient.Get(ctx, pr.Name, metav1.GetOptions{})
if err != nil {
t.Fatalf("Couldn't get expected PipelineRun %s: %s", pr.Name, err)
}
Expand Down

0 comments on commit f32c768

Please sign in to comment.