mirror of
https://github.com/TECHNOFAB11/kubenix.git
synced 2026-02-02 01:15:11 +01:00
flake: format
This commit is contained in:
parent
eb3ec20f46
commit
baa1a6c949
16 changed files with 86 additions and 72 deletions
|
|
@ -51,10 +51,12 @@
|
|||
|
||||
services.nginx.spec = {
|
||||
selector.app = "nginx";
|
||||
ports = [{
|
||||
ports = [
|
||||
{
|
||||
name = "http";
|
||||
port = 80;
|
||||
}];
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,11 @@
|
|||
{kubenix ? import ../../../..}:
|
||||
kubenix.evalModules.${builtins.currentSystem} {
|
||||
module = { kubenix, config, pkgs, ... }: {
|
||||
module = {
|
||||
kubenix,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
imports = with kubenix.modules; [k8s docker];
|
||||
docker = {
|
||||
registry.url = "docker.somewhere.io";
|
||||
|
|
|
|||
|
|
@ -1,4 +1,7 @@
|
|||
{ dockerTools, nginx }:
|
||||
{
|
||||
dockerTools,
|
||||
nginx,
|
||||
}:
|
||||
dockerTools.buildLayeredImage {
|
||||
name = "nginx";
|
||||
contents = [nginx];
|
||||
|
|
|
|||
|
|
@ -4,12 +4,14 @@ kubenix.evalModules.x86_64-linux {
|
|||
imports = [kubenix.modules.testing];
|
||||
testing = {
|
||||
tests = [./test.nix];
|
||||
common = [{
|
||||
common = [
|
||||
{
|
||||
features = ["k8s"];
|
||||
options = {
|
||||
kubernetes.version = "1.24";
|
||||
};
|
||||
}];
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,8 @@
|
|||
{ kubenix, test, ... }: {
|
||||
{
|
||||
kubenix,
|
||||
test,
|
||||
...
|
||||
}: {
|
||||
imports = [kubenix.modules.test];
|
||||
|
||||
test = {
|
||||
|
|
|
|||
12
flake.nix
12
flake.nix
|
|
@ -13,19 +13,13 @@
|
|||
};
|
||||
};
|
||||
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs,
|
||||
...
|
||||
} @ inputs:
|
||||
outputs = inputs @ {self, ...}:
|
||||
(inputs.flake-utils.lib.eachDefaultSystem (
|
||||
system: let
|
||||
pkgs = import inputs.nixpkgs {
|
||||
overlays = [
|
||||
self.overlays.default
|
||||
];
|
||||
config.allowUnsupportedSystem = true;
|
||||
inherit system;
|
||||
overlays = [self.overlays.default];
|
||||
config.allowUnsupportedSystem = true;
|
||||
};
|
||||
|
||||
inherit (pkgs) lib;
|
||||
|
|
|
|||
|
|
@ -170,15 +170,19 @@ with lib; let
|
|||
else
|
||||
# make it an attribute set of submodules if only x-kubernetes-patch-merge-key is present, or
|
||||
# x-kubernetes-patch-merge-key == x-kubernetes-list-map-keys.
|
||||
if hasAttr "properties" swagger.definitions.${refDefinition property.items} &&
|
||||
hasAttr "name" swagger.definitions.${refDefinition property.items}.properties
|
||||
if
|
||||
hasAttr "properties" swagger.definitions.${refDefinition property.items}
|
||||
&& hasAttr "name" swagger.definitions.${refDefinition property.items}.properties
|
||||
then let
|
||||
mergeKey = "name";
|
||||
in {
|
||||
type = requiredOrNot (coerceAttrsOfSubmodulesToListByKey (refDefinition property.items) mergeKey (if hasAttr "x-kubernetes-list-map-keys" property then property."x-kubernetes-list-map-keys" else []));
|
||||
type = requiredOrNot (coerceAttrsOfSubmodulesToListByKey (refDefinition property.items) mergeKey (
|
||||
if hasAttr "x-kubernetes-list-map-keys" property
|
||||
then property."x-kubernetes-list-map-keys"
|
||||
else []
|
||||
));
|
||||
apply = attrsToList;
|
||||
}
|
||||
|
||||
else {
|
||||
type =
|
||||
if (refDefinition property.items) == _name
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ with lib;
|
|||
# kubernetes version to template chart for
|
||||
kubeVersion ? null,
|
||||
# whether to include CRD
|
||||
includeCRDs ? false
|
||||
includeCRDs ? false,
|
||||
}: let
|
||||
valuesJsonFile = builtins.toFile "${name}-values.json" (builtins.toJSON values);
|
||||
in
|
||||
|
|
@ -31,7 +31,7 @@ with lib;
|
|||
${optionalString (kubeVersion != null) "--kube-version ${kubeVersion}"} \
|
||||
${optionalString (namespace != null) "--namespace ${namespace}"} \
|
||||
${optionalString (values != {}) "-f ${valuesJsonFile}"} \
|
||||
${optionalString (includeCRDs) "--include-crds"} \
|
||||
${optionalString includeCRDs "--include-crds"} \
|
||||
${chart} >resources.yaml
|
||||
|
||||
# split multy yaml file into multiple files
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue