mirror of
https://github.com/coder/coder.git
synced 2025-07-09 11:45:56 +00:00
chore(coderd): extract fileszip to package archive for reuse (#15229)
Related to https://github.com/coder/coder/issues/15087 As part of sniffing the workspace tags from an uploaded file, we need to be able to handle both zip and tar files. Extracting the functions to a separate `archive` package will be helpful here.
This commit is contained in:
@ -13,6 +13,7 @@ import (
|
||||
"github.com/google/uuid"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/coder/coder/v2/archive"
|
||||
"github.com/coder/coder/v2/cli/clitest"
|
||||
"github.com/coder/coder/v2/coderd"
|
||||
"github.com/coder/coder/v2/coderd/coderdtest"
|
||||
@ -95,7 +96,7 @@ func TestTemplatePull_Stdout(t *testing.T) {
|
||||
|
||||
// Verify .zip format
|
||||
tarReader := tar.NewReader(bytes.NewReader(expected))
|
||||
expectedZip, err := coderd.CreateZipFromTar(tarReader)
|
||||
expectedZip, err := archive.CreateZipFromTar(tarReader, coderd.HTTPFileMaxBytes)
|
||||
require.NoError(t, err)
|
||||
|
||||
inv, root = clitest.New(t, "templates", "pull", "--zip", template.Name)
|
||||
|
Reference in New Issue
Block a user