Labels returns a comma-separated string of labels present on the container.
()
| 234 | |
| 235 | // Labels returns a comma-separated string of labels present on the container. |
| 236 | func (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. |
no outgoing calls