MCPcopy
hub / github.com/grafana/tempo / writeFileToSharedDir

Function writeFileToSharedDir

integration/util/harness_config_overlay.go:41–56  ·  view source on GitHub ↗
(s *e2e.Scenario, dst string, content []byte)

Source from the content-addressed store, hash-verified

39}
40
41func writeFileToSharedDir(s *e2e.Scenario, dst string, content []byte) (string, error) {
42 dst = sharedContainerPath(s, dst)
43
44 // Ensure the entire path of directories exists
45 err := os.MkdirAll(filepath.Dir(dst), 0o644) // nolint:gosec // G306: Expect WriteFile permissions to be 0600 or less
46 if err != nil {
47 return "", err
48 }
49
50 err = os.WriteFile(dst, content, 0o644) // nolint:gosec // G306: Expect WriteFile permissions to be 0600 or less
51 if err != nil {
52 return "", err
53 }
54
55 return dst, nil
56}
57
58func sharedContainerPath(s *e2e.Scenario, file string) string {
59 return filepath.Join(s.SharedDir(), file)

Callers 1

CopyFileToSharedDirFunction · 0.85

Calls 1

sharedContainerPathFunction · 0.85

Tested by

no test coverage detected