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

Method Labels

cmd/formatter/container.go:236–246  ·  view source on GitHub ↗

Labels returns a comma-separated string of labels present on the container.

()

Source from the content-addressed store, hash-verified

234
235// Labels returns a comma-separated string of labels present on the container.
236func (c *ContainerContext) Labels() string {
237 if c.c.Labels == nil {
238 return ""
239 }
240
241 var joinLabels []string
242 for k, v := range c.c.Labels {
243 joinLabels = append(joinLabels, fmt.Sprintf("%s=%s", k, v))
244 }
245 return strings.Join(joinLabels, ",")
246}
247
248// Label returns the value of the label with the given name or an empty string
249// if the given label does not exist.

Callers 1

TestPrepareNetworkLabelsFunction · 0.80

Calls

no outgoing calls

Tested by 1

TestPrepareNetworkLabelsFunction · 0.64