Skip to content

Commit 0eade80

Browse files
committed
debug: tekton
Signed-off-by: Cagri Yonca <cagri@ibm.com>
1 parent e9410c1 commit 0eade80

3 files changed

Lines changed: 19 additions & 38 deletions

File tree

.tekton/.currency/rbac.yaml

Lines changed: 0 additions & 36 deletions
This file was deleted.

.tekton/.currency/scripts/generate_report.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ def get_taskruns(namespace, task_name):
161161
plural = "taskruns"
162162

163163
# access the custom resource from tekton
164-
tektonV1 = client.CustomObjectsApi()
164+
tektonV1 = client.CustomObjectsApi(client.ApiClient())
165165
taskruns = tektonV1.list_namespaced_custom_object(
166166
group,
167167
version,
@@ -214,9 +214,26 @@ def process_taskrun_logs(
214214

215215
def get_tekton_ci_output():
216216
"""Get the latest successful scheduled tekton pipeline output"""
217+
import os
218+
217219
try:
220+
token_path = "/var/run/secrets/kubernetes.io/serviceaccount/token"
221+
if os.path.exists(token_path):
222+
print(f"ServiceAccount token found at {token_path}")
223+
with open(token_path, 'r') as f:
224+
token = f.read().strip()
225+
print(f"Token length: {len(token)}")
226+
218227
config.load_incluster_config()
219228
print("Using in-cluster Kubernetes configuration...")
229+
230+
configuration = client.Configuration.get_default_copy()
231+
client.Configuration.set_default(configuration)
232+
233+
# Debug: Print the host and verify token is in headers
234+
print(f"API Server: {configuration.host}")
235+
if hasattr(configuration, 'api_key') and configuration.api_key:
236+
print(f"API Key present: {bool(configuration.api_key.get('authorization'))}")
220237
except config.config_exception.ConfigException:
221238
# Fall back to local config if running locally and not inside cluster
222239
config.load_kube_config()

.tekton/pipelinerun.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ metadata:
44
name: python-tracer-ci-pipeline-run
55
spec:
66
taskRunTemplate:
7-
serviceAccountName: currency-report-sa
7+
serviceAccountName: currency-serviceaccount
88
params:
99
- name: revision
1010
value: "tekton"

0 commit comments

Comments
 (0)