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

Function TestConvertEndpointSpec

cli/compose/convert/service_test.go:199–231  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

197}
198
199func TestConvertEndpointSpec(t *testing.T) {
200 source := []composetypes.ServicePortConfig{
201 {
202 Protocol: "udp",
203 Target: 53,
204 Published: 1053,
205 Mode: "host",
206 },
207 {
208 Target: 8080,
209 Published: 80,
210 },
211 }
212 endpoint := convertEndpointSpec("vip", source)
213
214 expected := swarm.EndpointSpec{
215 Mode: swarm.ResolutionMode(strings.ToLower("vip")),
216 Ports: []swarm.PortConfig{
217 {
218 TargetPort: 8080,
219 PublishedPort: 80,
220 },
221 {
222 Protocol: "udp",
223 TargetPort: 53,
224 PublishedPort: 1053,
225 PublishMode: "host",
226 },
227 },
228 }
229
230 assert.Check(t, is.DeepEqual(expected, *endpoint))
231}
232
233func TestConvertServiceNetworksOnlyDefault(t *testing.T) {
234 networkConfigs := networkMap{}

Callers

nothing calls this directly

Calls 1

convertEndpointSpecFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…