Skip to content

Commit 1e0ffb5

Browse files
authored
Revert "fix: add FSGroup to Tekton PipelineRun podTemplate for s390x/ppc64le support (knative#3665)" (knative#3854)
This reverts commit 9ba518e.
1 parent d4323c3 commit 1e0ffb5

3 files changed

Lines changed: 0 additions & 101 deletions

File tree

pkg/pipelines/tekton/templates_pack.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,6 @@ spec:
125125
value: "{{.Commit}}"
126126
pipelineRef:
127127
name: {{.PipelineName}}
128-
podTemplate:
129-
securityContext:
130-
runAsUser: 1001
131-
runAsGroup: 0
132-
fsGroup: 1002
133128
workspaces:
134129
- name: source-workspace
135130
persistentVolumeClaim:
@@ -190,11 +185,6 @@ spec:
190185
{{end}}
191186
pipelineRef:
192187
name: {{.PipelineName}}
193-
podTemplate:
194-
securityContext:
195-
runAsUser: 1001
196-
runAsGroup: 0
197-
fsGroup: 1002
198188
workspaces:
199189
- name: source-workspace
200190
persistentVolumeClaim:

pkg/pipelines/tekton/templates_s2i.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,6 @@ spec:
136136
value: "{{.Commit}}"
137137
pipelineRef:
138138
name: {{.PipelineName}}
139-
podTemplate:
140-
securityContext:
141-
runAsUser: 1001
142-
runAsGroup: 0
143-
fsGroup: 1002
144139
workspaces:
145140
- name: source-workspace
146141
persistentVolumeClaim:
@@ -208,11 +203,6 @@ spec:
208203
value: {{.TlsVerify}}
209204
pipelineRef:
210205
name: {{.PipelineName}}
211-
podTemplate:
212-
securityContext:
213-
runAsUser: 1001
214-
runAsGroup: 0
215-
fsGroup: 1002
216206
workspaces:
217207
- name: source-workspace
218208
persistentVolumeClaim:

pkg/pipelines/tekton/templates_test.go

Lines changed: 0 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
package tekton
22

33
import (
4-
"os"
54
"path/filepath"
6-
"strings"
75
"testing"
86

97
"github.com/manifestival/manifestival"
@@ -324,82 +322,3 @@ func Test_createAndApplyPipelineRunTemplate(t *testing.T) {
324322
})
325323
}
326324
}
327-
328-
func Test_PipelineRunHasPodTemplateSecurityContext(t *testing.T) {
329-
tests := []struct {
330-
name string
331-
root string
332-
builder string
333-
runtime string
334-
}{
335-
{
336-
name: "pack builder with quarkus",
337-
root: "testdata/testCreatePipelinePackQuarkus",
338-
builder: builders.Pack,
339-
runtime: "quarkus",
340-
},
341-
{
342-
name: "s2i builder with quarkus",
343-
root: "testdata/testCreatePipelineS2IQuarkus",
344-
builder: builders.S2I,
345-
runtime: "quarkus",
346-
},
347-
}
348-
349-
for _, tt := range tests {
350-
t.Run(tt.name, func(t *testing.T) {
351-
root := tt.root + "Run"
352-
defer Using(t, root)()
353-
354-
f, err := fn.NewFunction(root)
355-
if err != nil {
356-
t.Fatal(err)
357-
}
358-
359-
f.Build.Builder = tt.builder
360-
f.Runtime = tt.runtime
361-
f.Image = "docker.io/alice/" + f.Name
362-
f.Registry = TestRegistry
363-
364-
// Create the PipelineRun template
365-
err = createPipelineRunTemplatePAC(f, make(map[string]string))
366-
if err != nil {
367-
t.Fatalf("createPipelineRunTemplatePAC() error = %v", err)
368-
}
369-
370-
// Read the generated file and verify it contains podTemplate with securityContext
371-
fp := filepath.Join(root, resourcesDirectory, pipelineRunFilenamePAC)
372-
content, err := os.ReadFile(fp)
373-
if err != nil {
374-
t.Fatalf("failed to read generated PipelineRun: %v", err)
375-
}
376-
377-
contentStr := string(content)
378-
379-
// Verify podTemplate is present
380-
if !strings.Contains(contentStr, "podTemplate:") {
381-
t.Error("podTemplate not found in generated PipelineRun")
382-
}
383-
384-
// Verify securityContext is present
385-
if !strings.Contains(contentStr, "securityContext:") {
386-
t.Error("securityContext not found in podTemplate")
387-
}
388-
389-
// Verify fsGroup is set
390-
if !strings.Contains(contentStr, "fsGroup: 1002") {
391-
t.Error("fsGroup not set to 1002 in securityContext")
392-
}
393-
394-
// Verify runAsUser is set
395-
if !strings.Contains(contentStr, "runAsUser: 1001") {
396-
t.Error("runAsUser not set to 1001 in securityContext")
397-
}
398-
399-
// Verify runAsGroup is set
400-
if !strings.Contains(contentStr, "runAsGroup: 0") {
401-
t.Error("runAsGroup not set to 0 in securityContext")
402-
}
403-
})
404-
}
405-
}

0 commit comments

Comments
 (0)