kubenix/tests/k8s/1.13/crd.nix

41 lines
970 B
Nix
Raw Normal View History

{ config, lib, kubenix, k8sVersion, ... }:
2019-02-13 17:05:18 +01:00
with lib;
let
2019-09-27 18:29:00 +02:00
cfg = config.kubernetes.resources.customResourceDefinitions.crontabs;
2019-02-13 17:05:18 +01:00
in {
imports = with kubenix.modules; [ test k8s ];
2019-02-13 17:05:18 +01:00
test = {
2019-09-27 18:29:00 +02:00
name = "k8s-1-13-crd";
description = "Simple test testing CRD for k8s 1.13";
2019-02-13 17:05:18 +01:00
enable = builtins.compareVersions config.kubernetes.version "1.13" >= 0;
assertions = [{
message = "should have versions set";
assertion = (head cfg.spec.versions).name == "v1";
}];
};
kubernetes.version = k8sVersion;
2019-09-27 18:29:00 +02:00
kubernetes.resources.customResourceDefinitions.crontabs = {
2019-02-13 17:05:18 +01:00
metadata.name = "crontabs.stable.example.com";
spec = {
group = "stable.example.com";
versions = [{
name = "v1";
served = true;
storage = true;
}];
scope = "Namespaced";
names = {
plural = "crontabs";
singular = "crontab";
kind = "CronTab";
shortNames = ["ct"];
};
};
};
}