Mounts returns a comma-separated string of mount names present on the container. If the trunc option is set, names can be truncated (ellipsized).
()
| 311 | // Mounts returns a comma-separated string of mount names present on the container. |
| 312 | // If the trunc option is set, names can be truncated (ellipsized). |
| 313 | func (c *ContainerContext) Mounts() string { |
| 314 | var name string |
| 315 | mounts := make([]string, 0, len(c.c.Mounts)) |
| 316 | for _, m := range c.c.Mounts { |
| 317 | if m.Name == "" { |
| 318 | name = m.Source |
| 319 | } else { |
| 320 | name = m.Name |
| 321 | } |
| 322 | if c.trunc { |
| 323 | name = Ellipsis(name, 15) |
| 324 | } |
| 325 | mounts = append(mounts, name) |
| 326 | } |
| 327 | return strings.Join(mounts, ",") |
| 328 | } |
| 329 | |
| 330 | // LocalVolumes returns the number of volumes using the "local" volume driver. |
| 331 | func (c *ContainerContext) LocalVolumes() string { |
nothing calls this directly
no test coverage detected