tektoncd / cli

A CLI for interacting with Tekton!
Apache License 2.0
431 stars 250 forks source link

"tkn pipeline start --showlog" not exit even after PipelineRun completed #2156

Closed ileixe closed 6 months ago

ileixe commented 1 year ago

Versions and Operating System

build-and-publish$ kubectl version
WARNING: This version information is deprecated and will be replaced with the output from kubectl version --short.  Use --output=yaml|json to get the full version.
Client Version: version.Info{Major:"1", Minor:"26", GitVersion:"v1.26.3", GitCommit:"9e644106593f3f4aa98f8a84b23db5fa378900bd", GitTreeState:"clean", BuildDate:"2023-03-15T13:40:17Z", GoVersion:"go1.19.7", Compiler:"gc", Platform:"linux/amd64"}
Kustomize Version: v4.5.7
Server Version: version.Info{Major:"1", Minor:"24", GitVersion:"v1.24.9", GitCommit:"9710807c82740b9799453677c977758becf0acbb", GitTreeState:"clean", BuildDate:"2022-12-08T10:08:06Z", GoVersion:"go1.18.9", Compiler:"gc", Platform:"linux/amd64"}
WARNING: version difference between client (1.26) and server (1.24) exceeds the supported minor version skew of +/-1
 build-and-publish$ tkn version
Client version: dev
Chains version: v0.15.0
Pipeline version: v0.45.0
Triggers version: v0.23.0
Dashboard version: v0.33.0
Operator version: v0.66.0

Expected Behavior

tkn pipeline start \
--filename ./pipeline.yaml \
--serviceaccount build-bot \
--showlog 

returns right after the created PipelineRun completed.

Actual Behavior

tkn CLI did not exit for a while (looks like a hang, but I found the process exits after a longtime, finally). Not sure it's consistent to be completed.

Steps to Reproduce the Problem

  1. Create a pipeline having several tasks (My case was ~10)
  2. Start pipeline with showlog option
  3. You can see the CLI did not return well

Additional Info

At the beginning of the CLI, there was a suspicious log like

failed to get logs for task clone-device-api : error in getting logs for step clone: error getting logs for pod wheel-build-run-ckvvf-clone-device-api-pod(step-clone) : container "step-clone" in pod "wheel-build-run-ckvvf-clone-device-api-pod" is waiting to start: PodInitializing

Even the error exists, PipelineRun will run well (pod is created after that) and be completed with success. (Maybe it looks like CLI is waiting for the error Pod?)

vinamra28 commented 6 months ago

resolved in https://github.com/tektoncd/cli/pull/2251, @ileixe can you please try the CLI version v0.36.0 or above and see if this is resolved? Feel free to re-open in either case, for now I am marking this as done