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

Describe task does not work for inline task spec #380

Closed
piyush-garg opened this issue Oct 23, 2019 · 4 comments · Fixed by #418
Closed

Describe task does not work for inline task spec #380

piyush-garg opened this issue Oct 23, 2019 · 4 comments · Fixed by #418
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug.
Milestone

Comments

@piyush-garg
Copy link
Contributor

Expected Behavior

tkn taskrun describe taskrun_name

This should show the description of taskrun

Actual Behavior

tkn taskrun describe task-59p7t          
Failed to execute templateError: template: Describe taskrun:3:21: executing "Describe taskrun" at <.TaskRun.Spec.TaskRef.Name>: nil pointer evaluating *v1alpha1.TaskRef.Name

Steps to Reproduce the Problem

  1. Create a taskrun with inline spec like
apiVersion: tekton.dev/v1alpha1
kind: TaskRun
metadata:
  generateName: task-
spec:
  taskSpec:
    steps:
      - name: test
        image: ubuntu
        command: ["/bin/bash"]
        args:
          - -c
          - |
            set -e
            set -x
            echo hello world
  1. Get the taskrun name
tkn taskrun list           
NAME         STARTED         DURATION     STATUS      
task-59p7t   2 minutes ago   13 seconds   Succeeded
  1. Hit describe command
tkn taskrun describe task-59p7t          
Failed to execute templateError: template: Describe taskrun:3:21: executing "Describe taskrun" at <.TaskRun.Spec.TaskRef.Name>: nil pointer evaluating *v1alpha1.TaskRef.Name

Additional Info

CLI version 0.4.0

@piyush-garg
Copy link
Contributor Author

/kind bug

@tekton-robot tekton-robot added the kind/bug Categorizes issue or PR as related to a bug. label Oct 23, 2019
@vdemeester vdemeester added this to the 0.5.0 🐱 milestone Oct 23, 2019
@vdemeester
Copy link
Member

We need to make sure this is also the case for PipelineRun too (with ResourceSpec too).
See:

@chmouel chmouel modified the milestones: 0.5.0 🐱, 0.6.0 Oct 24, 2019
@danielhelfand
Copy link
Member

danielhelfand commented Oct 28, 2019

Is there a way to check if a field exists within the template? This is due to .TaskRun.Spec.TaskRef.Name not being present.

This would also be nice to figure out for use cases like displaying the status of a step as part of tkn taskrun describe.

We could also potentially look at adding a method to formatted to check if a field is present on the TaskRun spec.

@danielhelfand
Copy link
Member

/assign

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants