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

Function loadFileObject

pkg/bridge/convert.go:209–223  ·  view source on GitHub ↗
(conf types.FileObjectConfig)

Source from the content-addressed store, hash-verified

207}
208
209func loadFileObject(conf types.FileObjectConfig) (types.FileObjectConfig, error) {
210 if !conf.External {
211 switch {
212 case conf.Environment != "":
213 conf.Content = os.Getenv(conf.Environment)
214 case conf.File != "":
215 bytes, err := os.ReadFile(conf.File)
216 if err != nil {
217 return conf, err
218 }
219 conf.Content = string(bytes)
220 }
221 }
222 return conf, nil
223}
224
225func inspectWithPull(ctx context.Context, dockerCli command.Cli, imageName string) (image.InspectResponse, error) {
226 inspect, err := dockerCli.Client().ImageInspect(ctx, imageName)

Callers 1

LoadAdditionalResourcesFunction · 0.85

Calls 1

ReadFileMethod · 0.80

Tested by

no test coverage detected