MCPcopy Create free account
hub / github.com/compose-spec/compose-go / importResources

Function importResources

loader/include.go:168–188  ·  view source on GitHub ↗

importResources import into model all resources defined by imported, and report error on conflict

(source map[string]any, target map[string]any, processor PostProcessor)

Source from the content-addressed store, hash-verified

166
167// importResources import into model all resources defined by imported, and report error on conflict
168func importResources(source map[string]any, target map[string]any, processor PostProcessor) error {
169 if err := importResource(source, target, "services", processor); err != nil {
170 return err
171 }
172 if err := importResource(source, target, "volumes", processor); err != nil {
173 return err
174 }
175 if err := importResource(source, target, "networks", processor); err != nil {
176 return err
177 }
178 if err := importResource(source, target, "secrets", processor); err != nil {
179 return err
180 }
181 if err := importResource(source, target, "configs", processor); err != nil {
182 return err
183 }
184 if err := importResource(source, target, "models", processor); err != nil {
185 return err
186 }
187 return nil
188}
189
190func importResource(source map[string]any, target map[string]any, key string, processor PostProcessor) error {
191 from := source[key]

Callers 1

ApplyIncludeFunction · 0.85

Calls 1

importResourceFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…