2022-04-02 12:40:35 -07:00
|
|
|
{
|
|
|
|
|
config,
|
|
|
|
|
lib,
|
|
|
|
|
kubenix,
|
|
|
|
|
...
|
|
|
|
|
}:
|
|
|
|
|
with lib; let
|
2019-09-27 18:29:00 +02:00
|
|
|
pod = config.kubernetes.api.resources.core.v1.Pod.test;
|
|
|
|
|
deployment = config.kubernetes.api.resources.apps.v1.Deployment.nginx-deployment;
|
2022-04-02 12:40:35 -07:00
|
|
|
in {
|
|
|
|
|
imports = with kubenix.modules; [test k8s];
|
2019-04-05 20:27:47 +02:00
|
|
|
|
|
|
|
|
test = {
|
|
|
|
|
name = "k8s-imports";
|
|
|
|
|
description = "Simple k8s testing imports";
|
|
|
|
|
enable = builtins.compareVersions config.kubernetes.version "1.10" >= 0;
|
2022-04-02 12:40:35 -07:00
|
|
|
assertions = [
|
|
|
|
|
{
|
|
|
|
|
message = "Pod should have name set";
|
|
|
|
|
assertion = pod.metadata.name == "test";
|
|
|
|
|
}
|
2021-05-13 17:27:08 -04:00
|
|
|
{
|
|
|
|
|
message = "Deployment should have name set";
|
|
|
|
|
assertion = deployment.metadata.name == "nginx-deployment";
|
2022-04-02 12:40:35 -07:00
|
|
|
}
|
|
|
|
|
];
|
2019-04-05 20:27:47 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
kubernetes.imports = [
|
|
|
|
|
./pod.json
|
|
|
|
|
./deployment.yaml
|
|
|
|
|
];
|
|
|
|
|
}
|