MCPcopy Index your code
hub / github.com/docker/cli / formatServiceInspect

Function formatServiceInspect

cli/command/service/inspect_test.go:23–152  ·  view source on GitHub ↗
(t *testing.T, format formatter.Format, now time.Time)

Source from the content-addressed store, hash-verified

21)
22
23func formatServiceInspect(t *testing.T, format formatter.Format, now time.Time) string {
24 t.Helper()
25 b := new(bytes.Buffer)
26
27 endpointSpec := &swarm.EndpointSpec{
28 Mode: "vip",
29 Ports: []swarm.PortConfig{
30 {
31 Protocol: network.TCP,
32 TargetPort: 5000,
33 },
34 },
35 }
36
37 two := uint64(2)
38
39 s := swarm.Service{
40 ID: "de179gar9d0o7ltdybungplod",
41 Meta: swarm.Meta{
42 Version: swarm.Version{Index: 315},
43 CreatedAt: now,
44 UpdatedAt: now,
45 },
46 Spec: swarm.ServiceSpec{
47 Annotations: swarm.Annotations{
48 Name: "my_service",
49 Labels: map[string]string{"com.label": "foo"},
50 },
51 TaskTemplate: swarm.TaskSpec{
52 LogDriver: &swarm.Driver{
53 Name: "driver",
54 Options: map[string]string{
55 "max-file": "5",
56 },
57 },
58 ContainerSpec: &swarm.ContainerSpec{
59 Image: "foo/bar@sha256:this_is_a_test",
60 Configs: []*swarm.ConfigReference{
61 {
62 ConfigID: "mtc3i44r1awdoziy2iceg73z8",
63 ConfigName: "configtest.conf",
64 File: &swarm.ConfigReferenceFileTarget{
65 Name: "/configtest.conf",
66 },
67 },
68 },
69 Secrets: []*swarm.SecretReference{
70 {
71 SecretID: "3hv39ehbbb4hdozo7spod9ftn",
72 SecretName: "secrettest.conf",
73 File: &swarm.SecretReferenceFileTarget{
74 Name: "/secrettest.conf",
75 },
76 },
77 },
78
79 Healthcheck: &container.HealthConfig{
80 Test: []string{"CMD-SHELL", "curl"},

Calls 2

inspectFormatWriteFunction · 0.70
StringMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…