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

nixos/cri-o: add `networkDir` option #98086

Merged
merged 1 commit into from Sep 23, 2020
Merged

Conversation

@saschagrunert
Copy link
Member

saschagrunert commented Sep 16, 2020

Motivation for this change

The new option can be used to specify the network directory for CNI
plugin configurations.

Required by #96084

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
@saschagrunert saschagrunert requested a review from zowoq as a code owner Sep 16, 2020
@saschagrunert
Copy link
Member Author

saschagrunert commented Sep 16, 2020

Copy link
Contributor

zowoq left a comment

Sorry, I forgot about this.

@saschagrunert saschagrunert force-pushed the saschagrunert:cri-o-network-dir branch from 87e39be to c13fd19 Sep 23, 2020
# Loopback should be always added independently if a custom network dir is used or not
environment.etc."cni/net.d/99-loopback.conf".source = copyFile "${pkgs.cri-o-unwrapped.src}/contrib/cni/99-loopback.conf";
Comment on lines 123 to 124

This comment has been minimized.

@saschagrunert

saschagrunert Sep 23, 2020 Author Member

Referencing to https://github.com/NixOS/nixpkgs/pull/98086/files#r493229379

Do you see any good way how we can make this point to /etc/cni/net.d by default and if cfg.networkDir != null to the target location?

I'd tried it with something like environment."${cfg.networkDir}/99-loopback.conf".source but this would not work at all.

This comment has been minimized.

@zowoq

zowoq Sep 23, 2020 Contributor

We could use networkDir as an internal option that is only set by other modules and expose a cni_default_network option to users to let them choose a non-default config in /etc/cni/net.d if networkDir isn't already set by another module?

This comment has been minimized.

@saschagrunert

saschagrunert Sep 23, 2020 Author Member

Hm, how would this look like? I now have the networkDir set in the config, but how to make the option only internally available?

This comment has been minimized.

@zowoq

zowoq Sep 23, 2020 Contributor

This should work:

    networkDir = mkOption {
      type = types.nullOr types.path;
      default = null;
      description = "...";
      internal = true;
    };

This comment has been minimized.

@saschagrunert

saschagrunert Sep 23, 2020 Author Member

Indeed, thank you! 🙏 Changed as suggested.

@saschagrunert saschagrunert force-pushed the saschagrunert:cri-o-network-dir branch from c13fd19 to b88cbf9 Sep 23, 2020
The new option can be used to specify the network directory for CNI
plugin configurations.

Signed-off-by: Sascha Grunert <sgrunert@suse.com>
@saschagrunert saschagrunert force-pushed the saschagrunert:cri-o-network-dir branch from b88cbf9 to c0f0a27 Sep 23, 2020
@zowoq zowoq merged commit eac4389 into NixOS:master Sep 23, 2020
16 checks passed
16 checks passed
tests tests
Details
action
Details
Evaluation Performance Report Evaluator Performance Report
Details
Wait for ofborg
Details
grahamcofborg-eval ^.^!
Details
grahamcofborg-eval-check-meta config.nix: checkMeta = true
Details
grahamcofborg-eval-darwin nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="c0f0a27"; rev="c0f0a27bc4ea5239b2c0047b59b2035325538636"; } ./pkgs/t
Details
grahamcofborg-eval-lib-tests nix-build --arg pkgs import ./. {} ./lib/tests/release.nix
Details
grahamcofborg-eval-nixos nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="c0f0a27"; rev="c0f0a27bc4ea5239b2c0047b59b2035325538636"; } ./nixos/
Details
grahamcofborg-eval-nixos-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="c0f0a27"; rev="c0f0a27bc4ea5239b2c0047b59b2035325538636"; } ./nixos/
Details
grahamcofborg-eval-nixos-options nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="c0f0a27"; rev="c0f0a27bc4ea5239b2c0047b59b2035325538636"; } ./nixos/
Details
grahamcofborg-eval-nixpkgs-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="c0f0a27"; rev="c0f0a27bc4ea5239b2c0047b59b2035325538636"; } ./pkgs/t
Details
grahamcofborg-eval-nixpkgs-tarball nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="c0f0a27"; rev="c0f0a27bc4ea5239b2c0047b59b2035325538636"; } ./pkgs/t
Details
grahamcofborg-eval-nixpkgs-unstable-jobset nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="c0f0a27"; rev="c0f0a27bc4ea5239b2c0047b59b2035325538636"; } ./pkgs/t
Details
grahamcofborg-eval-package-list nix-env -qa --json --file .
Details
grahamcofborg-eval-package-list-no-aliases nix-env -qa --json --file . --arg config { allowAliases = false; }
Details
@saschagrunert saschagrunert deleted the saschagrunert:cri-o-network-dir branch Sep 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.