outputConfig returns the merged and interpolated config file
(configFiles composetypes.ConfigDetails, skipInterpolation bool)
| 51 | |
| 52 | // outputConfig returns the merged and interpolated config file |
| 53 | func outputConfig(configFiles composetypes.ConfigDetails, skipInterpolation bool) (string, error) { |
| 54 | optsFunc := func(opts *composeLoader.Options) { |
| 55 | opts.SkipInterpolation = skipInterpolation |
| 56 | } |
| 57 | config, err := composeLoader.Load(configFiles, optsFunc) |
| 58 | if err != nil { |
| 59 | return "", err |
| 60 | } |
| 61 | |
| 62 | var buf bytes.Buffer |
| 63 | enc := yaml.NewEncoder(&buf) |
| 64 | enc.SetIndent(2) |
| 65 | err = enc.Encode(&config) |
| 66 | if err != nil { |
| 67 | return "", err |
| 68 | } |
| 69 | return buf.String(), nil |
| 70 | } |
searching dependent graphs…