Stitch any CI into Tangled
151
fork

Configure Feed

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

provider/tekton: adding configmap as a configurable resource #17

open opened by dsx.sh targeting main from dsx.sh/tack: main

adding a configmap alongside pvc and secret.

Sorry for the multiple PRs for this provider, I do think doing these piecemeal to avoid bloat without purpose is probably a good thing.

At this point all of my workloads are fully functional through tack so I'm generally good to go.

Labels

None yet.

assignee

None yet.

Participants 1
AT URI
at://did:plc:6so2rykrnjmzebbr2zbwbqbx/sh.tangled.repo.pull/3ml7mqu6zg622
+21 -1
Diff #0
+9
provider_tekton.go
··· 69 69 Storage *string `yaml:"storage"` 70 70 PVC *string `yaml:"pvc"` 71 71 Secret *string `yaml:"secret"` 72 + ConfigMap *string `yaml:"config_map"` 72 73 } 73 74 74 75 type tektonWorkflowDoc struct { ··· 314 315 "secretName": *ws.Secret, 315 316 }, 316 317 }) 318 + 319 + case ws.ConfigMap != nil: 320 + workspaces = append(workspaces, map[string]any{ 321 + "name": ws.Name, 322 + "configMap": map[string]any{ 323 + "name": *ws.ConfigMap, 324 + }, 325 + }) 317 326 } 318 327 } 319 328
+12 -1
provider_tekton_test.go
··· 82 82 storage := "5Gi" 83 83 pvc := "shared-cache" 84 84 secret := "git-credentials" 85 + configMap := "app-config" 85 86 cfg := &tektonWorkflowConfig{ 86 87 Pipeline: "repo-ci", 87 88 Workspaces: []tektonWorkspaceConfig{ 88 89 {Name: "scratch", AccessModes: []string{"ReadWriteOnce"}, Storage: &storage}, 89 90 {Name: "cache", PVC: &pvc}, 90 91 {Name: "git-auth", Secret: &secret}, 92 + {Name: "config", ConfigMap: &configMap}, 91 93 }, 92 94 } 93 95 ··· 106 108 } 107 109 108 110 workspaces, ok := obj.NestedSlice("spec", "workspaces") 109 - if !ok || len(workspaces) != 3 { 111 + if !ok || len(workspaces) != 4 { 110 112 t.Fatalf("workspaces = %+v", workspaces) 111 113 } 112 114 ··· 139 141 if !ok || secretRef["secretName"] != "git-credentials" { 140 142 t.Fatalf("git-auth secret = %+v", gitAuth) 141 143 } 144 + 145 + cfgWs, ok := workspaces[3].(map[string]any) 146 + if !ok { 147 + t.Fatalf("config workspace = %#v", workspaces[3]) 148 + } 149 + cmRef, ok := k8s.NestedMap(cfgWs, "configMap") 150 + if !ok || cmRef["name"] != "app-config" { 151 + t.Fatalf("config configMap = %+v", cfgWs) 152 + } 142 153 } 143 154 144 155 func TestTektonStatusMapping(t *testing.T) {

History

1 round 0 comments
sign up or login to add to the discussion
dsx.sh submitted #0
1 commit
expand
provider/tekton: adding configmap as a configurable resource
merge conflicts detected
expand
  • provider_tekton.go:69
  • provider_tekton_test.go:82
expand 0 comments