pipeline icon indicating copy to clipboard operation
pipeline copied to clipboard

WorkingDir inherit permissions of parent directory

Open chitrangpatel opened this issue 1 year ago • 10 comments

Prior to this PR, workingDirInit did not deal handle permissions of nested child directories in workingDirs. This PR provides the same permissions as that of the existing parent directory. This allows non-root users to also create relative sub diectories in a workspace if used as a workingDir.

Fixes https://github.com/tektoncd/pipeline/issues/7804.

Changes

If the complete path in used as the workingDir already exists, the permissions are not modified. Only non-existent child directories are created with the same permissions as the existing parent.

Submitter Checklist

As the author of this PR, please check off the items in this checklist:

  • [ ] Has Docs if any changes are user facing, including updates to minimum requirements e.g. Kubernetes version bumps
  • [x] Has Tests included if any functionality added or changed
  • [x] pre-commit Passed
  • [x] Follows the commit message standard
  • [x] Meets the Tekton contributor standards (including functionality, content, code)
  • [x] Has a kind label. You can add one by adding a comment on this PR that contains /kind <type>. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tep
  • [x] Release notes block below has been updated with any user facing changes (API changes, bug fixes, changes requiring upgrade notices or deprecation warnings). See some examples of good release notes.
  • [ ] Release notes contains the string "action required" if the change requires additional action from users switching to the new release

Release Notes

WorkingDir inherit permissions of parent directory

/kind bug

chitrangpatel avatar May 24 '24 16:05 chitrangpatel

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: To complete the pull request process, please ask for approval from chitrangpatel after the PR has been reviewed.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

tekton-robot avatar May 24 '24 16:05 tekton-robot

/assign @vdemeester

chitrangpatel avatar May 24 '24 16:05 chitrangpatel

The following is the coverage report on the affected files. Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
cmd/workingdirinit/main.go 23.1% 5.9% -17.2
pkg/pod/workingdir_init.go 95.0% 100.0% 5.0

tekton-robot avatar May 24 '24 16:05 tekton-robot

The following is the coverage report on the affected files. Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
cmd/workingdirinit/main.go 23.1% 5.9% -17.2
pkg/pod/workingdir_init.go 95.0% 100.0% 5.0

tekton-robot avatar May 24 '24 16:05 tekton-robot

The following is the coverage report on the affected files. Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/pod/workingdir_init.go 95.0% 100.0% 5.0

tekton-robot avatar May 24 '24 17:05 tekton-robot

The following is the coverage report on the affected files. Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/pod/workingdir_init.go 95.0% 100.0% 5.0

tekton-robot avatar May 24 '24 17:05 tekton-robot

The following is the coverage report on the affected files. Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
cmd/workingdirinit/main.go 23.1% 5.9% -17.2
pkg/pod/workingdir_init.go 95.0% 100.0% 5.0

tekton-robot avatar May 24 '24 19:05 tekton-robot

The following is the coverage report on the affected files. Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
cmd/workingdirinit/main.go 23.1% 5.9% -17.2
pkg/pod/workingdir_init.go 95.0% 100.0% 5.0

tekton-robot avatar May 24 '24 19:05 tekton-robot

The following is the coverage report on the affected files. Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
cmd/workingdirinit/main.go 23.1% 6.1% -17.0
pkg/pod/workingdir_init.go 95.0% 100.0% 5.0

tekton-robot avatar May 27 '24 15:05 tekton-robot

The following is the coverage report on the affected files. Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
cmd/workingdirinit/main.go 23.1% 6.1% -17.0
pkg/pod/workingdir_init.go 95.0% 100.0% 5.0

tekton-robot avatar May 27 '24 15:05 tekton-robot