Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[26.0 backport] Restore the SetKey prestart hook. #47646

Merged
merged 1 commit into from
Mar 28, 2024

Conversation

vvoland
Copy link
Contributor

@vvoland vvoland commented Mar 28, 2024

- What I did

Running SetKey to store the OCI Sandbox key after task creation, rather than from the OCI prestart hook, meant it happened after sysctl settings were applied by the runtime - which was the intention, we wanted to complete Sandbox configuration after IPv6 had been disabled by a sysctl if that was going to happen.

But, it meant '--sysctl' options for a specfic network interface caused container task creation to fail, because the interface is only moved into the network namespace during SetKey.

- How I did it

Restored the SetKey prestart hook.

Regenerate config files that depend on the container's support for IPv6 after the task has been created.

The changes in the second partially-reverted commit, to check IPv6 support before assigning an interface address/gateway would no longer work, but are no longer necessary. IPv6 addresses applied during the SetKey prestart hook will be removed when the sysctl disabling IPv6 in the container is applied.

- How to verify it

Added a regression test, to make sure it's possible to set an interface-specfic sysctl.

The tests for IPv6 addresses in '/etc/hosts' when IPv6 is disabled still work.

- Description for the changelog

Fix a regression that meant network interface specific `--sysctl` options prevented container startup.

Partially reverts 0046b16 "daemon: set libnetwork sandbox key w/o OCI hook"

Running SetKey to store the OCI Sandbox key after task creation, rather
than from the OCI prestart hook, meant it happened after sysctl settings
were applied by the runtime - which was the intention, we wanted to
complete Sandbox configuration after IPv6 had been disabled by a sysctl
if that was going to happen.

But, it meant '--sysctl' options for a specfic network interface caused
container task creation to fail, because the interface is only moved into
the network namespace during SetKey.

This change restores the SetKey prestart hook, and regenerates config
files that depend on the container's support for IPv6 after the task has
been created. It also adds a regression test that makes sure it's possible
to set an interface-specfic sysctl.

Signed-off-by: Rob Murray <rob.murray@docker.com>
(cherry picked from commit fde80fe)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
Copy link
Member

@akerouanton akerouanton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@akerouanton akerouanton merged commit f2550b3 into moby:26.0 Mar 28, 2024
142 checks passed
renovate bot added a commit to earthly/dind that referenced this pull request Apr 15, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [docker/docker](https://togithub.com/docker/docker) | patch | `26.0.0`
-> `26.0.1` |

---

### Release Notes

<details>
<summary>docker/docker (docker/docker)</summary>

### [`v26.0.1`](https://togithub.com/moby/moby/releases/tag/v26.0.1)

[Compare
Source](https://togithub.com/docker/docker/compare/v26.0.0-rc2...v26.0.1)

#### 26.0.1

For a full list of pull requests and changes in this release, refer to
the relevant GitHub milestones:

- [docker/cli, 26.0.1
milestone](https://togithub.com/docker/cli/issues?q=is%3Aclosed+milestone%3A26.0.1)
- [moby/moby, 26.0.1
milestone](https://togithub.com/moby/moby/issues?q=is%3Aclosed+milestone%3A26.0.1)
- Deprecated and removed features, see [Deprecated
Features](https://togithub.com/docker/cli/blob/v26.0.1/docs/deprecated.md).
- Changes to the Engine API, see [API version
history](https://togithub.com/moby/moby/blob/v26.0.1/docs/api/version-history.md).

##### Bug fixes and enhancements

- Fix a regression that meant network interface specific `--sysctl`
options prevented container startup.
[moby/moby#47646](https://togithub.com/moby/moby/pull/47646)
- Remove erroneous `platform` from image `config` OCI descriptor in
`docker save` output.
[moby/moby#47694](https://togithub.com/moby/moby/pull/47694)
- containerd image store: OCI archives produced by `docker save` will
now have a non-empty `mediaType` field in `index.json`
[moby/moby#47701](https://togithub.com/moby/moby/pull/47701)
- Fix a regression that prevented the internal resolver from forwarding
requests from IPvlan L3 networks to external resolvers.
[moby/moby#47705](https://togithub.com/moby/moby/pull/47705)
- Prevent the use of external resolvers in IPvlan and Macvlan networks
created with no parent interface specified.
[moby/moby#47705](https://togithub.com/moby/moby/pull/47705)

##### Packaging updates

- Update Go runtime to 1.21.9
[moby/moby#47671](https://togithub.com/moby/moby/pull/47671),
[docker/cli#4987](https://togithub.com/docker/cli/pull/4987)
- Update Compose to [v1.26.1
](https://togithub.com/docker/compose/releases/tag/v2.26.1),
[docker/docker-ce-packaging#1009](https://togithub.com/docker/docker-ce-packaging/pull/1009)
- Update containerd to
[v1.7.15](https://togithub.com/containerd/containerd/releases/tag/v1.7.15)
(static binaries only)
[moby/moby#47692](https://togithub.com/moby/moby/pull/47692)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 6am on monday" (UTC), Automerge
- At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/earthly/dind).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yOTMuMCIsInVwZGF0ZWRJblZlciI6IjM3LjI5My4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJyZW5vdmF0ZSJdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
maxgoffart added a commit to Advanced-Observability/Micro-Services-Topology-Generator that referenced this pull request Jun 12, 2024
Issue with Docker Engine 26.0.0 making it impossible to modify
per-interface configuration with sysctl has been fixed in version 26.0.1.

See the following for more details:
- moby/moby@fc14d8f
- moby/moby#47646
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants