kubenix/tests/k8s/simple.nix

26 lines
540 B
Nix
Raw Normal View History

2019-02-20 09:34:15 +01:00
{ config, test, kubenix, k8s, ... }:
with k8s;
2019-02-12 16:22:18 +01:00
let
cfg = config.kubernetes.api.pods.nginx;
2019-02-12 16:22:18 +01:00
in {
imports = [
kubenix.k8s
];
test = {
name = "k8s-simple";
2019-02-12 16:22:18 +01:00
description = "Simple k8s testing wheter name, apiVersion and kind are preset";
assertions = [{
message = "should have apiVersion and kind set";
assertion = cfg.apiVersion == "v1" && cfg.kind == "Pod";
} {
message = "should have name set";
assertion = cfg.metadata.name == "nginx";
}];
};
kubernetes.api.pods.nginx = {};
2019-02-12 16:22:18 +01:00
}