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

Debug scripts are not mounted to steps with no scripts #4613

Closed
dgaffuri opened this issue Feb 23, 2022 · 7 comments
Closed

Debug scripts are not mounted to steps with no scripts #4613

dgaffuri opened this issue Feb 23, 2022 · 7 comments
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release.

Comments

@dgaffuri
Copy link

dgaffuri commented Feb 23, 2022

Expected Behavior

Adding breakpoint to a TaskRun running any task will cause debug scripts volume to be mounted on each step

Actual Behavior

If a step in Task doesn't define script but specify command and args the debug scripts volume is not mounted

Steps to Reproduce the Problem

  1. Define a TaskRun including breakpoints for a task with a step not defining scripts, like kn/0.1 from catalog, including parameters that will cause the step to fail
kubectl apply -f - <<EOF
apiVersion: tekton.dev/v1beta1
kind: TaskRun
metadata:
  name: kn
spec:
  debug:
    breakpoint: ["onFailure"]
  taskRef:
    name: kn
  params:
    - name: ARGS
      value: [ "invalid" ]
EOF
  1. Login to the pod
    kubectl exec -it kn-pod -- /bin/sh
  2. Check that no debug scripts are mounted
/ $ ls /tekton/
bin            creds          creds-secrets  downward       home           results        run            steps          termination

Additional Info

  • Kubernetes version:

    Output of kubectl version:

Client Version: version.Info{Major:"1", Minor:"22", GitVersion:"v1.22.5", GitCommit:"5c99e2ac2ff9a3c549d9ca665e7bc05a3e18f07e", GitTreeState:"clean", BuildDate:"2021-12-16T08:38:33Z", GoVersion:"go1.16.12", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"22", GitVersion:"v1.22.5", GitCommit:"5c99e2ac2ff9a3c549d9ca665e7bc05a3e18f07e", GitTreeState:"clean", BuildDate:"2021-12-16T08:32:32Z", GoVersion:"go1.16.12", Compiler:"gc", Platform:"linux/amd64"}
  • Tekton Pipeline version:

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

Client version: 0.22.0
Pipeline version: v0.33.0
Triggers version: v0.18.0
Dashboard version: v0.24.1
@dgaffuri dgaffuri added the kind/bug Categorizes issue or PR as related to a bug. label Feb 23, 2022
@pritidesai
Copy link
Member

/cc @waveywaves

@vdemeester vdemeester added this to the Pipelines v0.34 milestone Feb 24, 2022
@jerop jerop added the priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. label Apr 5, 2022
@jerop jerop modified the milestones: Pipelines v0.35, Pipelines v0.36 Apr 5, 2022
@yuzp1996
Copy link
Contributor

Hi! I am interested in this issue and want to take this one. If I need any help I will mention it here.

@yuzp1996
Copy link
Contributor

/assign yuzp1996

@yuzp1996
Copy link
Contributor

I have reproduced the same error in my local environment and I will check the code and find out how this happened

@yuzp1996
Copy link
Contributor

image

maybe this is the cause of this bug

yuzp1996 added a commit to yuzp1996/pipeline that referenced this issue Apr 19, 2022
Fix bug for issue tektoncd#4613

When script is empty then the logic which mount the debug script
will skip for container and the signal of placeScripts is the
default value false. Then no debug script volume will be mount.

But now will check breakpoint first and add volumeMount for
container if breakpoint is not null. And if breakpoint is not
null then will set the signal placeScripts to be true

Signed-off-by: yuzhipeng <[email protected]>
yuzp1996 added a commit to yuzp1996/pipeline that referenced this issue Apr 20, 2022
Fix bug for issue tektoncd#4613

When script is empty then the logic which mount the debug script
will skip for container and the signal of placeScripts is the
default value false. Then no debug script volume will be mount.

But now will check breakpoint first and add volumeMount for
container if breakpoint is not null. And if breakpoint is not
null then will set the signal placeScripts to be true

Signed-off-by: yuzhipeng <[email protected]>
yuzp1996 added a commit to yuzp1996/pipeline that referenced this issue Apr 20, 2022
Fix bug for issue tektoncd#4613

When script is empty then the logic which mount the debug script
will skip for container and the signal of placeScripts is the
default value false. Then no debug script volume will be mount.

But now will check breakpoint first and add volumeMount for
container if breakpoint is not null. And if breakpoint is not
null then will set the signal placeScripts to be true

Signed-off-by: yuzhipeng <[email protected]>
yuzp1996 added a commit to yuzp1996/pipeline that referenced this issue Apr 21, 2022
When the step script is empty then the logic which mounts the debug
script will skip for the container and the signal of placeScripts
will be the default value false which causes no debug script volume
will be mounted.

Now it will check the breakpoint first, if the breakpoint is not null
then will add volume Mount for container no matter weather the script
is empty or not.

And if the breakpoint is not null then will set the signal placeScripts
to be true while it used to be true only when the script is not empty.

related issue:  tektoncd#4613

Signed-off-by: yuzhipeng <[email protected]>
yuzp1996 added a commit to yuzp1996/pipeline that referenced this issue May 8, 2022
When the step script is empty then the logic which mounts the debug
script will skip for the container and the signal of placeScripts
will be the default value false which causes no debug script volume
will be mounted.

Now it will check the breakpoint first, if the breakpoint is not null
then will add volume Mount for container no matter weather the script
is empty or not.

And if the breakpoint is not null then will set the signal placeScripts
to be true while it used to be true only when the script is not empty.

related issue:  tektoncd#4613

Signed-off-by: yuzhipeng <[email protected]>
tekton-robot pushed a commit that referenced this issue May 20, 2022
When the step script is empty then the logic which mounts the debug
script will skip for the container and the signal of placeScripts
will be the default value false which causes no debug script volume
will be mounted.

Now it will check the breakpoint first, if the breakpoint is not null
then will add volume Mount for container no matter weather the script
is empty or not.

And if the breakpoint is not null then will set the signal placeScripts
to be true while it used to be true only when the script is not empty.

related issue:  #4613

Signed-off-by: yuzhipeng <[email protected]>
@lbernick
Copy link
Member

/close

closed in #4776

@tekton-robot
Copy link
Collaborator

@lbernick: Closing this issue.

In response to this:

/close

closed in #4776

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

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. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release.
Projects
None yet
Development

No branches or pull requests

7 participants