mirror of
https://github.com/TECHNOFAB11/kubenix.git
synced 2025-12-12 08:00:06 +01:00
feat(legacy): improve tests for crd
This commit is contained in:
parent
1c71677527
commit
23331edff5
1 changed files with 20 additions and 5 deletions
|
|
@ -2,13 +2,29 @@
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
{
|
let
|
||||||
|
findObject = { kind, name }: filter (object:
|
||||||
|
object.kind == kind && object.metadata.name == name
|
||||||
|
) config.kubernetes.objects;
|
||||||
|
|
||||||
|
getObject = filter: head (findObject filter);
|
||||||
|
|
||||||
|
hasObject = { kind, name }: length (findObject { inherit kind name; }) == 1;
|
||||||
|
in {
|
||||||
imports = with kubenix.modules; [ test k8s legacy ];
|
imports = with kubenix.modules; [ test k8s legacy ];
|
||||||
|
|
||||||
test = {
|
test = {
|
||||||
name = "legacy-crd";
|
name = "legacy-crd";
|
||||||
description = "Simple test tesing kubenix legacy integration with crds crd";
|
description = "Simple test tesing kubenix legacy integration with crds crd";
|
||||||
assertions = [];
|
assertions = [{
|
||||||
|
message = "should define claim in module";
|
||||||
|
assertion =
|
||||||
|
hasObject {kind = "SecretClaim"; name = "secret-claim";};
|
||||||
|
} {
|
||||||
|
message = "should define claim in root";
|
||||||
|
assertion =
|
||||||
|
hasObject {kind = "SecretClaim"; name = "my-claim";};
|
||||||
|
}];
|
||||||
};
|
};
|
||||||
|
|
||||||
kubernetes.version = k8sVersion;
|
kubernetes.version = k8sVersion;
|
||||||
|
|
@ -76,12 +92,11 @@ with lib;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
kubernetes.modules.myclaim = {
|
kubernetes.modules.secret-claim = {
|
||||||
module = "secret-claim";
|
|
||||||
configuration.path = "tokens/test";
|
configuration.path = "tokens/test";
|
||||||
};
|
};
|
||||||
|
|
||||||
kubernetes.customResources.secret-claims.propagated-claim = {
|
kubernetes.customResources.secret-claims.my-claim = {
|
||||||
spec = {
|
spec = {
|
||||||
path = "secrets/test2";
|
path = "secrets/test2";
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue