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

Document CLI support for per interface sysctls #4994

Merged
merged 6 commits into from
May 29, 2024

Conversation

robmry
Copy link
Contributor

@robmry robmry commented Apr 8, 2024

- What I did

The extended --network syntax is needed, but wasn't documented.

The quoting needed to set more than one sysctl using docker [create|run] --network driver-opt or docker network connect --driver-opt isn't obvious - so, added tests and examples to the docs.

- How I did it

  • Fix TestNetworkConnectWithFlags - because it didn't do anything, and is needed to test the new option.
  • Document the v25.0 changes to allow more than one network connection in create/run, with the extended --network syntax.
  • Added tests and examples to docs for per-interface sysctl setting.

- How to verify it

New tests added.

- Description for the changelog

Document the use of `driver-opt` in the CLI for setting per-interface sysctls.

@codecov-commenter
Copy link

codecov-commenter commented Apr 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 61.33%. Comparing base (6c70360) to head (d5d94e4).
Report is 35 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4994      +/-   ##
==========================================
+ Coverage   61.09%   61.33%   +0.24%     
==========================================
  Files         298      295       -3     
  Lines       20675    20701      +26     
==========================================
+ Hits        12631    12697      +66     
+ Misses       7147     7101      -46     
- Partials      897      903       +6     

@robmry robmry requested a review from dvdksn April 8, 2024 09:57
@robmry robmry force-pushed the 47639_per-interface-sysctls branch from e91f6e2 to 5474acf Compare April 8, 2024 09:59
@robmry robmry marked this pull request as ready for review April 8, 2024 10:12
@robmry robmry requested a review from thaJeztah as a code owner April 8, 2024 10:12
docs/reference/commandline/container_run.md Outdated Show resolved Hide resolved
docs/reference/commandline/container_run.md Outdated Show resolved Hide resolved
docs/reference/commandline/container_run.md Outdated Show resolved Hide resolved
docs/reference/commandline/container_run.md Show resolved Hide resolved
@robmry robmry force-pushed the 47639_per-interface-sysctls branch from 5474acf to 774ed6a Compare April 8, 2024 15:04
@robmry robmry requested a review from akerouanton April 8, 2024 16:03
@robmry robmry added this to the 27.0.0 milestone May 2, 2024
robmry added 2 commits May 8, 2024 14:13
The test didn't do anything useful...
- Despite its name it used newCreateCommand() instead of
  newConnectCommand() with create flags/options instead of connect.
- There was no fake networkCreateFunc(), so the result of the 'connect'
  wasn't checked.
- The fake networkConnectFunc() was never called, so didn't spot the
  problem.

Signed-off-by: Rob Murray <rob.murray@docker.com>
Support for connecting more than one network using the container run
command was added in v25.0 for API > 1.44 - describe that in the docs.

Signed-off-by: Rob Murray <rob.murray@docker.com>
@robmry robmry force-pushed the 47639_per-interface-sysctls branch 2 times, most recently from f4cef3e to 9f7d811 Compare May 9, 2024 08:43
@robmry robmry changed the title CLI support for per interface sysctls Document CLI support for per interface sysctls May 9, 2024
Copy link
Contributor

@dvdksn dvdksn left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@laurazard laurazard left a comment

Choose a reason for hiding this comment

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

LGTM

@laurazard
Copy link
Member

@thaJeztah does this LGTY?

Signed-off-by: Rob Murray <rob.murray@docker.com>
Signed-off-by: Rob Murray <rob.murray@docker.com>
Signed-off-by: Rob Murray <rob.murray@docker.com>
Signed-off-by: Rob Murray <rob.murray@docker.com>
@robmry robmry force-pushed the 47639_per-interface-sysctls branch from 9f7d811 to d5d94e4 Compare May 26, 2024 12:20
@robmry
Copy link
Contributor Author

robmry commented May 26, 2024

Updated to reflect a last-minute change of heart on the sysctl naming (net.ipv6.conf.eth0.disable_ipv6 was shortened to ipv6.conf.disable_ipv6, now it's net.ipv6.conf.IFNAME.disable_ipv6).

Copy link
Member

@thaJeztah thaJeztah 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 8ed44f9 into docker:master May 29, 2024
91 checks passed
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

7 participants