MCPcopy Create free account
hub / github.com/containerd/nerdctl / NewComposeDir

Function NewComposeDir

pkg/testutil/compose.go:62–75  ·  view source on GitHub ↗
(t tig.T, dockerComposeYAML string)

Source from the content-addressed store, hash-verified

60}
61
62func NewComposeDir(t tig.T, dockerComposeYAML string) *ComposeDir {
63 tmpDir, err := os.MkdirTemp("", "nerdctl-compose-test")
64 if err != nil {
65 t.Log(fmt.Sprintf("Failed to create temp dir: %v", err))
66 t.FailNow()
67 }
68 cd := &ComposeDir{
69 t: t,
70 dir: tmpDir,
71 yamlBasePath: "docker-compose.yaml",
72 }
73 cd.WriteFile(cd.yamlBasePath, dockerComposeYAML)
74 return cd
75}
76
77// Load is used only for unit testing.
78func LoadProject(fileName, projectName string, envMap map[string]string) (*compose.Project, error) {

Callers 15

TestParseFunction · 0.92
TestParseDeprecatedFunction · 0.92
TestParseDeployFunction · 0.92
TestParseDevicesFunction · 0.92
TestParseRelativeFunction · 0.92
TestParseNetworkModeFunction · 0.92
TestParseConfigsFunction · 0.92
TestParseRestartPolicyFunction · 0.92
TestParseHealthCheckFunction · 0.92
TestParseBuildFunction · 0.92

Calls 3

WriteFileMethod · 0.95
LogMethod · 0.65
FailNowMethod · 0.65

Tested by 15

TestParseFunction · 0.74
TestParseDeprecatedFunction · 0.74
TestParseDeployFunction · 0.74
TestParseDevicesFunction · 0.74
TestParseRelativeFunction · 0.74
TestParseNetworkModeFunction · 0.74
TestParseConfigsFunction · 0.74
TestParseRestartPolicyFunction · 0.74
TestParseHealthCheckFunction · 0.74
TestParseBuildFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…