mirror of
https://github.com/TECHNOFAB11/kubenix.git
synced 2025-12-12 16:10:05 +01:00
pass nixos path explicitly
This commit is contained in:
parent
7b148cd171
commit
e4493addd8
4 changed files with 15 additions and 9 deletions
8
ci.nix
8
ci.nix
|
|
@ -1,7 +1,11 @@
|
||||||
let
|
let
|
||||||
pkgs = import (builtins.fetchTarball "https://github.com/NixOS/nixpkgs-channels/archive/nixos-unstable.tar.gz") {};
|
nixpkgsSrc = builtins.fetchTarball "https://github.com/NixOS/nixpkgs-channels/archive/nixos-unstable.tar.gz";
|
||||||
|
pkgs = import nixpkgsSrc {};
|
||||||
|
|
||||||
lib = pkgs.lib;
|
lib = pkgs.lib;
|
||||||
|
|
||||||
release = import ./release.nix { inherit pkgs lib; };
|
release = import ./release.nix {
|
||||||
|
inherit pkgs lib;
|
||||||
|
nixosPath = "${nixpkgsSrc}/nixos";
|
||||||
|
};
|
||||||
in with lib; release.test-results
|
in with lib; release.test-results
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,16 @@
|
||||||
{ config, pkgs, lib, kubenix, ... }:
|
{ nixosPath, config, pkgs, lib, kubenix, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.testing;
|
cfg = config.testing;
|
||||||
|
|
||||||
nixosTesting = import <nixpkgs/nixos/lib/testing.nix> {
|
nixosTesting = import "${nixosPath}/lib/testing.nix" {
|
||||||
inherit pkgs;
|
inherit pkgs;
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
};
|
};
|
||||||
|
|
||||||
kubernetesBaseConfig = { config, pkgs, lib, nodes, ... }: let
|
kubernetesBaseConfig = { modulesPath, config, pkgs, lib, nodes, ... }: let
|
||||||
master = findFirst
|
master = findFirst
|
||||||
(node: any (role: role == "master") node.config.services.kubernetes.roles)
|
(node: any (role: role == "master") node.config.services.kubernetes.roles)
|
||||||
(throw "no master node")
|
(throw "no master node")
|
||||||
|
|
@ -23,7 +23,7 @@ let
|
||||||
(attrValues nodes)}
|
(attrValues nodes)}
|
||||||
'';
|
'';
|
||||||
in {
|
in {
|
||||||
imports = [ <nixpkgs/nixos/modules/profiles/minimal.nix> ];
|
imports = [ "${toString modulesPath}/profiles/minimal.nix" ];
|
||||||
|
|
||||||
config = mkMerge [{
|
config = mkMerge [{
|
||||||
boot.postBootCommands = "rm -fr /var/lib/kubernetes/secrets /tmp/shared/*";
|
boot.postBootCommands = "rm -fr /var/lib/kubernetes/secrets /tmp/shared/*";
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
{ pkgs ? import <nixpkgs> {}, lib ? pkgs.lib, e2e ? true, throwError ? true }:
|
{ pkgs ? import <nixpkgs> {}, nixosPath ? <nixpkgs/nixos>, lib ? pkgs.lib
|
||||||
|
, e2e ? true, throwError ? true }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
|
@ -19,7 +20,7 @@ let
|
||||||
};
|
};
|
||||||
|
|
||||||
runK8STests = k8sVersion: pkgs.recurseIntoAttrs (import ./tests {
|
runK8STests = k8sVersion: pkgs.recurseIntoAttrs (import ./tests {
|
||||||
inherit pkgs lib kubenix k8sVersion e2e throwError;
|
inherit pkgs lib kubenix k8sVersion e2e throwError nixosPath;
|
||||||
});
|
});
|
||||||
in rec {
|
in rec {
|
||||||
generate.k8s = pkgs.linkFarm "k8s-generated.nix" [{
|
generate.k8s = pkgs.linkFarm "k8s-generated.nix" [{
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
, lib ? pkgs.lib
|
, lib ? pkgs.lib
|
||||||
, kubenix ? import ../. { inherit pkgs lib; }
|
, kubenix ? import ../. { inherit pkgs lib; }
|
||||||
, k8sVersion ? "1.13"
|
, k8sVersion ? "1.13"
|
||||||
|
, nixosPath ? <nixpkgs/nixos>
|
||||||
|
|
||||||
# whether any testing error should throw an error
|
# whether any testing error should throw an error
|
||||||
, throwError ? true
|
, throwError ? true
|
||||||
|
|
@ -43,7 +44,7 @@ let
|
||||||
inherit pkgs;
|
inherit pkgs;
|
||||||
};
|
};
|
||||||
specialArgs = {
|
specialArgs = {
|
||||||
inherit kubenix;
|
inherit kubenix nixosPath;
|
||||||
};
|
};
|
||||||
}).config;
|
}).config;
|
||||||
in test.testing
|
in test.testing
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue