cli
cli copied to clipboard
tektoncd-cli is attempting to write to $HOME during tests
list_test.go:134: failed to read layer sha256:901234178dd17a534133fe551efa1ade1869bfd2a0491fcc8d7a86daa5ae8cfd: Failed to read image layer: mkdir /homeless-shelter: permission denied
list_test.go:137:
Unexpected output:
string(
- "Error: failed to read layer sha256:901234178dd17a534133fe551efa1ade1869bfd2a0491fcc8d7a86daa5ae8cfd: Failed to read image layer: mkdir /homeless-shelter: permission denied\n",
+ "task.tekton.dev/foobar\n",
)
Expected
task.tekton.dev/foobar
Actual
Error: failed to read layer sha256:901234178dd17a534133fe551efa1ade1869bfd2a0491fcc8d7a86daa5ae8cfd: Failed to read image layer: mkdir /homeless-shelter: permission denied
$HOME is /homeless-shelter and it's readonly
related: https://github.com/NixOS/nixpkgs/pull/120890#discussion_r622015585
/kind bug
/area testing
When I changed the $HOME to a tmpdir I found it created .tekton/bundles:
$ ls -al $HOME/.tekton/bundles
drwx------ 2 nixbld nixbld 80 Apr 28 10:39 .
drwx------ 3 nixbld nixbld 60 Apr 28 10:39 ..
-rw-r--r-- 1 nixbld nixbld 656 Apr 28 10:39 sha256:3ced8f29b39be8be2dbf00be4d1c797b3474834869d9e2356d8181ebc31df08f
-rw-r--r-- 1 nixbld nixbld 660 Apr 28 10:39 sha256:62fa51776f3782973ea01c445d228255fdb7f9d5a32d825e8c3bfb8303f5e86a
https://github.com/tektoncd/cli/blob/2bcf91faf15e6f235b8e0a15a9044c09e0eebf88/pkg/cmd/bundle/list.go#L69-L72 https://github.com/tektoncd/cli/blob/c996b3004650658c73ae8b1c0ce98f5165107af5/pkg/bundle/flags.go#L64
I strongly recommend this be changed soon to avoid a painful migration later from ~/.tekton to use the XDG spec
the cache should use ${XDG_CACHE_HOME:-$HOME/.cache}/tekton/bundles, if you really want you can fall back to an existing ~/.tekton but since the tool I'd advise a clean break.
https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html https://wiki.archlinux.org/index.php/XDG_user_directories
There are many people (myself included) who are in a war with our home directories in an effort to put everything in the correct XDG directories to keep things clean
For Mac there are many tools that follow the XDG spec, there are some slightly different rules you can follow (utilizing ~/Library - https://stackoverflow.com/questions/3373948/equivalents-of-xdg-config-home-and-xdg-data-home-on-mac-os-x/5084892#5084892) but quite a lot of Mac users prefer the XDG spec so all their config is in ~/.config etc
/cc @tektoncd/cli-maintainers
agreed, we should use xdg cache
I might give this a crack. Looks like the os library already has functions to help with this:
https://golang.org/pkg/os/#UserCacheDir https://github.com/aquasecurity/trivy/blob/main/pkg/utils/utils.go#L17-L24
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale with a justification.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close with a justification.
If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.
/lifecycle stale
Send feedback to tektoncd/plumbing.
/remove-lifecycle stale
being handled by #1365
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale with a justification.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close with a justification.
If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.
/lifecycle stale
Send feedback to tektoncd/plumbing.
/remove-lifecycle stale
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale with a justification.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close with a justification.
If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.
/lifecycle stale
Send feedback to tektoncd/plumbing.
/remove-lifecycle stale
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale with a justification.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close with a justification.
If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.
/lifecycle stale
Send feedback to tektoncd/plumbing.
Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten with a justification.
Rotten issues close after an additional 30d of inactivity.
If this issue is safe to close now please do so with /close with a justification.
If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.
/lifecycle rotten
Send feedback to tektoncd/plumbing.
Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen with a justification.
Mark the issue as fresh with /remove-lifecycle rotten with a justification.
If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.
/close
Send feedback to tektoncd/plumbing.
@tekton-robot: Closing this issue.
In response to this:
Rotten issues close after 30d of inactivity. Reopen the issue with
/reopenwith a justification. Mark the issue as fresh with/remove-lifecycle rottenwith a justification. If this issue should be exempted, mark the issue as frozen with/lifecycle frozenwith a justification./close
Send feedback to tektoncd/plumbing.
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.
Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen with a justification.
Mark the issue as fresh with /remove-lifecycle rotten with a justification.
If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.
/close
Send feedback to tektoncd/plumbing.
@tekton-robot: Closing this issue.
In response to this:
Rotten issues close after 30d of inactivity. Reopen the issue with
/reopenwith a justification. Mark the issue as fresh with/remove-lifecycle rottenwith a justification. If this issue should be exempted, mark the issue as frozen with/lifecycle frozenwith a justification./close
Send feedback to tektoncd/plumbing.
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.