MCPcopy Create free account
hub / github.com/docker/cli / LoadSecrets

Function LoadSecrets

cli/compose/loader/loader.go:613–628  ·  view source on GitHub ↗

LoadSecrets produces a SecretConfig map from a compose file Dict the source Dict is not validated if directly used. Use Load() to enable validation

(source map[string]any, details types.ConfigDetails)

Source from the content-addressed store, hash-verified

611// LoadSecrets produces a SecretConfig map from a compose file Dict
612// the source Dict is not validated if directly used. Use Load() to enable validation
613func LoadSecrets(source map[string]any, details types.ConfigDetails) (map[string]types.SecretConfig, error) {
614 secrets := make(map[string]types.SecretConfig)
615 if err := Transform(source, &secrets); err != nil {
616 return secrets, err
617 }
618 for name, secret := range secrets {
619 obj, err := loadFileObjectConfig(name, "secret", types.FileObjectConfig(secret), details)
620 if err != nil {
621 return nil, err
622 }
623 secretConfig := types.SecretConfig(obj)
624 secretConfig.Extras = loadExtras(name, source)
625 secrets[name] = secretConfig
626 }
627 return secrets, nil
628}
629
630// LoadConfigObjs produces a ConfigObjConfig map from a compose file Dict
631// the source Dict is not validated if directly used. Use Load() to enable validation

Calls 3

TransformFunction · 0.85
loadFileObjectConfigFunction · 0.85
loadExtrasFunction · 0.85

Used in the wild real call sites across dependent graphs

searching dependent graphs…