mirror of
https://github.com/TECHNOFAB11/kubenix.git
synced 2026-02-02 09:25:10 +01:00
fmt
This commit is contained in:
parent
a0ce293db8
commit
60592d3096
55 changed files with 23668 additions and 30925 deletions
|
|
@ -1,22 +1,28 @@
|
|||
{ config, lib, kubenix, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.kubernetes.api.resources.customResourceDefinitions.crontabs;
|
||||
in
|
||||
{
|
||||
imports = with kubenix.modules; [ test k8s ];
|
||||
config,
|
||||
lib,
|
||||
kubenix,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.kubernetes.api.resources.customResourceDefinitions.crontabs;
|
||||
in {
|
||||
imports = with kubenix.modules; [test k8s];
|
||||
|
||||
test = {
|
||||
name = "k8s-order";
|
||||
description = "test tesing k8s resource order";
|
||||
assertions = [{
|
||||
message = "should have correct order of resources";
|
||||
assertion =
|
||||
(elemAt config.kubernetes.objects 0).kind == "CustomResourceDefinition" &&
|
||||
(elemAt config.kubernetes.objects 1).kind == "Namespace" &&
|
||||
(elemAt config.kubernetes.objects 2).kind == "CronTab";
|
||||
}];
|
||||
assertions = [
|
||||
{
|
||||
message = "should have correct order of resources";
|
||||
assertion =
|
||||
(elemAt config.kubernetes.objects 0).kind
|
||||
== "CustomResourceDefinition"
|
||||
&& (elemAt config.kubernetes.objects 1).kind == "Namespace"
|
||||
&& (elemAt config.kubernetes.objects 2).kind == "CronTab";
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
kubernetes.resources.customResourceDefinitions.crontabs = {
|
||||
|
|
@ -24,38 +30,42 @@ in
|
|||
metadata.name = "crontabs.stable.example.com";
|
||||
spec = {
|
||||
group = "stable.example.com";
|
||||
versions = [{
|
||||
name = "v1";
|
||||
served = true;
|
||||
schema = true;
|
||||
}];
|
||||
versions = [
|
||||
{
|
||||
name = "v1";
|
||||
served = true;
|
||||
schema = true;
|
||||
}
|
||||
];
|
||||
scope = "Namespaced";
|
||||
names = {
|
||||
plural = "crontabs";
|
||||
singular = "crontab";
|
||||
kind = "CronTab";
|
||||
shortNames = [ "ct" ];
|
||||
shortNames = ["ct"];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
kubernetes.customTypes = [{
|
||||
name = "crontabs";
|
||||
description = "CronTabs resources";
|
||||
kubernetes.customTypes = [
|
||||
{
|
||||
name = "crontabs";
|
||||
description = "CronTabs resources";
|
||||
|
||||
attrName = "cronTabs";
|
||||
group = "stable.example.com";
|
||||
version = "v1";
|
||||
kind = "CronTab";
|
||||
module = {
|
||||
options.schedule = mkOption {
|
||||
description = "Crontab schedule script";
|
||||
type = types.str;
|
||||
attrName = "cronTabs";
|
||||
group = "stable.example.com";
|
||||
version = "v1";
|
||||
kind = "CronTab";
|
||||
module = {
|
||||
options.schedule = mkOption {
|
||||
description = "Crontab schedule script";
|
||||
type = types.str;
|
||||
};
|
||||
};
|
||||
};
|
||||
}];
|
||||
}
|
||||
];
|
||||
|
||||
kubernetes.resources.namespaces.test = { };
|
||||
kubernetes.resources.namespaces.test = {};
|
||||
|
||||
kubernetes.resources."stable.example.com"."v1".CronTab.crontab.spec.schedule = "* * * * *";
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue