Skip to content

Commit

Permalink
Use the same serviceaccount in yaml and go test
Browse files Browse the repository at this point in the history
  • Loading branch information
piyush-garg committed Jan 15, 2025
1 parent d3b8050 commit b89ca6d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 21 deletions.
2 changes: 1 addition & 1 deletion test/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (
)

const (
timeout = 5 * time.Minute
timeout = 10 * time.Minute
)

// TknRunner contains information about the current test execution tkn binary path
Expand Down
10 changes: 4 additions & 6 deletions test/framework/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,12 @@ func TearDown(t *testing.T, cs *Clients, namespace string) {
t.Log(string(bs))
}
Header(t.Logf, fmt.Sprintf("Dumping logs from Pods in the %s", namespace))
taskruns, err := cs.TaskRunClient.List(context.Background(), metav1.ListOptions{})
pods, err := cs.KubeClient.CoreV1().Pods(namespace).List(context.Background(), metav1.ListOptions{})
if err != nil {
t.Errorf("Error getting TaskRun list %s", err)
t.Errorf("Error getting pods list %s", err)
}
for _, tr := range taskruns.Items {
if tr.Status.PodName != "" {
CollectPodLogs(cs, tr.Status.PodName, namespace, t.Logf)
}
for _, pod := range pods.Items {
CollectPodLogs(cs, pod.Name, namespace, t.Logf)
}
}

Expand Down
9 changes: 2 additions & 7 deletions test/resources/eventlistener/eventlistener_log.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ kind: EventListener
metadata:
name: github-listener-interceptor
spec:
serviceAccountName: tekton-triggers-github-log-sa
serviceAccountName: tekton-triggers-github-sa
triggers:
- name: github-listener
interceptors:
Expand Down Expand Up @@ -82,18 +82,13 @@ spec:
- name: url
value: $(tt.params.gitrepositoryurl)
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: tekton-triggers-github-log-sa
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: tekton-triggers-github-binding
subjects:
- kind: ServiceAccount
name: tekton-triggers-github-log-sa
name: tekton-triggers-github-sa
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
Expand Down
9 changes: 2 additions & 7 deletions test/resources/eventlistener/eventlistener_v1beta1_log.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ kind: EventListener
metadata:
name: github-listener-interceptor
spec:
serviceAccountName: tekton-triggers-github-log-sa
serviceAccountName: tekton-triggers-github-sa
triggers:
- name: github-listener
interceptors:
Expand Down Expand Up @@ -89,18 +89,13 @@ spec:
- name: url
value: $(tt.params.gitrepositoryurl)
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: tekton-triggers-github-log-sa
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: tekton-triggers-github-binding
subjects:
- kind: ServiceAccount
name: tekton-triggers-github-log-sa
name: tekton-triggers-github-sa
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
Expand Down

0 comments on commit b89ca6d

Please sign in to comment.