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
Conversation
cc @NixOS/podman |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I forgot about this.
87e39be
to
c13fd19
Compare
# 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"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, how would this look like? I now have the networkDir
set in the config, but how to make the option only internally available?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should work:
networkDir = mkOption {
type = types.nullOr types.path;
default = null;
description = "...";
internal = true;
};
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, thank you! 🙏 Changed as suggested.
c13fd19
to
b88cbf9
Compare
The new option can be used to specify the network directory for CNI plugin configurations. Signed-off-by: Sascha Grunert <sgrunert@suse.com>
b88cbf9
to
c0f0a27
Compare
Motivation for this change
The new option can be used to specify the network directory for CNI
plugin configurations.
Required by #96084
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)