Skip to content

Commit 1149d51

Browse files
committed
[TEP-0089] Enable SPIRE for signing taskrun results in alpha.
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. Signed-off-by: jagathprakash <[email protected]>
1 parent c0a05c2 commit 1149d51

File tree

2 files changed

+27
-2
lines changed

2 files changed

+27
-2
lines changed

pkg/apis/config/feature_flags.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@ const (
8080
DefaultSendCloudEventsForRuns = false
8181
// DefaultEmbeddedStatus is the default value for "embedded-status".
8282
DefaultEmbeddedStatus = FullEmbeddedStatus
83-
// EnableNonfalsifiabilityWithSpire is the value used for "enable-nonfalsifiability" when SPIRE is used to enable non-falsifiability.
83+
// EnforceNonfalsifiabilityWithSpire is the value used for "enable-nonfalsifiability" when SPIRE is used to enable non-falsifiability.
8484
EnforceNonfalsifiabilityWithSpire = "spire"
85-
// EnableNonfalsifiabilityNone is the value used for "enable-nonfalsifiability" when non-falsifiability is not enabled.
85+
// EnforceNonfalsifiabilityNone is the value used for "enable-nonfalsifiability" when non-falsifiability is not enabled.
8686
EnforceNonfalsifiabilityNone = ""
8787
// DefaultEnforceNonfalsifiability is the default value for "enforce-nonfalsifiability".
8888
DefaultEnforceNonfalsifiability = EnforceNonfalsifiabilityNone

pkg/spire/spire_test.go

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323

2424
"github.com/spiffe/go-spiffe/v2/spiffeid"
2525
"github.com/spiffe/go-spiffe/v2/svid/x509svid"
26+
pconf "github.com/tektoncd/pipeline/pkg/apis/config"
2627
"github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1"
2728
ttesting "github.com/tektoncd/pipeline/pkg/reconciler/testing"
2829
"github.com/tektoncd/pipeline/pkg/spire/config"
@@ -668,6 +669,30 @@ func TestSpire_TaskRunResultsSignTamper(t *testing.T) {
668669
}
669670
}
670671

672+
func TestOnStore(t *testing.T) {
673+
ctx, _ := ttesting.SetupDefaultContext(t)
674+
logger := logging.FromContext(ctx)
675+
ctx = context.WithValue(ctx, controllerKey{}, &spireControllerAPIClient{
676+
config: &config.SpireConfig{
677+
TrustDomain: "before_test_domain",
678+
SocketPath: "before_test_socket_path",
679+
ServerAddr: "before_test_server_path",
680+
NodeAliasPrefix: "before_test_node_alias_prefix",
681+
},
682+
})
683+
want := config.SpireConfig{
684+
TrustDomain: "after_test_domain",
685+
SocketPath: "after_test_socket_path",
686+
ServerAddr: "after_test_server_path",
687+
NodeAliasPrefix: "after_test_node_alias_prefix",
688+
}
689+
OnStore(ctx, logger)(pconf.GetSpireConfigName(), &want)
690+
got := *GetControllerAPIClient(ctx).(*spireControllerAPIClient).config
691+
if got != want {
692+
t.Fatalf("test TestOnStore expected %v but got %v", got, want)
693+
}
694+
}
695+
671696
func makeX509SVIDs(ca *test.CA, ids ...spiffeid.ID) []*x509svid.SVID {
672697
svids := []*x509svid.SVID{}
673698
for _, id := range ids {

0 commit comments

Comments
 (0)