feat: refactor tests

This commit is contained in:
Jaka Hudoklin 2019-02-17 19:42:01 +01:00
parent 0d68a401f0
commit b4c4f17cc9
No known key found for this signature in database
GPG key ID: 916062A1C4748647
10 changed files with 3 additions and 2 deletions

36
tests/k8s/crd.nix Normal file
View file

@ -0,0 +1,36 @@
{ config, lib, kubenix, ... }:
with lib;
let
cfg = config.kubernetes.api.customresourcedefinitions.crontabs;
in {
imports = [
kubenix.k8s
];
test = {
name = "k8s/crd";
description = "Simple test tesing CRD";
enable = builtins.compareVersions config.kubernetes.version "1.8" >= 0;
assertions = [{
message = "should have group set";
assertion = cfg.spec.group == "stable.example.com";
}];
};
kubernetes.api.customresourcedefinitions.crontabs = {
metadata.name = "crontabs.stable.example.com";
spec = {
group = "stable.example.com";
version = "v1";
scope = "Namespaced";
names = {
plural = "crontabs";
singular = "crontab";
kind = "CronTab";
shortNames = ["ct"];
};
};
};
}