rejectLegacyCapabilities returns an error if the deprecated HostConfig.Capabilities field is present in a request for API version 1.40. The Capabilities field was added in API 1.40 (Docker 19.03) as a way to specify the exact set of kernel capabilities for a container, overriding the CapAdd/CapDrop
(capabilities []string, version string)
| 833 | // return an explicit error rather than silently ignoring the field when it is |
| 834 | // expected to be supported. |
| 835 | func rejectLegacyCapabilities(capabilities []string, version string) error { |
| 836 | if len(capabilities) > 0 && versions.Equal(version, "1.40") { |
| 837 | return errLegacyCapabilities |
| 838 | } |
| 839 | return nil |
| 840 | } |
| 841 | |
| 842 | // handleMACAddressBC takes care of backward-compatibility for the container-wide MAC address by mutating the |
| 843 | // networkingConfig to set the endpoint-specific MACAddress field introduced in API v1.44. It returns a warning message |
searching dependent graphs…