Stitch any CI into Tangled
151
fork

Configure Feed

Select the types of activity you want to include in your feed.

provider/tekton: fix service account name location #20

open opened by xeiaso.net targeting main from xeiaso.net/tack: Xe/tekton-serviceaccountname-moved

Tekton v1beta1 PipelineRun objects1 had the service account specified at the top level of spec, eg:

spec:
  serviceAccountName: tack

However Tekton v1 PipelineRun objects have the service account inside a taskRunTemplate object:

spec:
  taskRunTemplate:
    serviceAccountName: tack

This change properly places the service account name in the right place for Tekton v1 PipelineRun objects so that Tack can properly annotate CI pipelines.

Labels

None yet.

assignee

None yet.

Participants 1
AT URI
at://did:plc:e5nncb3dr5thdkjir5cfaqfe/sh.tangled.repo.pull/3mlk2zewc5d22
+4 -2
Diff #0
+3 -1
provider_tekton.go
··· 368 368 } 369 369 370 370 if cfg.ServiceAccount != "" { 371 - spec["serviceAccountName"] = cfg.ServiceAccount 371 + spec["taskRunTemplate"] = map[string]any{ 372 + "serviceAccountName": cfg.ServiceAccount, 373 + } 372 374 } 373 375 374 376 // Merge user-defined params with the built-in ones (commit,
+1 -1
provider_tekton_test.go
··· 113 113 if !ok || pipeline != "repo-ci" { 114 114 t.Fatalf("pipelineRef.name = %q", pipeline) 115 115 } 116 - sa, ok := obj.NestedString("spec", "serviceAccountName") 116 + sa, ok := obj.NestedString("spec", "taskRunTemplate", "serviceAccountName") 117 117 if !ok || sa != "runner" { 118 118 t.Fatalf("serviceAccountName = %q", sa) 119 119 }

History

1 round 0 comments
sign up or login to add to the discussion
xeiaso.net submitted #0
1 commit
expand
provider/tekton: fix service account name location
merge conflicts detected
expand
  • provider_tekton.go:368
  • provider_tekton_test.go:113
expand 0 comments