Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support configuring ownership (almost) everywhere (#4932)
* support configuring ownership for file/dir mounts TODO: the other types of mounts Signed-off-by: Alex Suraci <alex@dagger.io> * Container: support uid/gid for copy operations * WithFile * WithDirectory * WithNewFile Signed-off-by: Alex Suraci <alex@dagger.io> * Container.WithMountedCache: support owner Signed-off-by: Alex Suraci <alex@dagger.io> * support configuring secret/socket owner Signed-off-by: Alex Suraci <alex@dagger.io> * appease linter Signed-off-by: Alex Suraci <alex@dagger.io> * resolve UID/GID in one solve instead of two Signed-off-by: Alex Suraci <alex@dagger.io> * remove TODOs I'm not sure these are worth exposing; let's wait for a use case to come up. Signed-off-by: Alex Suraci <alex@dagger.io> * fix up WithNewFileOwner test Signed-off-by: Alex Suraci <alex@dagger.io> * add scalar FilesystemOwner type Signed-off-by: Alex Suraci <alex@dagger.io> * Revert "add scalar FilesystemOwner type" nevermind. too much trouble for too little benefit. This reverts commit 908576434819e457e6d7ad51ab1a18078eb13732. Signed-off-by: Alex Suraci <alex@dagger.io> * container content inherits current user as owner Signed-off-by: Alex Suraci <alex@dagger.io> * avoid uid/gid remapping for tmpfs mounts Signed-off-by: Alex Suraci <alex@dagger.io> * don't apply uid/gid stuff on Windows Signed-off-by: Alex Suraci <alex@dagger.io> * fix setting subdir as rootfs Signed-off-by: Alex Suraci <alex@dagger.io> * mark chown vertex as internal Signed-off-by: Alex Suraci <alex@dagger.io> * fix writing to subdirectory of container Previously WithRootFS would ignore the given directory's relative path, which was necessary for this to work. Now we'll explicitly repoint the directory to /. Updated naming along the way. Signed-off-by: Alex Suraci <alex@dagger.io> * clearer custom name Signed-off-by: Alex Suraci <alex@dagger.io> * disable dupl and gosec linters for tests Signed-off-by: Alex Suraci <alex@dagger.io> * don't inherit container user as file/dir owner Signed-off-by: Alex Suraci <alex@dagger.io> * remove 'Owner' mount field, process them at mount time instead I think this was originally done so it can be inherited at runtime, but that's no longer necessary, and it required "re-writing" container mounts at WithExec time which seemed strange. also remove Container.WithUser now that we don't need to do anything special there anymore Signed-off-by: Alex Suraci <alex@dagger.io> * resolve socket/secret ownership before WithExec Signed-off-by: Alex Suraci <alex@dagger.io> * tidy up leftover cruft/unneeded changes Signed-off-by: Alex Suraci <alex@dagger.io> * preserve dir mode when changing ownership Signed-off-by: Alex Suraci <alex@dagger.io> * improve cache mount owner docs Signed-off-by: Alex Suraci <alex@dagger.io> * fixup comment Signed-off-by: Alex Suraci <alex@dagger.io> --------- Signed-off-by: Alex Suraci <alex@dagger.io>
- Loading branch information