Expected Behavior
After enabling the logs API feature of TektonResults, logs can be stored normally.
Actual Behavior
Even if the switch is enabled in TektonConfig, logs still cannot be stored.
Steps to Reproduce the Problem
- Adjust TektonResults configuration
apiVersion: operator.tekton.dev/v1alpha1
kind: TektonResult
metadata:
name: result
spec:
auth_disable: true
db_enable_auto_migration: true
db_host: 192.168.188.7
db_name: qingliu_tektoncd_results_202502171201
db_port: 5432
is_external_db: true
log_level: debug
logging_pvc_name: tekton-logs
logs_api: true # <- enable logs api
logs_path: /logs
logs_type: File
options: {}
secret_name: tekton-results-postgres
server_port: 8080
targetNamespace: tekton-pipelines
- Restart the pod
$ kubectl delete pods -n tekton-pipelines -l app.kubernetes.io/name=tekton-results-watcher
$ kubectl delete pods -n tekton-pipelines -l app.kubernetes.io/name=tekton-results-api
- Create TaskRun
$ cat <<'EOF' | kubectl create -f -
apiVersion: tekton.dev/v1
kind: TaskRun
metadata:
name: hello
spec:
taskSpec:
steps:
- name: hello
image: alpine
command: ["echo", "hello"]
EOF
Additional Info
Reference
- Changed the default startup argument
logs_api to false.
- Solutions from others
- The TektonOperator does not modify the startup parameters of the
tekton-results-watcher based on the logs_api value in TektonResults when deploying TektonResults. This results in the watcher service always having this feature disabled.
|
extra := []mf.Transformer{ |
|
common.InjectOperandNameLabelOverwriteExisting(v1alpha1.OperandTektoncdResults), |
|
common.ApplyProxySettings, |
|
common.ReplaceNamespaceInDeploymentArgs([]string{resultWatcherDeployment}, targetNs), |
|
common.ReplaceNamespaceInDeploymentEnv(resultDeployementNames, targetNs), |
|
updateApiConfig(instance.Spec), |
|
enablePVCLogging(instance.Spec.ResultsAPIProperties), |
|
updateEnvWithSecretName(instance.Spec.ResultsAPIProperties), |
|
populateGoogleCreds(instance.Spec.ResultsAPIProperties), |
|
common.AddDeploymentRestrictedPSA(), |
|
common.AddStatefulSetRestrictedPSA(), |
Expected Behavior
After enabling the logs API feature of TektonResults, logs can be stored normally.
Actual Behavior
Even if the switch is enabled in TektonConfig, logs still cannot be stored.
Steps to Reproduce the Problem
Additional Info
Kubernetes version:
Output of
kubectl version:Tekton Operator version:
Reference
logs_apito false.tekton-results-watcherbased on the logs_api value in TektonResults when deploying TektonResults. This results in the watcher service always having this feature disabled.operator/pkg/reconciler/kubernetes/tektonresult/transform.go
Lines 85 to 95 in 07fcbf7