Skip to content

Commit

Permalink
[TEP-0089] Enable SPIRE for signing taskrun results in alpha.
Browse files Browse the repository at this point in the history
Breaking down PR tektoncd#4759 originally proposed by @pxp928 to address TEP-0089 according @lumjjb suggestions. Plan for breaking down PR is PR 1.1: api PR 1.2: entrypointer (+cmd line + test/entrypointer) Entrypoint takes results and signs the results (termination message). PR 1.3: reconciler + pod + cmd/controller + integration tests Controller will verify the signed result. This commit corresponds to 1.3 above.
  • Loading branch information
jagathprakash committed Nov 7, 2022
1 parent 1a5d0a9 commit b0de69e
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions pkg/reconciler/taskrun/taskrun_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1420,7 +1420,7 @@ spec:

d := test.Data{
ConfigMaps: cms,
TaskRuns: []*v1beta1.TaskRun{tr},
TaskRuns: []*v1beta1.TaskRun{tr},
ServiceAccounts: []*corev1.ServiceAccount{{
ObjectMeta: metav1.ObjectMeta{Name: tr.Spec.ServiceAccountName, Namespace: "foo"},
}},
Expand Down Expand Up @@ -1528,7 +1528,7 @@ spec:

d := test.Data{
ConfigMaps: cms,
TaskRuns: []*v1beta1.TaskRun{tr},
TaskRuns: []*v1beta1.TaskRun{tr},
ServiceAccounts: []*corev1.ServiceAccount{{
ObjectMeta: metav1.ObjectMeta{Name: tr.Spec.ServiceAccountName, Namespace: "foo"},
}},
Expand Down
2 changes: 1 addition & 1 deletion test/embed_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func embeddedResourceTest(t *testing.T, spireEnabled bool) {
// completion of the TaskRun means the TaskRun did what it was intended.

if spireEnabled {
tr, err := c.TaskRunClient.Get(ctx, embedTaskRunName, metav1.GetOptions{})
tr, err := c.V1beta1TaskRunClient.Get(ctx, embedTaskRunName, metav1.GetOptions{})
if err != nil {
t.Errorf("Error retrieving taskrun: %s", err)
}
Expand Down
2 changes: 1 addition & 1 deletion test/helm_task_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func helmDeploytest(t *testing.T, spireEnabled bool) {
}

if spireEnabled {
taskrunList, err := c.TaskRunClient.List(ctx, metav1.ListOptions{LabelSelector: "tekton.dev/pipelineRun=" + helmDeployPipelineRunName})
taskrunList, err := c.V1beta1TaskRunClient.List(ctx, metav1.ListOptions{LabelSelector: "tekton.dev/pipelineRun=" + helmDeployPipelineRunName})
if err != nil {
t.Fatalf("Error listing TaskRuns for PipelineRun %s: %s", helmDeployPipelineRunName, err)
}
Expand Down
4 changes: 2 additions & 2 deletions test/pipelinerun_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ spec:
}

if spireEnabled {
taskrunList, err := c.TaskRunClient.List(ctx, metav1.ListOptions{LabelSelector: "tekton.dev/pipelineRun=" + prName})
taskrunList, err := c.V1beta1TaskRunClient.List(ctx, metav1.ListOptions{LabelSelector: "tekton.dev/pipelineRun=" + prName})
if err != nil {
t.Fatalf("Error listing TaskRuns for PipelineRun %s: %s", prName, err)
}
Expand Down Expand Up @@ -670,7 +670,7 @@ spec:
t.Fatalf("Error waiting for PipelineRun %s to finish: %s", prName, err)
}
if spireEnabled {
taskrunList, err := c.TaskRunClient.List(ctx, metav1.ListOptions{LabelSelector: "tekton.dev/pipelineRun=" + prName})
taskrunList, err := c.V1beta1TaskRunClient.List(ctx, metav1.ListOptions{LabelSelector: "tekton.dev/pipelineRun=" + prName})
if err != nil {
t.Fatalf("Error listing TaskRuns for PipelineRun %s: %s", prName, err)
}
Expand Down
3 changes: 3 additions & 0 deletions test/taskrun_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,22 @@ package test

import (
"context"
"encoding/json"
"fmt"
"regexp"
"strings"
"testing"

"github.com/tektoncd/pipeline/test/parse"
jsonpatch "gomodules.xyz/jsonpatch/v2"

"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
"github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1"
"github.com/tektoncd/pipeline/pkg/pod"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
knativetest "knative.dev/pkg/test"
"knative.dev/pkg/test/helpers"
)
Expand Down

0 comments on commit b0de69e

Please sign in to comment.