Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 16f42b369474
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 0834e98ece64
Choose a head ref
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on Dec 2, 2018

  1. nixos/containers: Add assertion for container name length

    When privateNetwork is enabled, currently the container's interface name
    is derived from the container name. However, there's a hard limit
    on the size of interface names. To avoid conflicts and other issues,
    we set a limit on the container name when privateNetwork is enabled.
    
    Fixes #38509
    arianvp committed Dec 2, 2018
    Copy the full SHA
    bf10282 View commit details

Commits on Dec 5, 2018

  1. Merge pull request #51393 from arianvp/container-names

    nixos/containers: Add assertion for container name length
    flokli authored Dec 5, 2018
    Copy the full SHA
    0834e98 View commit details
Showing with 10 additions and 0 deletions.
  1. +10 −0 nixos/modules/virtualisation/containers.nix
10 changes: 10 additions & 0 deletions nixos/modules/virtualisation/containers.nix
Original file line number Diff line number Diff line change
@@ -461,6 +461,16 @@ in
{ boot.isContainer = true;
networking.hostName = mkDefault name;
networking.useDHCP = false;
assertions = [
{
assertion = config.privateNetwork -> stringLength name < 12;
message = ''
Container name `${name}` is too long: When `privateNetwork` is enabled, container names can
not be longer than 11 characters, because the container's interface name is derived from it.
This might be fixed in the future. See https://github.com/NixOS/nixpkgs/issues/38509
'';
}
];
};
in [ extraConfig ] ++ (map (x: x.value) defs);
prefix = [ "containers" name ];