coder / coder/coder

Refactor provisionersdk.Tar/Untar

Open
#16,163 2 comments 0 reactions 0 assignees View on GitHub
bug risk s4
Dominant language
Go
Stars
14.5k
Forks
1.5k
Avg merge
1d 20h
Merged PRs (30d)
601

Description

# Problem:

There are some inconsistencies in how we handle tar archives:

1) `provisionersdk.Tar` adds symlinks without de-referencing them
2) `provisionersdk.Untar` does not handle symlinks at all as far as I can tell
3) `provisionerd` does not _actually_ use `provisionersdk.Untar` to extract archives; it uses a separate implementation `(*provisionersdk.Session).extractArchive()`

# Proposed solution:

* Bring the behaviour of `provisionersdk.Untar` in line with `extractArchive()`
* Replace existing usage of `extractArchive()` with `provisionersdk.Untar`
* Clarify behaviour regarding symlinks -- given that we currently do not extract them, it does not make sense to continue the existing dereferencing behaviour in `provisionersdk.Tar()`.

_Originally posted by @johnstcn in https://github.com/coder/coder/issues/16128#issuecomment-2595553583_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.