MCPcopy Create free account
hub / github.com/docker/cli / TestLoadMultipleServicePorts

Function TestLoadMultipleServicePorts

cli/compose/loader/merge_test.go:232–349  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

230}
231
232func TestLoadMultipleServicePorts(t *testing.T) {
233 portsCases := []struct {
234 name string
235 portBase map[string]any
236 portOverride map[string]any
237 expected []types.ServicePortConfig
238 }{
239 {
240 name: "no_override",
241 portBase: map[string]any{
242 "ports": []any{
243 "8080:80",
244 },
245 },
246 portOverride: map[string]any{},
247 expected: []types.ServicePortConfig{
248 {
249 Mode: "ingress",
250 Published: 8080,
251 Target: 80,
252 Protocol: "tcp",
253 },
254 },
255 },
256 {
257 name: "override_different_published",
258 portBase: map[string]any{
259 "ports": []any{
260 "8080:80",
261 },
262 },
263 portOverride: map[string]any{
264 "ports": []any{
265 "8081:80",
266 },
267 },
268 expected: []types.ServicePortConfig{
269 {
270 Mode: "ingress",
271 Published: 8080,
272 Target: 80,
273 Protocol: "tcp",
274 },
275 {
276 Mode: "ingress",
277 Published: 8081,
278 Target: 80,
279 Protocol: "tcp",
280 },
281 },
282 },
283 {
284 name: "override_same_published",
285 portBase: map[string]any{
286 "ports": []any{
287 "8080:80",
288 },
289 },

Callers

nothing calls this directly

Calls 1

LoadFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…