mirror of
https://github.com/TECHNOFAB11/kubenix.git
synced 2025-12-12 16:10:05 +01:00
feat: improve testing
This commit is contained in:
parent
ae431d1acc
commit
987c6e4173
6 changed files with 51 additions and 18 deletions
|
|
@ -12,8 +12,16 @@ in {
|
|||
name = "k8s-deployment";
|
||||
description = "Simple k8s testing a simple deployment";
|
||||
assertions = [{
|
||||
message = "should have correct apiVersion and kind set";
|
||||
assertion = cfg.apiVersion == "apps/v1" && cfg.kind == "Deployment";
|
||||
message = "should have correct apiVersion and kind set for 1.8+";
|
||||
assertion =
|
||||
if ((builtins.compareVersions config.kubernetes.version "1.7") <= 0)
|
||||
then cfg.apiVersion == "apps/v1beta1"
|
||||
else if ((builtins.compareVersions config.kubernetes.version "1.8") <= 0)
|
||||
then cfg.apiVersion == "apps/v1beta2"
|
||||
else cfg.apiVersion == "apps/v1";
|
||||
} {
|
||||
message = "should have corrent kind set";
|
||||
assertion = cfg.kind == "Deployment";
|
||||
} {
|
||||
message = "should have replicas set";
|
||||
assertion = cfg.spec.replicas == 10;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue