mirror of
https://github.com/juanfont/headscale.git
synced 2025-08-12 02:47:36 +00:00
Add go profiling flag, and enable on integration tests (#1382)
This commit is contained in:
@@ -72,3 +72,24 @@ func WriteFileToContainer(
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func FetchPathFromContainer(
|
||||
pool *dockertest.Pool,
|
||||
container *dockertest.Resource,
|
||||
path string,
|
||||
) ([]byte, error) {
|
||||
buf := bytes.NewBuffer([]byte{})
|
||||
|
||||
err := pool.Client.DownloadFromContainer(
|
||||
container.Container.ID,
|
||||
docker.DownloadFromContainerOptions{
|
||||
OutputStream: buf,
|
||||
Path: path,
|
||||
},
|
||||
)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return buf.Bytes(), nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user