MCPcopy
hub / github.com/docker/compose / loadUnresolvedFile

Function loadUnresolvedFile

pkg/compose/publish.go:619–637  ·  view source on GitHub ↗

loadUnresolvedFile loads a single compose file with interpolation and environment resolution skipped, so callers can inspect raw user-provided values. Used by both checkEnvironmentVariables and composeFileAsByteReader.

(ctx context.Context, project *types.Project, filePath string)

Source from the content-addressed store, hash-verified

617// environment resolution skipped, so callers can inspect raw user-provided
618// values. Used by both checkEnvironmentVariables and composeFileAsByteReader.
619func loadUnresolvedFile(ctx context.Context, project *types.Project, filePath string) (*types.Project, error) {
620 return loader.LoadWithContext(ctx, types.ConfigDetails{
621 WorkingDir: project.WorkingDir,
622 Environment: project.Environment,
623 ConfigFiles: []types.ConfigFile{{Filename: filePath}},
624 }, func(options *loader.Options) {
625 options.SkipValidation = true
626 options.SkipExtends = true
627 options.SkipConsistencyCheck = true
628 options.ResolvePaths = true
629 // SkipInclude mirrors processFile: include directives stay symbolic in
630 // the published artifact, so included content must not be inspected
631 // here either (otherwise we'd flag literals that never ship).
632 options.SkipInclude = true
633 options.SkipInterpolation = true
634 options.SkipResolveEnvironment = true
635 options.Profiles = project.Profiles
636 })
637}
638
639func envFileLayers(files map[string]string) []v1.Descriptor {
640 var layers []v1.Descriptor

Callers 2

collectEnvCheckFindingsFunction · 0.85
composeFileAsByteReaderFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected