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)
| 186 | // into the observed state, so the reconciler can compare container connections |
| 187 | // against actual network IDs. |
| 188 | func (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. |