Commit graph

43960 commits

Author SHA1 Message Date
Sebastiaan van Stijn
6e376e32d8
update containerd binary to v1.6.4
Notable Updates

- Update go-cni to fix teardown regression
- Fix broken SELinux relabeling for Kubernetes volume mounts

full diff: https://github.com/containerd/containerd/compare/v1.6.3...v1.6.4

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-05-04 10:58:08 +02:00
Sebastiaan van Stijn
613b798312
Merge pull request #43545 from thaJeztah/update_selinux
vendor: github.com/opencontainers/selinux v1.10.1
2022-05-02 19:07:40 +02:00
Sebastiaan van Stijn
9880e6a1ef
vendor: github.com/opencontainers/selinux v1.10.1
- relabel links instead of their targets

full diff: https://github.com/opencontainers/selinux/compare/v1.10.0...v1.10.1

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-05-02 14:40:47 +02:00
Sebastiaan van Stijn
2ed904cad7
Merge pull request #43547 from thaJeztah/bump_buildkit
vendor: github.com/moby/buildkit v0.10.2
2022-04-29 20:18:37 +02:00
Sebastiaan van Stijn
82088364e1
vendor: github.com/moby/buildkit v0.10.2
note that the previous version we used was from the master branch, so some
changes, for example, replacing the deprecated `io/ioutil` package are reverted
in this update.

raw diff: https://github.com/moby/buildkit/compare/d7744bcb3532..v0.10.2

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-04-29 16:54:18 +02:00
Sebastiaan van Stijn
fca0c20cd4
vendor: github.com/containerd/continuity v0.3.0
full diff: https://github.com/containerd/continuity/compare/v0.2.2...v0.3.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-04-29 16:20:03 +02:00
Sebastiaan van Stijn
16cd359664
vendor: golang.org/x/sys v0.0.0-20220405210540-1e041c57c461
full diff: a9b59b0215...1e041c57c4

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-04-29 16:18:00 +02:00
Sebastiaan van Stijn
63b13a70ee
vendor: github.com/Microsoft/go-winio v0.5.2
full diff: https://github.com/Microsoft/go-winio/compare/v0.5.1...v0.5.2

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-04-29 16:12:56 +02:00
Sebastiaan van Stijn
545cf195e2
Merge pull request #43480 from corhere/mitigate-slow-health-check-start
Mitigate the impact of slow exec starts on health checks
2022-04-29 15:07:31 +02:00
Sebastiaan van Stijn
b963ba4a1e
Merge pull request #43452 from kponichtera/43451-contribution-guide-set-up-ide
Extended contribution guide with how to make IDEs recognize Moby’s repository as a Go project
2022-04-29 15:03:24 +02:00
Sebastiaan van Stijn
5486146943
Merge pull request #43525 from thaJeztah/daemon_fix_hosts_validation_step1e
daemon: daemon.initNetworkController(): dont return the controller
2022-04-29 14:12:56 +02:00
Sebastiaan van Stijn
bf04690bbc
Merge pull request #43530 from thaJeztah/api_cleanup_definitions
api/types: cleanup to use more idiomatic names
2022-04-29 11:35:43 +02:00
Sebastiaan van Stijn
6028568508
Merge pull request #43534 from thaJeztah/bump_containerd_1.6.3
vendor: github.com/containerd/containerd v1.6.3
2022-04-29 09:59:28 +02:00
Sebastiaan van Stijn
4d22584432
Merge pull request #43536 from thaJeztah/daemon_fix_hosts_validation_step1g
daemon: improvements to config (re)loading
2022-04-29 09:39:11 +02:00
Sebastiaan van Stijn
2fa315c656
Merge pull request #43535 from thaJeztah/daemon_fix_hosts_validation_step1f
cmd/dockerd: unify flags, and remove opt.IPOpt()
2022-04-29 09:20:42 +02:00
Sebastiaan van Stijn
dbd575ef91
daemon: daemon.initNetworkController(): dont return the controller
This method returned the network controller, only to set it on the daemon.

While making this change, also;

- update some error messages to be in the correct format
- use errors.Wrap() where possible
- extract configuring networks into a separate function to make the flow
  slightly easier to follow.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-04-29 09:08:49 +02:00
Cory Snider
bdc6473d2d health: Start probe timeout after exec starts
Starting an exec can take a significant amount of time while under heavy
container operation load. In extreme cases the time to start the process
can take upwards of a second, which is a significant fraction of the
default health probe timeout (30s). With a shorter timeout, the exec
start delay could make the difference between a successful probe and a
probe timeout! Mitigate the impact of excessive exec start latencies by
only starting the probe timeout timer after the exec'ed process has
started.

Add a metric to sample the latency of starting health-check exec probes.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2022-04-28 17:21:03 -04:00
Sebastiaan van Stijn
41b96bff55
update uses of container.ContainerCreateCreatedBody to CreateResponse
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-04-28 22:39:20 +02:00
Sebastiaan van Stijn
3bb2d0026b
api: rename container.ContainerCreateCreatedBody to container.CreateResponse
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-04-28 22:39:18 +02:00
Sebastiaan van Stijn
ff197417fa
api: swagger: move ContainerCreateResponse to definitions
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-04-28 22:39:16 +02:00
Sebastiaan van Stijn
64e96932bd
api: rename volume.VolumeCreateBody to volume.CreateOptions
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-04-28 22:39:14 +02:00
Sebastiaan van Stijn
18281c92fa
api: rename volume.VolumeListOKBody to volume.ListResponse
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-04-28 22:39:12 +02:00
Sebastiaan van Stijn
4caf68f4f6
api/types: rename volume.VolumeUsageData to volume.UsageData
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-04-28 22:39:10 +02:00
Sebastiaan van Stijn
3cae9fef16
imports: remove "volumetypes" aliases for api/types/volume
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-04-28 22:39:04 +02:00
Sebastiaan van Stijn
7293857456
api: rename ContainerWaitOKBody to container.WaitResponse
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-04-28 22:38:20 +02:00
Sebastiaan van Stijn
5ecb6fb68b
vendor: github.com/containerd/containerd v1.6.3
full diff: https://github.com/containerd/containerd/compare/v1.6.2...v1.6.3

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-04-28 22:37:10 +02:00
Brian Goff
b3332b851a
Merge pull request #43517 from Juneezee/test/t.Setenv
test: use `T.Setenv` to set env vars in tests
2022-04-28 12:02:01 -07:00
Sebastiaan van Stijn
647aede6ad
Merge pull request #43515 from corhere/swarmkit-v2
Bump swarmkit to v2
2022-04-28 20:08:42 +02:00
Sebastiaan van Stijn
3fd01fc3c6
Merge pull request #43531 from crazy-max/gitattr-dockerfile
chore: fix linguist for Dockerfile
2022-04-28 13:31:54 +02:00
Sebastiaan van Stijn
4cf904494e
daemon: reloadMaxDownloadAttempts() remove validation
reloadMaxDownloadAttempts() is used to reload the configuration,
but validation happened before merging the config with the defaults.

This removes the validation from this function, instead centralizing
validation in config.Validate().

NOTE:
Currently this validation is "ok", as it checks for "nil" values;
I am working on changes to reduce the use of pointers in the config,
and instead provide a mechanism to fill in defaults. This change is
in preparation of that.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-04-28 09:30:06 +02:00
Sebastiaan van Stijn
c46e2e85ee
daemon/config: Reload(): add TODO for config reload logic
The Reload logic is problematic and needs a rewrite.

Currently, config.Reload() is validating newConfig before the reload callback
is executed. At that point, newConfig may be a partial configuration, yet to be
merged with the existing configuration (in the "reload()" callback). Validating
this config before it's merged can result in incorrect validation errors.

However, the current "reload()" callback we use is DaemonCli.reloadConfig(),
which includes a call to Daemon.Reload(), which both performs "merging" and
validation, as well as actually updating the daemon configuration. Calling
DaemonCli.reloadConfig() *before* validation, could thus lead to a failure in
that function (making the reload non-atomic).

While *some* errors could always occur when applying/updating the config, we
should make it more atomic, and;

1. get (a copy of) the active configuration
2. get the new configuration
3. apply the (reloadable) options from the new configuration
4. validate the merged results
5. apply the new configuration.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-04-28 09:30:04 +02:00
Sebastiaan van Stijn
9a54dadc44
daemon/config: MergeDaemonConfigurations() don't validate intermediates
MergeDaemonConfigurations was validating the configs before and after
merging. However, the "fileConfig" configuration may contain only a
"partial" configuration (options to apply to / override the existing
config). This means that some options may not be set and contain default
or empty values.

Validating such partial configurations can produce validation failures,
so to prevent those, we should validate the configuration _after_
merging, to validate the "final" state.

There's more cleaning up / improvements to be made in this area; for
example, we currently use our "self crafted" `getConflictFreeConfiguration()`
function, which is used to detect options that are not allowed to
be overridden, and which could potentially be handled by mergo.Merge(),
but leaving those changes for a future exercise.

This patch removes the first validation step, changing the function
to only validate the resulting configuration after merging.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-04-28 09:30:02 +02:00
Sebastiaan van Stijn
b819480899
daemon/config: Reload(): normalize labels before validation
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-04-28 09:30:00 +02:00
Sebastiaan van Stijn
1f8d44babf
Merge pull request #43533 from thaJeztah/bump_containerd_binary_1.6.3
update containerd binary to v1.6.3
2022-04-27 21:21:04 +02:00
Brian Goff
f7d070b58c
Merge pull request #43538 from corhere/dry-metrics-definitions
metrics: DRY metric definitions
2022-04-27 10:26:25 -07:00
Sebastiaan van Stijn
21dac5e441
opts: remove IPOpt as it's no longer used
This option type was only used by us, and had no external consumers,
so we can remove it.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-04-27 11:14:12 +02:00
Sebastiaan van Stijn
ccb75439ff
cmd/dockerd: use flags.IPVar() instead of custom type
spf13/pflag now provides this out of the box, so no need to implement
and use our own value-type for this.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-04-27 11:14:10 +02:00
Sebastiaan van Stijn
5d352f6a87
cmd/dockerd: remove config_common_unix.go
This file was originally part of the work to support Solaris, and
there's nothing "not common unix" anymmore, so merging the files.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-04-27 11:14:08 +02:00
Sebastiaan van Stijn
92d9e892b5
cmd/dockerd: combine installUnixConfigFlags with installConfigFlags
installConfigFlags already has separate implementations for Linux and
Windows, so no need to further differentiate.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-04-27 11:14:07 +02:00
Sebastiaan van Stijn
83f67c63a6
cmd/dockerd: combine installRegistryServiceFlags with installCommonConfigFlags
There's no compelling reason to keep it in a separate function

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-04-27 11:14:05 +02:00
Sebastiaan van Stijn
1483905024
cmd/dockerd: remove some intermediate variables
use the Config itself to hold the "default" values.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-04-27 11:14:03 +02:00
Sebastiaan van Stijn
782de17bd0
cmd/dockerd: installCommonConfigFlags() re-group some flags
move deprecated options and some network-related options together

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-04-27 11:14:01 +02:00
Sebastiaan van Stijn
0ff0b8693e
cmd/dockerd: move storage-driver flag to unix-only file
The installCommonConfigFlags() function is meant for flags that are
supported by all platforms, so removing it from that function.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-04-27 11:13:58 +02:00
Sebastiaan van Stijn
2b1dcf4cbf
Merge pull request #43509 from thaJeztah/daemon_fix_hosts_validation_step1a
cmd/dockerd: improve validation to allow early exit
2022-04-27 11:13:38 +02:00
Sebastiaan van Stijn
a9be008f00
update containerd binary to v1.6.3
Release notes:

Welcome to the v1.6.3 release of containerd!

The third patch release for containerd 1.6 includes various fixes and updates.

Notable Updates

- Fix panic when configuring tracing plugin
- Improve image pull performance in CRI plugin
- Check for duplicate nspath
- Fix deadlock in cgroup metrics collector
- Mount devmapper xfs file system with "nouuid" option
- Make the temp mount as ready only in container WithVolumes
- Fix deadlock from leaving transaction open in native snapshotter
- Monitor OOMKill events to prevent missing container events

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-04-27 09:55:12 +02:00
CrazyMax
314a47492a
chore: fix linguist for Dockerfile
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-04-27 06:38:41 +02:00
Sebastiaan van Stijn
0603f87fab
cmd/dockerd: validate API configuration as part of --validate
Previously, the API server configuration would be initialized and
validated when starting the API. Because of this, invalid configuration
(e.g. missing or invalid TLS certificates) would not be detected
when using `dockerd --validate`.

This patch moves creation of the validation earlier, so that it's
validated as part of `dockerd --validate`.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-04-27 00:34:24 +02:00
Sebastiaan van Stijn
e16c3616e2
cmd/dockerd: change newAPIServerConfig() to only receive config.Config
This function took the whole daemon cli as argument but only needed the config

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-04-27 00:34:22 +02:00
Sebastiaan van Stijn
57c20c1b79
cmd/dockerd: normalize hosts when loading config
Previously, hosts were de-duplicated and normalized when starting
the API server (in `loadListeners()`), which meant that errors could
occur in that step (but not detected when using `dockerd --validate`),
as well as the list of hosts in the config not matching what would
actually be used (i.e., if duplicates were present).

This patch extracts the de-duplicating to a separate function, and
executes it as part of loading the daemon configuration, so that we
can fail early.

Moving this code also showed that some of this validation depended
on `newAPIServerConfig()` modifying the configuration (adding an
empty host if none was set) in order to have the parsing set a
default. This code was moved elsewhere, but a TODO comment added
as this logic is somewhat sketchy.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-04-27 00:34:20 +02:00
Sebastiaan van Stijn
7b3463f2c5
cmd/dockerd: loadDaemonCliConfig(): minor cleanup
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-04-27 00:34:19 +02:00