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

Method setResolvedNetworks

pkg/compose/observed_state.go:188–198  ·  view source on GitHub ↗

setResolvedNetworks injects network IDs already resolved by ensureNetworks into the observed state, so the reconciler can compare container connections against actual network IDs.

(networks map[string]string, project *types.Project)

Source from the content-addressed store, hash-verified

186// into the observed state, so the reconciler can compare container connections
187// against actual network IDs.
188func (s *ObservedState) setResolvedNetworks(networks map[string]string, project *types.Project) {
189 for key, id := range networks {
190 if obs, exists := s.Networks[key]; exists {
191 obs.ID = id
192 s.Networks[key] = obs
193 } else {
194 nw := project.Networks[key]
195 s.Networks[key] = ObservedNetwork{ID: id, Name: nw.Name}
196 }
197 }
198}
199
200// setResolvedVolumes injects volume names already resolved by ensureProjectVolumes
201// into the observed state.

Callers 1

createMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected