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)
| 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 |
| 613 | func 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 |
searching dependent graphs…