Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PipelineRun logs do not include finally task logs #1054

Closed
ckadner opened this issue Jul 7, 2020 · 6 comments · Fixed by #1077
Closed

PipelineRun logs do not include finally task logs #1054

ckadner opened this issue Jul 7, 2020 · 6 comments · Fixed by #1077
Assignees
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Milestone

Comments

@ckadner
Copy link

ckadner commented Jul 7, 2020

Versions and Operating System

  • Kubernetes version:

    Output of kubectl version:

    Client Version: version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.0", GitCommit:"70132b0f130acc0bed193d9ba59dd186f0e634cf", GitTreeState:"clean", BuildDate:"2019-12-13T11:52:32Z", GoVersion:"go1.13.4", Compiler:"gc", Platform:"darwin/amd64"}
    Server Version: version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.11+IKS", GitCommit:"c33b093e937d1f9eee340f9bddfa14e1e54ad1a4", GitTreeState:"clean", BuildDate:"2020-06-17T21:37:54Z", GoVersion:"go1.13.9", Compiler:"gc", Platform:"linux/amd64"}
    
  • Tekton Pipeline version:

    Output of tkn version:

    Client version: 0.10.0
    Pipeline version: devel
    Triggers version: unknown
    

    Output of kubectl get pods -n tekton-pipelines -l app=tekton-pipelines-controller -o=jsonpath='{.items[0].metadata.labels.version}'

    v0.14.0

  • Operating System:

    Mac OS 10.15.5
    

Expected Behavior

tkn pipelinerun logs ... should include the logs from all tasks including the finally tasks.

Actual Behavior

tkn pipelinerun logs ... does not include the logs of the finally tasks.

Steps to Reproduce the Problem

1. Run pipeline exit_handler.yaml pipeline:

cat <<EOF > exit_handler.yaml

apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
  name: exit-handler
spec:
  pipelineSpec:
    finally:
    - name: echo-on-exit
      taskSpec:
        steps:
        - args:
          - echo "finally"
          command:
          - sh
          - -c
          image: library/bash:4.4.23
          name: main
    tasks:
    - name: print-msg
      taskSpec:
        steps:
        - args:
          - echo "printing a message"
          command:
          - sh
          - -c
          image: library/bash:4.4.23
          name: main
EOF

kubectl apply -f exit_handler.yaml

# pipelinerun.tekton.dev/exit-handler created

tkn taskrun list

# NAME                                               STARTED        DURATION     STATUS
# exit-handler-echo-on-exit-5n9dk                    12 hours ago   4 seconds    Succeeded
# exit-handler-print-msg-xcl6p                       12 hours ago   4 seconds    Succeeded

2. Get the pipelinerun logs with tkn:

tkn pipelinerun logs exit-handler 

# [print-msg : main] hi there

Expected:

tkn pipelinerun logs exit-handler 

# [print-msg : main] hi there
# [echo-on-exit : main] finally

3. Get the pipelinerun logs with kubectl:

for POD_NAME in $(kubectl get pipelineruns exit-handler  -o jsonpath='{.status.taskRuns.*.status.podName}'); do \
    kubectl logs $POD_NAME --all-containers ; \
done;

# finally
# hi there
@ckadner ckadner added the kind/bug Categorizes issue or PR as related to a bug. label Jul 7, 2020
@ckadner
Copy link
Author

ckadner commented Jul 7, 2020

@pritidesai

@ckadner
Copy link
Author

ckadner commented Jul 7, 2020

Since finally is new in https://github.com/tektoncd/pipeline/releases/tag/v0.14.0 I suppose this would be more of a Feature rather than a Bug

@ckadner
Copy link
Author

ckadner commented Jul 7, 2020

/remove-kind bug
/kind feature

@tekton-robot tekton-robot added kind/feature Categorizes issue or PR as related to a new feature. and removed kind/bug Categorizes issue or PR as related to a bug. labels Jul 7, 2020
@vdemeester vdemeester added this to the 0.11.0 milestone Jul 7, 2020
@vdemeester
Copy link
Member

/assign @pradeepitm12

@ckadner
Copy link
Author

ckadner commented Jul 8, 2020

Is there a chance that this might get addressed in time for the next CLI release 0.11.0?

@ckadner
Copy link
Author

ckadner commented Jul 8, 2020

Is there a chance that this might get addressed in time for the next CLI release 0.11.0?

Apologies, I just noticed that @vdemeester added this to the 0.11.0 milestone yesterday

Thanks!

pradeepitm12 added a commit to pradeepitm12/cli that referenced this issue Jul 22, 2020
closes tektoncd#1054

this adds finally logs in pipelinerun logs command in follow and
non follow mode

Signed-off-by: Pradeep Kumar <pradkuma@redhat.com>
tekton-robot pushed a commit that referenced this issue Jul 22, 2020
closes #1054

this adds finally logs in pipelinerun logs command in follow and
non follow mode

Signed-off-by: Pradeep Kumar <pradkuma@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants