From 2712e8971633e0a6267c007e778c7b41f2fefce8 Mon Sep 17 00:00:00 2001 From: Bryton Hall Date: Fri, 7 Jul 2023 22:01:34 -0400 Subject: [PATCH] switch formatting to nixpkgs-fmt --- .vscode/extensions.json | 1 + .vscode/settings.json | 2 +- default.nix | 15 +- docs/content/examples/default.nix | 4 +- docs/content/examples/deployment/default.nix | 6 +- docs/content/examples/deployment/module.nix | 14 +- docs/content/examples/helm/default.nix | 6 +- docs/content/examples/image/default.nix | 13 +- docs/content/examples/image/image.nix | 11 +- docs/content/examples/namespaces/default.nix | 6 +- docs/content/examples/namespaces/module.nix | 30 +- .../examples/namespaces/namespaced.nix | 23 +- docs/content/examples/pod/default.nix | 6 +- docs/content/examples/secrets/default.nix | 6 +- docs/content/examples/testing/default.nix | 22 +- docs/content/examples/testing/test.nix | 8 +- docs/default.nix | 135 +- flake.nix | 193 +- lib/default.nix | 11 +- lib/docker/default.nix | 11 +- lib/helm/chart2json.nix | 86 +- lib/helm/default.nix | 6 +- lib/helm/fetchhelm.nix | 124 +- lib/helm/test.nix | 10 +- lib/k8s/default.nix | 94 +- lib/upstreamables.nix | 28 +- modules/base.nix | 10 +- modules/docker.nix | 46 +- modules/helm.nix | 77 +- modules/istio-overrides.nix | 14 +- modules/istio.nix | 6628 ++++++++--------- modules/k8s.nix | 290 +- modules/submodule.nix | 18 +- modules/submodules.nix | 538 +- modules/testing/default.nix | 28 +- modules/testing/docker.nix | 30 +- modules/testing/driver/kubetest.nix | 68 +- modules/testing/driver/kubetestdrv.nix | 22 +- modules/testing/evalTest.nix | 46 +- modules/testing/runtime/local.nix | 10 +- modules/testing/runtime/nixos-k8s.nix | 65 +- modules/testing/test-options.nix | 18 +- .../networking/cluster/kubectl/default.nix | 11 +- .../networking/cluster/kubernetes/default.nix | 39 +- pkgs/generators/default.nix | 57 +- pkgs/generators/istio/default.nix | 311 +- pkgs/generators/k8s/default.nix | 285 +- pkgs/kubenix.nix | 158 +- tests/default.nix | 43 +- tests/helm/simple.nix | 14 +- tests/images.nix | 60 +- tests/istio/bookinfo.nix | 10 +- tests/k8s/crd.nix | 22 +- tests/k8s/defaults.nix | 16 +- tests/k8s/deployment.nix | 26 +- tests/k8s/imports.nix | 12 +- tests/k8s/order.nix | 13 +- tests/k8s/simple.nix | 14 +- tests/k8s/submodule.nix | 65 +- tests/submodules/defaults.nix | 29 +- tests/submodules/exports.nix | 18 +- tests/submodules/passthru.nix | 27 +- tests/submodules/simple.nix | 19 +- tests/submodules/versioning.nix | 15 +- versions.nix | 18 +- 65 files changed, 4839 insertions(+), 5222 deletions(-) diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 4228320..53a0821 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,5 +1,6 @@ { "recommendations": [ + "jnoortheen.nix-ide", "mkhl.direnv" ] } diff --git a/.vscode/settings.json b/.vscode/settings.json index 5cedd61..35ff122 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,6 +1,6 @@ { "git.detectSubmodules": false, - "nix.formatterPath": "alejandra", + "nix.enableLanguageServer": true, "search.exclude": { "docs/themes": true } diff --git a/default.nix b/default.nix index c7d0c26..90a4ab7 100644 --- a/default.nix +++ b/default.nix @@ -1,14 +1,13 @@ ( import - ( - let - lock = builtins.fromJSON (builtins.readFile ./flake.lock); - in + ( + let + lock = builtins.fromJSON (builtins.readFile ./flake.lock); + in fetchTarball { url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz"; sha256 = lock.nodes.flake-compat.locked.narHash; } - ) - {src = ./.;} -) -.defaultNix + ) + { src = ./.; } +).defaultNix diff --git a/docs/content/examples/default.nix b/docs/content/examples/default.nix index e9ac5d3..6111357 100644 --- a/docs/content/examples/default.nix +++ b/docs/content/examples/default.nix @@ -1,4 +1,4 @@ { - deployment = import ./deployment {}; - testing = import ./testing {}; + deployment = import ./deployment { }; + testing = import ./testing { }; } diff --git a/docs/content/examples/deployment/default.nix b/docs/content/examples/deployment/default.nix index 398d290..7b6fc4a 100644 --- a/docs/content/examples/deployment/default.nix +++ b/docs/content/examples/deployment/default.nix @@ -1,8 +1,8 @@ -{kubenix ? import ../../../..}: +{ kubenix ? import ../../../.. }: kubenix.evalModules.${builtins.currentSystem} { - module = {kubenix, ...}: { + module = { kubenix, ... }: { # instead of defining everything inline, let's import it - imports = [./module.nix]; + imports = [ ./module.nix ]; # annotate the generated resources with a project name kubenix.project = "example"; diff --git a/docs/content/examples/deployment/module.nix b/docs/content/examples/deployment/module.nix index 34ded79..5d4a93b 100644 --- a/docs/content/examples/deployment/module.nix +++ b/docs/content/examples/deployment/module.nix @@ -1,5 +1,5 @@ -{kubenix, ...}: { - imports = [kubenix.modules.k8s]; +{ kubenix, ... }: { + imports = [ kubenix.modules.k8s ]; kubernetes.resources = { deployments.nginx.spec = { @@ -50,12 +50,10 @@ services.nginx.spec = { selector.app = "nginx"; - ports = [ - { - name = "http"; - port = 80; - } - ]; + ports = [{ + name = "http"; + port = 80; + }]; }; }; } diff --git a/docs/content/examples/helm/default.nix b/docs/content/examples/helm/default.nix index 756902e..464d93a 100644 --- a/docs/content/examples/helm/default.nix +++ b/docs/content/examples/helm/default.nix @@ -1,7 +1,7 @@ -{kubenix ? import ../../../..}: +{ kubenix ? import ../../../.. }: kubenix.evalModules.${builtins.currentSystem} { - module = {kubenix, ...}: { - imports = [kubenix.modules.helm]; + module = { kubenix, ... }: { + imports = [ kubenix.modules.helm ]; kubernetes.helm.releases.example = { chart = kubenix.lib.helm.fetch { repo = "https://charts.bitnami.com/bitnami"; diff --git a/docs/content/examples/image/default.nix b/docs/content/examples/image/default.nix index 6c084bc..cb5e889 100644 --- a/docs/content/examples/image/default.nix +++ b/docs/content/examples/image/default.nix @@ -1,15 +1,10 @@ -{kubenix ? import ../../../..}: +{ kubenix ? import ../../../.. }: kubenix.evalModules.${builtins.currentSystem} { - module = { - kubenix, - config, - pkgs, - ... - }: { - imports = with kubenix.modules; [k8s docker]; + module = { kubenix, config, pkgs, ... }: { + imports = with kubenix.modules; [ k8s docker ]; docker = { registry.url = "docker.somewhere.io"; - images.example.image = pkgs.callPackage ./image.nix {}; + images.example.image = pkgs.callPackage ./image.nix { }; }; kubernetes.resources.pods.example.spec.containers = { custom.image = config.docker.images.example.path; diff --git a/docs/content/examples/image/image.nix b/docs/content/examples/image/image.nix index c451233..74938da 100644 --- a/docs/content/examples/image/image.nix +++ b/docs/content/examples/image/image.nix @@ -1,10 +1,7 @@ -{ - dockerTools, - nginx, -}: +{ dockerTools, nginx }: dockerTools.buildLayeredImage { name = "nginx"; - contents = [nginx]; + contents = [ nginx ]; extraCommands = '' mkdir -p etc chmod u+w etc @@ -12,9 +9,9 @@ dockerTools.buildLayeredImage { echo "nginx:x:1000:nginx" > etc/group ''; config = { - Cmd = ["nginx" "-c" "/etc/nginx/nginx.conf"]; + Cmd = [ "nginx" "-c" "/etc/nginx/nginx.conf" ]; ExposedPorts = { - "80/tcp" = {}; + "80/tcp" = { }; }; }; } diff --git a/docs/content/examples/namespaces/default.nix b/docs/content/examples/namespaces/default.nix index b8f70b6..bbc8167 100644 --- a/docs/content/examples/namespaces/default.nix +++ b/docs/content/examples/namespaces/default.nix @@ -1,7 +1,7 @@ -{kubenix ? import ../../../..}: +{ kubenix ? import ../../../.. }: kubenix.evalModules.${builtins.currentSystem} { - module = {kubenix, ...}: { - imports = [./module.nix]; + module = { kubenix, ... }: { + imports = [ ./module.nix ]; kubenix.project = "multi-namespace-example"; kubernetes.version = "1.24"; diff --git a/docs/content/examples/namespaces/module.nix b/docs/content/examples/namespaces/module.nix index 4de759e..f903d54 100644 --- a/docs/content/examples/namespaces/module.nix +++ b/docs/content/examples/namespaces/module.nix @@ -1,11 +1,5 @@ -{ - config, - lib, - pkgs, - kubenix, - ... -}: { - imports = with kubenix.modules; [submodules k8s]; +{ config, lib, pkgs, kubenix, ... }: { + imports = with kubenix.modules; [ submodules k8s ]; # Import submodule. submodules.imports = [ @@ -26,12 +20,10 @@ # Now we can set the args options defined in the submodule. args.kubernetes.resources = { services.nginx.spec = { - ports = [ - { - name = "http"; - port = 80; - } - ]; + ports = [{ + name = "http"; + port = 80; + }]; selector.app = "nginx"; }; }; @@ -41,12 +33,10 @@ submodule = "namespaced"; args.kubernetes.resources = { services.nginx.spec = { - ports = [ - { - name = "https"; - port = 443; - } - ]; + ports = [{ + name = "https"; + port = 443; + }]; selector.app = "nginx"; }; }; diff --git a/docs/content/examples/namespaces/namespaced.nix b/docs/content/examples/namespaces/namespaced.nix index fb3b48c..14435b4 100644 --- a/docs/content/examples/namespaces/namespaced.nix +++ b/docs/content/examples/namespaces/namespaced.nix @@ -1,13 +1,12 @@ -{ - config, - kubenix, - lib, - # Name of submodule instance. - name, - # This is a shorthand for config.submodule.args and contains +{ config +, kubenix +, lib +, # Name of submodule instance. + name +, # This is a shorthand for config.submodule.args and contains # final values of the args options. - args, - ... + args +, ... }: { imports = with kubenix.modules; [ # This needs to be imported in order to define a submodule. @@ -25,7 +24,7 @@ # to set kubernetes options from the k8s module which are already # precisely typed. type = lib.types.attrs; - default = {}; + default = { }; }; }; @@ -54,9 +53,9 @@ kubernetes = lib.mkMerge [ # Use instance name as namespace - {namespace = name;} + { namespace = name; } # Create namespace object - {resources.namespaces.${name} = {};} + { resources.namespaces.${name} = { }; } # All resources defined here will use the above namespace args.kubernetes ]; diff --git a/docs/content/examples/pod/default.nix b/docs/content/examples/pod/default.nix index 657bd97..cb53065 100644 --- a/docs/content/examples/pod/default.nix +++ b/docs/content/examples/pod/default.nix @@ -1,11 +1,11 @@ # let's creata a function whose only input is the kubenix package -{kubenix ? import ../../../..}: +{ kubenix ? import ../../../.. }: # evalModules is our main entrypoint kubenix.evalModules.${builtins.currentSystem} { # to it, we pass a module that accepts a (different) kubenix object - module = {kubenix, ...}: { + module = { kubenix, ... }: { # in order to define options, we need to import their definitions - imports = [kubenix.modules.k8s]; + imports = [ kubenix.modules.k8s ]; # now we have full access to define Kubernetes resources kubernetes.resources.pods = { # "example" is the name of our pod diff --git a/docs/content/examples/secrets/default.nix b/docs/content/examples/secrets/default.nix index 2c013e5..3b36ee8 100644 --- a/docs/content/examples/secrets/default.nix +++ b/docs/content/examples/secrets/default.nix @@ -1,7 +1,7 @@ -{kubenix ? import ../../../..}: +{ kubenix ? import ../../../.. }: kubenix.evalModules.${builtins.currentSystem} { - module = {kubenix, ...}: { - imports = [kubenix.modules.k8s]; + module = { kubenix, ... }: { + imports = [ kubenix.modules.k8s ]; kubernetes.resources.secrets.example.stringData = { password = "ref+file:///path/to/secret"; }; diff --git a/docs/content/examples/testing/default.nix b/docs/content/examples/testing/default.nix index 5b7b035..a80dd68 100644 --- a/docs/content/examples/testing/default.nix +++ b/docs/content/examples/testing/default.nix @@ -1,17 +1,15 @@ -{kubenix ? import ../../../..}: +{ kubenix ? import ../../../.. }: kubenix.evalModules.x86_64-linux { - module = {kubenix, ...}: { - imports = [kubenix.modules.testing]; + module = { kubenix, ... }: { + imports = [ kubenix.modules.testing ]; testing = { - tests = [./test.nix]; - common = [ - { - features = ["k8s"]; - options = { - kubernetes.version = "1.24"; - }; - } - ]; + tests = [ ./test.nix ]; + common = [{ + features = [ "k8s" ]; + options = { + kubernetes.version = "1.24"; + }; + }]; }; }; } diff --git a/docs/content/examples/testing/test.nix b/docs/content/examples/testing/test.nix index 079bf24..e35478f 100644 --- a/docs/content/examples/testing/test.nix +++ b/docs/content/examples/testing/test.nix @@ -1,9 +1,5 @@ -{ - kubenix, - test, - ... -}: { - imports = [kubenix.modules.test]; +{ kubenix, test, ... }: { + imports = [ kubenix.modules.test ]; test = { name = "example"; diff --git a/docs/default.nix b/docs/default.nix index 87ea28b..0c3b42c 100644 --- a/docs/default.nix +++ b/docs/default.nix @@ -1,14 +1,10 @@ # adapted from: https://discourse.nixos.org/t/franken-script-to-generate-nixos-options-docs-with-custom-modules/1674/4 -{ - pkgs, - options, -}: let - extraSources = []; +{ pkgs, options }: +let + extraSources = [ ]; lib = pkgs.lib; - optionsListVisible = - lib.filter (opt: opt.visible && !opt.internal) - (lib.optionAttrSetToDocList options); + optionsListVisible = lib.filter (opt: opt.visible && !opt.internal) (lib.optionAttrSetToDocList options); # Replace functions by the string substFunction = x: @@ -24,78 +20,75 @@ isPath = x: (builtins.typeOf x) == "path"; - optionsListDesc = lib.flip map optionsListVisible ( - opt: - opt - // { - description = let + optionsListDesc = lib.flip map optionsListVisible (opt: + opt // { + description = + let attempt = builtins.tryEval opt.description; in - if attempt.success - then attempt.value - else "N/A"; - declarations = map stripAnyPrefixes opt.declarations; - } - // lib.optionalAttrs (opt ? example) { - example = substFunction opt.example; - } - // lib.optionalAttrs (opt ? default) { - default = substFunction opt.default; - } - // lib.optionalAttrs (opt ? type) { - type = substFunction opt.type; - } - // lib.optionalAttrs - (opt ? relatedPackages && opt.relatedPackages != []) - { - relatedPackages = genRelatedPackages opt.relatedPackages; - } + if attempt.success + then attempt.value + else "N/A"; + declarations = map stripAnyPrefixes opt.declarations; + } // lib.optionalAttrs (opt ? example) { + example = substFunction opt.example; + } // lib.optionalAttrs (opt ? default) { + default = substFunction opt.default; + } // lib.optionalAttrs (opt ? type) { + type = substFunction opt.type; + } // lib.optionalAttrs (opt ? relatedPackages && opt.relatedPackages != [ ]) { + relatedPackages = genRelatedPackages opt.relatedPackages; + } ); - genRelatedPackages = packages: let - unpack = p: - if lib.isString p - then {name = p;} - else if lib.isList p - then {path = p;} - else p; - describe = args: let - title = args.title or null; - name = args.name or (lib.concatStringsSep "." args.path); - path = args.path or [args.name]; - package = - args.package - or (lib.attrByPath path - (throw - "Invalid package attribute path '${toString path}'") - pkgs); - in - "" - + "${lib.optionalString (title != null) + genRelatedPackages = packages: + let + unpack = p: + if lib.isString p + then { name = p; } + else if lib.isList p + then { path = p; } + else p; + describe = args: + let + title = args.title or null; + name = args.name or (lib.concatStringsSep "." args.path); + path = args.path or [ args.name ]; + package = + args.package + or (lib.attrByPath path + (throw + "Invalid package attribute path '${toString path}'") + pkgs); + in + "" + + "${lib.optionalString (title != null) "${title} aka "}pkgs.${name} (${package.meta.name})" - + lib.optionalString (!package.meta.available) - " [UNAVAILABLE]" - + ": ${package.meta.description or "???"}." - + lib.optionalString (args ? comment) - "\n${args.comment}" - + lib.optionalString (package.meta ? longDescription) - "\n${package.meta.longDescription}" - + "" - + ""; - in "${lib.concatStringsSep "\n" (map (p: + + lib.optionalString (!package.meta.available) + " [UNAVAILABLE]" + + ": ${package.meta.description or "???"}." + + lib.optionalString (args ? comment) + "\n${args.comment}" + + lib.optionalString (package.meta ? longDescription) + "\n${package.meta.longDescription}" + + "" + + ""; + in + "${lib.concatStringsSep "\n" (map (p: describe (unpack p)) packages)}"; - optionLess = a: b: let - ise = lib.hasPrefix "enable"; - isp = lib.hasPrefix "package"; - cmp = - lib.splitByAndCompare ise lib.compare - (lib.splitByAndCompare isp lib.compare lib.compare); - in + optionLess = a: b: + let + ise = lib.hasPrefix "enable"; + isp = lib.hasPrefix "package"; + cmp = + lib.splitByAndCompare ise lib.compare + (lib.splitByAndCompare isp lib.compare lib.compare); + in lib.compareLists cmp a.loc b.loc < 0; - prefixesToStrip = map (p: "${toString p}/") ([../../..] ++ extraSources); + prefixesToStrip = map (p: "${toString p}/") ([ ../../.. ] ++ extraSources); stripAnyPrefixes = lib.flip (lib.fold lib.removePrefix) prefixesToStrip; ############################################################################### @@ -119,4 +112,4 @@ }) optionsList))); in - pkgs.writeText "options.json" optionsJSON +pkgs.writeText "options.json" optionsJSON diff --git a/flake.nix b/flake.nix index adcee86..045b5d5 100644 --- a/flake.nix +++ b/flake.nix @@ -11,57 +11,50 @@ }; }; - outputs = inputs @ {self, ...}: - (inputs.flake-utils.lib.eachDefaultSystem ( - system: let + outputs = inputs @ { self, ... }: + (inputs.flake-utils.lib.eachDefaultSystem (system: + let pkgs = import inputs.nixpkgs { inherit system; - overlays = [self.overlays.default]; + overlays = [ self.overlays.default ]; config.allowUnsupportedSystem = true; }; inherit (pkgs) lib; kubenix = { - lib = import ./lib {inherit lib pkgs;}; + lib = import ./lib { inherit lib pkgs; }; evalModules = self.evalModules.${system}; modules = self.nixosModules.kubenix; }; # evalModules with same interface as lib.evalModules and kubenix as # special argument - evalModules = attrs @ { - module ? null, - modules ? [module], - ... - }: let - lib' = lib.extend (lib: _self: import ./lib/upstreamables.nix {inherit lib pkgs;}); - attrs' = builtins.removeAttrs attrs ["module"]; - in + evalModules = attrs @ { module ? null, modules ? [ module ], ... }: + let + lib' = lib.extend (lib: _self: import ./lib/upstreamables.nix { inherit lib pkgs; }); + attrs' = builtins.removeAttrs attrs [ "module" ]; + in lib'.evalModules (lib.recursiveUpdate { - modules = - modules - ++ [ - { - config._module.args = { - inherit pkgs; - name = "default"; - }; - } - ]; + modules = modules ++ [{ + config._module.args = { + inherit pkgs; + name = "default"; + }; + }]; specialArgs = { inherit kubenix; inherit pkgs; }; } attrs'); - in { + in + { inherit evalModules pkgs; devShells.default = pkgs.mkShell { buildInputs = with pkgs; [ - # extra tools dive fd k9s @@ -81,103 +74,93 @@ ''; }; - formatter = - (inputs.treefmt.lib.evalModule pkgs { - projectRootFile = "flake.nix"; - programs = { - alejandra.enable = true; - black.enable = true; - prettier.enable = true; - shfmt.enable = true; - }; - settings.global.excludes = [ - "docs/themes/*" - "docs/layouts/*" - "modules/generated/*" - ]; - }) - .config - .build - .wrapper; + formatter = (inputs.treefmt.lib.evalModule pkgs { + projectRootFile = "flake.nix"; + programs = { + nixpkgs-fmt.enable = true; + black.enable = true; + prettier.enable = true; + shfmt.enable = true; + }; + settings.global.excludes = [ + "docs/themes/*" + "docs/layouts/*" + "modules/generated/*" + ]; + }).config.build.wrapper; apps = { docs = { type = "app"; - program = - (pkgs.writeShellScript "gen-docs" '' - set -eo pipefail + program = (pkgs.writeShellScript "gen-docs" '' + set -eo pipefail - # generate json object of module options - nix build '.#docs' -o ./docs/data/options.json + # generate json object of module options + nix build '.#docs' -o ./docs/data/options.json - # remove all old module pages - rm ./docs/content/modules/[!_]?*.md || true + # remove all old module pages + rm ./docs/content/modules/[!_]?*.md || true - # create a page for each module in hugo - for mod in ${builtins.toString (builtins.attrNames self.nixosModules.kubenix)}; do - [[ $mod == "base" ]] && mod=kubenix - [[ $mod == "k8s" ]] && mod=kubernetes - [[ $mod == "submodule"* ]] && continue - echo "  {{< options >}}" > ./docs/content/modules/$mod.md - done + # create a page for each module in hugo + for mod in ${builtins.toString (builtins.attrNames self.nixosModules.kubenix)}; do + [[ $mod == "base" ]] && mod=kubenix + [[ $mod == "k8s" ]] && mod=kubernetes + [[ $mod == "submodule"* ]] && continue + echo "  {{< options >}}" > ./docs/content/modules/$mod.md + done - # build the site - cd docs && ${pkgs.hugo}/bin/hugo "$@" - '') - .outPath; + # build the site + cd docs && ${pkgs.hugo}/bin/hugo "$@" + '').outPath; }; generate = { type = "app"; - program = - (pkgs.writeShellScript "gen-modules" '' - set -eo pipefail - dir=./modules/generated + program = (pkgs.writeShellScript "gen-modules" '' + set -eo pipefail + dir=./modules/generated - rm -rf $dir - mkdir $dir - nix build '.#generate-k8s' - cp ./result/* $dir/ + rm -rf $dir + mkdir $dir + nix build '.#generate-k8s' + cp ./result/* $dir/ - rm result - '') - .outPath; + rm result + '').outPath; }; }; - packages = - { - inherit (pkgs) kubernetes kubectl; - default = pkgs.callPackage ./pkgs/kubenix.nix { - inherit (self.packages.${system}); - evalModules = self.evalModules.${system}; - }; - docs = import ./docs { - inherit pkgs; - options = - (self.evalModules.${system} { - modules = builtins.attrValues (builtins.removeAttrs - # the submodules module currently doesn't evaluate: - # error: No module found ‹name›/latest - # not sure how important that documentation is a this time - self.nixosModules.kubenix ["submodule" "submodules"]); - }) - .options; - }; - } - // pkgs.lib.attrsets.mapAttrs' (name: value: pkgs.lib.attrsets.nameValuePair "generate-${name}" value) - (builtins.removeAttrs (pkgs.callPackage ./pkgs/generators {}) ["override" "overrideDerivation"]); + packages = { + inherit (pkgs) kubernetes kubectl; + default = pkgs.callPackage ./pkgs/kubenix.nix { + inherit (self.packages.${system}); + evalModules = self.evalModules.${system}; + }; + docs = import ./docs { + inherit pkgs; + options = (self.evalModules.${system} { + modules = builtins.attrValues (builtins.removeAttrs + # the submodules module currently doesn't evaluate: + # error: No module found ‹name›/latest + # not sure how important that documentation is a this time + self.nixosModules.kubenix [ "submodule" "submodules" ]); + }).options; + }; + } + // pkgs.lib.attrsets.mapAttrs' (name: value: pkgs.lib.attrsets.nameValuePair "generate-${name}" value) + (builtins.removeAttrs (pkgs.callPackage ./pkgs/generators { }) [ "override" "overrideDerivation" ]); - checks = let - wasSuccess = suite: - if suite.success - then pkgs.runCommandNoCC "testing-suite-config-assertions-for-${suite.name}-succeeded" {} "echo success > $out" - else pkgs.runCommandNoCC "testing-suite-config-assertions-for-${suite.name}-failed" {} "exit 1"; - examples = import ./docs/content/examples; - mkK8STests = attrs: - (import ./tests {inherit evalModules;}) - ({registry = "docker.io/gatehub";} // attrs); - in + checks = + let + wasSuccess = suite: + if suite.success + then pkgs.runCommandNoCC "testing-suite-config-assertions-for-${suite.name}-succeeded" { } "echo success > $out" + else pkgs.runCommandNoCC "testing-suite-config-assertions-for-${suite.name}-failed" { } "exit 1"; + examples = import ./docs/content/examples; + mkK8STests = attrs: + (import ./tests { inherit evalModules; }) + ({ registry = "docker.io/gatehub"; } // attrs); + in { # TODO: access "success" derivation with nice testing utils for nice output testing = wasSuccess examples.testing.config.testing; @@ -185,7 +168,7 @@ // builtins.listToAttrs (builtins.map (v: { name = "test-k8s-${builtins.replaceStrings ["."] ["_"] v}"; - value = wasSuccess (mkK8STests {k8sVersion = v;}); + value = wasSuccess (mkK8STests { k8sVersion = v; }); }) (import ./versions.nix).versions); } diff --git a/lib/default.nix b/lib/default.nix index d0abacd..9de833e 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -1,8 +1,5 @@ -{ - lib, - pkgs, -}: { - k8s = import ./k8s {inherit lib;}; - docker = import ./docker {inherit lib pkgs;}; - helm = import ./helm {inherit pkgs;}; +{ lib, pkgs }: { + k8s = import ./k8s { inherit lib; }; + docker = import ./docker { inherit lib pkgs; }; + helm = import ./helm { inherit pkgs; }; } diff --git a/lib/docker/default.nix b/lib/docker/default.nix index 5430583..5bb67b0 100644 --- a/lib/docker/default.nix +++ b/lib/docker/default.nix @@ -1,13 +1,6 @@ -{ - lib, - pkgs, -}: +{ lib, pkgs }: with lib; { - copyDockerImages = { - images, - dest, - args ? "", - }: + copyDockerImages = { images, dest, args ? "" }: pkgs.writeScript "copy-docker-images.sh" (concatMapStrings (image: '' #!${pkgs.runtimeShell} diff --git a/lib/helm/chart2json.nix b/lib/helm/chart2json.nix index 02de3e9..67ded8e 100644 --- a/lib/helm/chart2json.nix +++ b/lib/helm/chart2json.nix @@ -1,46 +1,42 @@ -{ - runCommand, - lib, - kubernetes-helm, - yq, -}: +{ runCommand, lib, kubernetes-helm, yq }: with lib; - { - # chart to template - chart, - # release name - name, - # namespace to install release into - namespace ? null, - # values to pass to chart - values ? {}, - # kubernetes version to template chart for - kubeVersion ? null, - # whether to include CRD - includeCRDs ? false, - # whether to include hooks - noHooks ? false, - }: let - valuesJsonFile = builtins.toFile "${name}-values.json" (builtins.toJSON values); - # The `helm template` and YAML -> JSON steps are separate `runCommand` derivations for easier debuggability - resourcesYaml = runCommand "${name}.yaml" {nativeBuildInputs = [kubernetes-helm];} '' - helm template "${name}" \ - ${optionalString (kubeVersion != null) "--kube-version ${kubeVersion}"} \ - ${optionalString (namespace != null) "--namespace ${namespace}"} \ - ${optionalString (values != {}) "-f ${valuesJsonFile}"} \ - ${optionalString includeCRDs "--include-crds"} \ - ${optionalString noHooks "--no-hooks"} \ - ${chart} >$out - ''; - in - runCommand "${name}.json" {} '' - # Remove null values - ${yq}/bin/yq -Scs 'walk( - if type == "object" then - with_entries(select(.value != null)) - elif type == "array" then - map(select(. != null)) - else - . - end)' ${resourcesYaml} >$out - '' +{ + # chart to template + chart + # release name +, name + # namespace to install release into +, namespace ? null + # values to pass to chart +, values ? { } + # kubernetes version to template chart for +, kubeVersion ? null + # whether to include CRD +, includeCRDs ? false + # whether to include hooks +, noHooks ? false +}: +let + valuesJsonFile = builtins.toFile "${name}-values.json" (builtins.toJSON values); + # The `helm template` and YAML -> JSON steps are separate `runCommand` derivations for easier debuggability + resourcesYaml = runCommand "${name}.yaml" { nativeBuildInputs = [ kubernetes-helm ]; } '' + helm template "${name}" \ + ${optionalString (kubeVersion != null) "--kube-version ${kubeVersion}"} \ + ${optionalString (namespace != null) "--namespace ${namespace}"} \ + ${optionalString (values != {}) "-f ${valuesJsonFile}"} \ + ${optionalString includeCRDs "--include-crds"} \ + ${optionalString noHooks "--no-hooks"} \ + ${chart} >$out + ''; +in +runCommand "${name}.json" { } '' + # Remove null values + ${yq}/bin/yq -Scs 'walk( + if type == "object" then + with_entries(select(.value != null)) + elif type == "array" then + map(select(. != null)) + else + . + end)' ${resourcesYaml} >$out +'' diff --git a/lib/helm/default.nix b/lib/helm/default.nix index 082a14d..519816b 100644 --- a/lib/helm/default.nix +++ b/lib/helm/default.nix @@ -1,4 +1,4 @@ -{pkgs}: { - chart2json = pkgs.callPackage ./chart2json.nix {}; - fetch = pkgs.callPackage ./fetchhelm.nix {}; +{ pkgs }: { + chart2json = pkgs.callPackage ./chart2json.nix { }; + fetch = pkgs.callPackage ./fetchhelm.nix { }; } diff --git a/lib/helm/fetchhelm.nix b/lib/helm/fetchhelm.nix index 19802f2..93b1c03 100644 --- a/lib/helm/fetchhelm.nix +++ b/lib/helm/fetchhelm.nix @@ -1,80 +1,48 @@ -{ - stdenvNoCC, - lib, - kubernetes-helm, - cacert, -}: let - cleanName = lib.replaceStrings ["/"] ["-"]; +{ stdenvNoCC, lib, kubernetes-helm, cacert }: +let + cleanName = lib.replaceStrings [ "/" ] [ "-" ]; in - { - # name of the chart - chart, - # chart url to fetch from custom location - chartUrl ? null, - # version of the chart - version ? null, - # chart hash - sha256, - # whether to extract chart - untar ? true, - # use custom charts repo - repo ? null, - # pass --verify to helm chart - verify ? false, - # pass --devel to helm chart - devel ? false, - }: - stdenvNoCC.mkDerivation { - name = "${cleanName chart}-${ - if version == null - then "dev" - else version - }"; +{ + # name of the chart + chart +, # chart url to fetch from custom location + chartUrl ? null +, # version of the chart + version ? null +, # chart hash + sha256 +, # whether to extract chart + untar ? true +, # use custom charts repo + repo ? null +, # pass --verify to helm chart + verify ? false +, # pass --devel to helm chart + devel ? false +, +}: +stdenvNoCC.mkDerivation { + name = "${cleanName chart}-${ if version == null then "dev" else version }"; - buildCommand = '' - export HOME="$PWD" - echo "adding helm repo" - ${ - if repo == null - then "" - else "helm repo add repository ${repo}" - } - echo "fetching helm chart" - helm fetch -d ./chart \ - ${ - if untar - then "--untar" - else "" - } \ - ${ - if version == null - then "" - else "--version ${version}" - } \ - ${ - if devel - then "--devel" - else "" - } \ - ${ - if verify - then "--verify" - else "" - } \ - ${ - if chartUrl == null - then - ( - if repo == null - then chart - else "repository/${chart}" - ) - else chartUrl - } - cp -r chart/*/ $out - ''; - outputHashMode = "recursive"; - outputHashAlgo = "sha256"; - outputHash = sha256; - nativeBuildInputs = [kubernetes-helm cacert]; - } + buildCommand = '' + export HOME="$PWD" + echo "adding helm repo" + ${ if repo == null then "" else "helm repo add repository ${repo}" } + echo "fetching helm chart" + helm fetch -d ./chart \ + ${ if untar then "--untar" else ""} \ + ${ if version == null then "" else "--version ${version}" } \ + ${ if devel then "--devel" else "" } \ + ${ if verify then "--verify" else "" } \ + ${ if chartUrl == null then ( + if repo == null + then chart + else "repository/${chart}" + ) else chartUrl} + cp -r chart/*/ $out + ''; + outputHashMode = "recursive"; + outputHashAlgo = "sha256"; + outputHash = sha256; + nativeBuildInputs = [ kubernetes-helm cacert ]; +} diff --git a/lib/helm/test.nix b/lib/helm/test.nix index 6f70351..e763bd7 100644 --- a/lib/helm/test.nix +++ b/lib/helm/test.nix @@ -1,7 +1,9 @@ -{pkgs ? import {}}: let - fetchhelm = pkgs.callPackage ./fetchhelm.nix {}; - chart2json = pkgs.callPackage ./chart2json.nix {}; -in rec { +{ pkgs ? import { } }: +let + fetchhelm = pkgs.callPackage ./fetchhelm.nix { }; + chart2json = pkgs.callPackage ./chart2json.nix { }; +in +rec { postgresql-chart = fetchhelm { chart = "stable/postgresql"; version = "0.18.1"; diff --git a/lib/k8s/default.nix b/lib/k8s/default.nix index 1edffdb..1a65a56 100644 --- a/lib/k8s/default.nix +++ b/lib/k8s/default.nix @@ -1,42 +1,32 @@ -{lib}: +{ lib }: with lib; rec { # TODO: refactor with mkOptionType - mkSecretOption = { - description ? "", - default ? {}, - allowNull ? true, - }: + mkSecretOption = { description ? "", default ? { }, allowNull ? true }: mkOption { inherit description; - type = - ( - if allowNull - then types.nullOr - else id - ) (types.submodule { - options = { - name = mkOption ({ - description = "Name of the secret where secret is stored"; - type = types.str; - default = default.name; - } - // (optionalAttrs (default ? "name") { - default = default.name; - })); + type = ( + if allowNull + then types.nullOr + else id + ) (types.submodule { + options = { + name = mkOption ({ + description = "Name of the secret where secret is stored"; + type = types.str; + default = default.name; + } // (optionalAttrs (default ? "name") { + default = default.name; + })); - key = mkOption ({ - description = "Name of the key where secret is stored"; - type = types.str; - } - // (optionalAttrs (default ? "key") { - default = default.key; - })); - }; - }); - default = - if default == null - then null - else {}; + key = mkOption ({ + description = "Name of the key where secret is stored"; + type = types.str; + } // (optionalAttrs (default ? "key") { + default = default.key; + })); + }; + }); + default = if default == null then null else { }; }; secretToEnv = value: { @@ -46,10 +36,7 @@ with lib; rec { }; # Creates kubernetes list from a list of kubernetes objects - mkList = { - items, - labels ? {}, - }: { + mkList = { items, labels ? { } }: { kind = "List"; apiVersion = "v1"; @@ -57,27 +44,22 @@ with lib; rec { }; # Creates hashed kubernetes list from a list of kubernetes objects - mkHashedList = { - items, - labels ? {}, - }: let - hash = builtins.hashString "sha1" (builtins.toJSON items); + mkHashedList = { items, labels ? { } }: + let + hash = builtins.hashString "sha1" (builtins.toJSON items); - labeledItems = - map - (item: - recursiveUpdate item { - metadata.labels."kubenix/hash" = hash; - }) - items; - in + labeledItems = map + (item: + recursiveUpdate item { + metadata.labels."kubenix/hash" = hash; + }) + items; + in mkList { items = labeledItems; - labels = - { - "kubenix/hash" = hash; - } - // labels; + labels = { + "kubenix/hash" = hash; + } // labels; }; inherit (lib) toBase64; diff --git a/lib/upstreamables.nix b/lib/upstreamables.nix index f31c690..f381126 100644 --- a/lib/upstreamables.nix +++ b/lib/upstreamables.nix @@ -1,30 +1,27 @@ -{ - lib, - pkgs, -}: +{ lib, pkgs }: with lib; let self = { importYAML = path: - importJSON (pkgs.runCommand "yaml-to-json" {} '' + importJSON (pkgs.runCommand "yaml-to-json" { } '' ${pkgs.yq}/bin/yq -c . ${path} > $out ''); toYAML = config: - builtins.readFile (pkgs.runCommand "to-yaml" {} '' + builtins.readFile (pkgs.runCommand "to-yaml" { } '' ${pkgs.yq}/bin/yq -y . ${pkgs.writeText "to-json" (builtins.toJSON config)} > $out ''); toMultiDocumentYaml = name: documents: - pkgs.runCommand name {} - (concatMapStringsSep "\necho --- >> $out\n" - ( - d: "${pkgs.yq}/bin/yq -y . ${pkgs.writeText "to-json" (builtins.toJSON config)} >> $out" - ) - documents); + pkgs.runCommand name { } + (concatMapStringsSep "\necho --- >> $out\n" + ( + d: "${pkgs.yq}/bin/yq -y . ${pkgs.writeText "to-json" (builtins.toJSON config)} >> $out" + ) + documents); toBase64 = value: builtins.readFile - (pkgs.runCommand "value-to-b64" {} "echo -n '${value}' | ${pkgs.coreutils}/bin/base64 -w0 > $out"); + (pkgs.runCommand "value-to-b64" { } "echo -n '${value}' | ${pkgs.coreutils}/bin/base64 -w0 > $out"); exp = base: exp: foldr (_value: acc: acc * base) 1 (range 1 exp); @@ -38,8 +35,7 @@ with lib; let i = 0; value = 0; } - (stringToCharacters value)) - .value; + (stringToCharacters value)).value; }; in - self +self diff --git a/modules/base.nix b/modules/base.nix index 7ff854e..d862740 100644 --- a/modules/base.nix +++ b/modules/base.nix @@ -1,4 +1,4 @@ -{lib, ...}: +{ lib, ... }: with lib; { options = { kubenix.project = mkOption { @@ -10,7 +10,7 @@ with lib; { _m.features = mkOption { description = "List of features exposed by module"; type = types.listOf types.str; - default = []; + default = [ ]; }; _m.propagate = mkOption { @@ -20,17 +20,17 @@ with lib; { features = mkOption { description = "List of features that submodule has to have to propagate module"; type = types.listOf types.str; - default = []; + default = [ ]; }; module = mkOption { description = "Module to propagate"; type = types.unspecified; - default = {}; + default = { }; }; }; })); - default = []; + default = [ ]; }; }; } diff --git a/modules/docker.nix b/modules/docker.nix index cdc055c..a178259 100644 --- a/modules/docker.nix +++ b/modules/docker.nix @@ -1,14 +1,9 @@ -{ - config, - lib, - pkgs, - docker, - ... -}: +{ config, lib, pkgs, docker, ... }: with lib; let cfg = config.docker; -in { - imports = [./base.nix]; +in +{ + imports = [ ./base.nix ]; options.docker = { registry.url = mkOption { @@ -19,11 +14,7 @@ in { images = mkOption { description = "Attribute set of docker images that should be published"; - type = types.attrsOf (types.submodule ({ - name, - config, - ... - }: { + type = types.attrsOf (types.submodule ({ name, config, ... }: { options = { image = mkOption { description = "Docker image to publish"; @@ -65,13 +56,13 @@ in { }; }; })); - default = {}; + default = { }; }; export = mkOption { description = "List of images to export"; type = types.listOf types.package; - default = []; + default = [ ]; }; copyScript = mkOption { @@ -86,25 +77,22 @@ in { config = { # define docker feature - _m.features = ["docker"]; + _m.features = [ "docker" ]; # propagate docker options if docker feature is enabled - _m.propagate = [ - { - features = ["docker"]; - module = _: { - # propagate registry options - docker.registry = cfg.registry; - }; - } - ]; + _m.propagate = [{ + features = [ "docker" ]; + module = _: { + # propagate registry options + docker.registry = cfg.registry; + }; + }]; # pass docker library as param - _module.args.docker = import ../lib/docker {inherit lib pkgs;}; + _module.args.docker = import ../lib/docker { inherit lib pkgs; }; # list of exported docker images - docker.export = - mapAttrsToList (_: i: i.image) + docker.export = mapAttrsToList (_: i: i.image) (filterAttrs (_: i: i.registry != null) config.docker.images); }; } diff --git a/modules/helm.nix b/modules/helm.nix index 3289d3e..563dfb0 100644 --- a/modules/helm.nix +++ b/modules/helm.nix @@ -1,12 +1,6 @@ # helm defines kubenix module with options for using helm charts # with kubenix -{ - config, - lib, - pkgs, - helm, - ... -}: +{ config, lib, pkgs, helm, ... }: with lib; let cfg = config.kubernetes.helm; @@ -16,29 +10,28 @@ with lib; let name = "recursive-attrs"; description = "recursive attribute set"; check = isAttrs; - merge = _loc: foldl' (res: def: recursiveUpdate res def.value) {}; + merge = _loc: foldl' (res: def: recursiveUpdate res def.value) { }; }; - parseApiVersion = apiVersion: let - splitted = splitString "/" apiVersion; - in { - group = - if length splitted == 1 - then "core" - else head splitted; - version = last splitted; - }; -in { - imports = [./k8s.nix]; + parseApiVersion = apiVersion: + let + splitted = splitString "/" apiVersion; + in + { + group = + if length splitted == 1 + then "core" + else head splitted; + version = last splitted; + }; +in +{ + imports = [ ./k8s.nix ]; options.kubernetes.helm = { releases = mkOption { description = "Attribute set of helm releases"; - type = types.attrsOf (types.submodule ({ - config, - name, - ... - }: { + type = types.attrsOf (types.submodule ({ config, name, ... }: { options = { name = mkOption { description = "Helm release name"; @@ -60,7 +53,7 @@ in { values = mkOption { description = "Values to pass to chart"; type = recursiveAttrs; - default = {}; + default = { }; }; kubeVersion = mkOption { @@ -72,7 +65,7 @@ in { overrides = mkOption { description = "Overrides to apply to all chart resources"; type = types.listOf types.unspecified; - default = []; + default = [ ]; }; overrideNamespace = mkOption { @@ -109,42 +102,40 @@ in { objects = mkOption { description = "Generated kubernetes objects"; type = types.listOf types.attrs; - default = []; + default = [ ]; }; }; - config.overrides = mkIf (config.overrideNamespace && config.namespace != null) [ - { - metadata.namespace = config.namespace; - } - ]; + config.overrides = mkIf (config.overrideNamespace && config.namespace != null) [{ + metadata.namespace = config.namespace; + }]; config.objects = importJSON (helm.chart2json { inherit (config) chart name namespace values kubeVersion includeCRDs noHooks; }); })); - default = {}; + default = { }; }; }; config = { # expose helm helper methods as module argument - _module.args.helm = import ../lib/helm {inherit pkgs;}; + _module.args.helm = import ../lib/helm { inherit pkgs; }; kubernetes.api.resources = mkMerge (flatten (mapAttrsToList - ( - _: release: - map - (object: let + (_: release: map + (object: + let apiVersion = parseApiVersion object.apiVersion; inherit (object.metadata) name; - in { + in + { "${apiVersion.group}"."${apiVersion.version}".${object.kind}."${name}" = mkMerge ([ - object - ] - ++ release.overrides); + object + ] + ++ release.overrides); }) - release.objects + release.objects ) cfg.releases)); }; diff --git a/modules/istio-overrides.nix b/modules/istio-overrides.nix index 6d79976..df7b991 100644 --- a/modules/istio-overrides.nix +++ b/modules/istio-overrides.nix @@ -1,19 +1,13 @@ -{ - lib, - definitions, -}: +{ lib, definitions }: with lib; { - "istio_networking_v1alpha3_StringMatch" = - recursiveUpdate - ( - recursiveUpdate + "istio_networking_v1alpha3_StringMatch" = recursiveUpdate + (recursiveUpdate definitions."istio_networking_v1alpha3_StringMatch_Exact" definitions."istio_networking_v1alpha3_StringMatch_Prefix" ) definitions."istio_networking_v1alpha3_StringMatch_Regex"; - "istio_networking_v1alpha3_PortSelector" = - recursiveUpdate + "istio_networking_v1alpha3_PortSelector" = recursiveUpdate definitions."istio_networking_v1alpha3_PortSelector_Name" definitions."istio_networking_v1alpha3_PortSelector_Number"; } diff --git a/modules/istio.nix b/modules/istio.nix index a98f4c9..3afc81a 100644 --- a/modules/istio.nix +++ b/modules/istio.nix @@ -1,4717 +1,4715 @@ # This file was generated with kubenix k8s generator, do not edit -{ - lib, - config, - ... -}: +{ lib, config, ... }: with lib; let - types = - lib.types - // rec { - str = mkOptionType { - name = "str"; - description = "string"; - check = isString; - merge = mergeEqualOption; - }; + types = lib.types // rec { + str = mkOptionType { + name = "str"; + description = "string"; + check = isString; + merge = mergeEqualOption; + }; - # Either value of type `finalType` or `coercedType`, the latter is - # converted to `finalType` using `coerceFunc`. - coercedTo = coercedType: coerceFunc: finalType: - mkOptionType rec { - name = "coercedTo"; - description = "${finalType.description} or ${coercedType.description}"; - check = x: finalType.check x || coercedType.check x; - merge = loc: defs: let + # Either value of type `finalType` or `coercedType`, the latter is + # converted to `finalType` using `coerceFunc`. + coercedTo = coercedType: coerceFunc: finalType: + mkOptionType rec { + name = "coercedTo"; + description = "${finalType.description} or ${coercedType.description}"; + check = x: finalType.check x || coercedType.check x; + merge = loc: defs: + let coerceVal = val: if finalType.check val then val - else let - coerced = coerceFunc val; - in + else + let + coerced = coerceFunc val; + in assert finalType.check coerced; coerced; in - finalType.merge loc (map (def: def // {value = coerceVal def.value;}) defs); - getSubOptions = finalType.getSubOptions; - getSubModules = finalType.getSubModules; - substSubModules = m: coercedTo coercedType coerceFunc (finalType.substSubModules m); - typeMerge = t1: t2: null; - functor = (defaultFunctor name) // {wrapped = finalType;}; - }; - }; + finalType.merge loc (map (def: def // { value = coerceVal def.value; }) defs); + getSubOptions = finalType.getSubOptions; + getSubModules = finalType.getSubModules; + substSubModules = m: coercedTo coercedType coerceFunc (finalType.substSubModules m); + typeMerge = t1: t2: null; + functor = (defaultFunctor name) // { wrapped = finalType; }; + }; + }; mkOptionDefault = mkOverride 1001; extraOptions = { - kubenix = {}; + kubenix = { }; }; mergeValuesByKey = mergeKey: values: listToAttrs (map (value: nameValuePair - ( - if isAttrs value.${mergeKey} - then toString value.${mergeKey}.content - else (toString value.${mergeKey}) - ) - value) + ( + if isAttrs value.${mergeKey} + then toString value.${mergeKey}.content + else (toString value.${mergeKey}) + ) + value) values); submoduleOf = ref: - types.submodule ({name, ...}: { + types.submodule ({ name, ... }: { options = definitions."${ref}".options; config = definitions."${ref}".config; }); submoduleWithMergeOf = ref: mergeKey: - types.submodule ({name, ...}: let - convertName = name: - if definitions."${ref}".options.${mergeKey}.type == types.int - then toInt name - else name; - in { - options = definitions."${ref}".options; - config = - definitions."${ref}".config - // { - ${mergeKey} = mkOverride 1002 (convertName name); - }; - }); + types.submodule ({ name, ... }: + let + convertName = name: + if definitions."${ref}".options.${mergeKey}.type == types.int + then toInt name + else name; + in + { + options = definitions."${ref}".options; + config = + definitions."${ref}".config + // { + ${mergeKey} = mkOverride 1002 (convertName name); + }; + }); submoduleForDefinition = ref: resource: kind: group: version: - types.submodule ({name, ...}: { + types.submodule ({ name, ... }: { options = definitions."${ref}".options // extraOptions; config = mkMerge ([ - definitions."${ref}".config - { - kind = mkOptionDefault kind; - apiVersion = mkOptionDefault version; + definitions."${ref}".config + { + kind = mkOptionDefault kind; + apiVersion = mkOptionDefault version; - # metdata.name cannot use option default, due deep config - metadata.name = mkOptionDefault name; - } - ] - ++ (config.defaults.${resource} or []) - ++ (config.defaults.all or [])); + # metdata.name cannot use option default, due deep config + metadata.name = mkOptionDefault name; + } + ] + ++ (config.defaults.${resource} or [ ]) + ++ (config.defaults.all or [ ])); }); coerceAttrsOfSubmodulesToListByKey = ref: mergeKey: ( types.coercedTo - (types.listOf (submoduleOf ref)) - (mergeValuesByKey mergeKey) - (types.attrsOf (submoduleWithMergeOf ref mergeKey)) + (types.listOf (submoduleOf ref)) + (mergeValuesByKey mergeKey) + (types.attrsOf (submoduleWithMergeOf ref mergeKey)) ); - definitions = - { - "google_rpc_Status" = { - options = { - "code" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + definitions = { + "google_rpc_Status" = { + options = { + "code" = mkOption { + description = ""; + type = types.nullOr types.int; + }; - "details" = mkOption { - description = ""; - type = types.nullOr (types.listOf (submoduleOf "protobuf_types_Any")); - }; + "details" = mkOption { + description = ""; + type = types.nullOr (types.listOf (submoduleOf "protobuf_types_Any")); + }; - "message" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "message" = mkOption { + description = ""; + type = types.nullOr types.str; }; + }; - config = { - "code" = mkOverride 1002 null; + config = { + "code" = mkOverride 1002 null; - "details" = mkOverride 1002 null; + "details" = mkOverride 1002 null; - "message" = mkOverride 1002 null; - }; + "message" = mkOverride 1002 null; }; + }; - "istio_adapter_bypass_Params" = { - options = { - "backendAddress" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "istio_adapter_bypass_Params" = { + options = { + "backendAddress" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "params" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "protobuf_types_Any"); - }; + "params" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "protobuf_types_Any"); + }; - "sessionBased" = mkOption { - description = ""; - type = types.nullOr types.bool; - }; + "sessionBased" = mkOption { + description = ""; + type = types.nullOr types.bool; }; + }; - config = { - "backendAddress" = mkOverride 1002 null; + config = { + "backendAddress" = mkOverride 1002 null; - "params" = mkOverride 1002 null; + "params" = mkOverride 1002 null; - "sessionBased" = mkOverride 1002 null; - }; + "sessionBased" = mkOverride 1002 null; }; + }; - "istio_adapter_circonus_Params" = { - options = { - "metrics" = mkOption { - description = ""; - type = types.nullOr (types.listOf (submoduleOf "istio_adapter_circonus_Params_MetricInfo")); - }; + "istio_adapter_circonus_Params" = { + options = { + "metrics" = mkOption { + description = ""; + type = types.nullOr (types.listOf (submoduleOf "istio_adapter_circonus_Params_MetricInfo")); + }; - "submissionInterval" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "submissionInterval" = mkOption { + description = ""; + type = types.nullOr types.int; + }; - "submissionUrl" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "submissionUrl" = mkOption { + description = ""; + type = types.nullOr types.str; }; + }; - config = { - "metrics" = mkOverride 1002 null; + config = { + "metrics" = mkOverride 1002 null; - "submissionInterval" = mkOverride 1002 null; + "submissionInterval" = mkOverride 1002 null; - "submissionUrl" = mkOverride 1002 null; - }; + "submissionUrl" = mkOverride 1002 null; }; + }; - "istio_adapter_circonus_Params_MetricInfo" = { - options = { - "name" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "istio_adapter_circonus_Params_MetricInfo" = { + options = { + "name" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "type" = mkOption { - description = ""; - type = types.unspecified; - }; + "type" = mkOption { + description = ""; + type = types.unspecified; }; + }; - config = { - "name" = mkOverride 1002 null; + config = { + "name" = mkOverride 1002 null; - "type" = mkOverride 1002 null; - }; + "type" = mkOverride 1002 null; }; + }; - "istio_adapter_denier_Params" = { - options = { - "status" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "google_rpc_Status"); - }; + "istio_adapter_denier_Params" = { + options = { + "status" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "google_rpc_Status"); + }; - "validDuration" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "validDuration" = mkOption { + description = ""; + type = types.nullOr types.int; + }; - "validUseCount" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "validUseCount" = mkOption { + description = ""; + type = types.nullOr types.int; }; + }; - config = { - "status" = mkOverride 1002 null; + config = { + "status" = mkOverride 1002 null; - "validDuration" = mkOverride 1002 null; + "validDuration" = mkOverride 1002 null; - "validUseCount" = mkOverride 1002 null; - }; + "validUseCount" = mkOverride 1002 null; }; + }; - "istio_adapter_dogstatsd_Params" = { - options = { - "address" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "istio_adapter_dogstatsd_Params" = { + options = { + "address" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "bufferLength" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "bufferLength" = mkOption { + description = ""; + type = types.nullOr types.int; + }; - "globalTags" = mkOption { - description = ""; - type = types.nullOr (types.attrsOf types.str); - }; + "globalTags" = mkOption { + description = ""; + type = types.nullOr (types.attrsOf types.str); + }; - "metrics" = mkOption { - description = ""; - type = types.nullOr types.attrs; - }; + "metrics" = mkOption { + description = ""; + type = types.nullOr types.attrs; + }; - "prefix" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "prefix" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "sampleRate" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "sampleRate" = mkOption { + description = ""; + type = types.nullOr types.int; }; + }; - config = { - "address" = mkOverride 1002 null; + config = { + "address" = mkOverride 1002 null; - "bufferLength" = mkOverride 1002 null; + "bufferLength" = mkOverride 1002 null; - "globalTags" = mkOverride 1002 null; + "globalTags" = mkOverride 1002 null; - "metrics" = mkOverride 1002 null; + "metrics" = mkOverride 1002 null; - "prefix" = mkOverride 1002 null; + "prefix" = mkOverride 1002 null; - "sampleRate" = mkOverride 1002 null; - }; + "sampleRate" = mkOverride 1002 null; }; + }; - "istio_adapter_dogstatsd_Params_MetricInfo" = { - options = { - "name" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "istio_adapter_dogstatsd_Params_MetricInfo" = { + options = { + "name" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "tags" = mkOption { - description = ""; - type = types.nullOr (types.attrsOf types.str); - }; + "tags" = mkOption { + description = ""; + type = types.nullOr (types.attrsOf types.str); + }; - "type" = mkOption { - description = ""; - type = types.unspecified; - }; + "type" = mkOption { + description = ""; + type = types.unspecified; }; + }; - config = { - "name" = mkOverride 1002 null; + config = { + "name" = mkOverride 1002 null; - "tags" = mkOverride 1002 null; + "tags" = mkOverride 1002 null; - "type" = mkOverride 1002 null; - }; + "type" = mkOverride 1002 null; }; + }; - "istio_adapter_fluentd_Params" = { - options = { - "address" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "istio_adapter_fluentd_Params" = { + options = { + "address" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "integerDuration" = mkOption { - description = ""; - type = types.nullOr types.bool; - }; + "integerDuration" = mkOption { + description = ""; + type = types.nullOr types.bool; }; + }; - config = { - "address" = mkOverride 1002 null; + config = { + "address" = mkOverride 1002 null; - "integerDuration" = mkOverride 1002 null; - }; + "integerDuration" = mkOverride 1002 null; }; + }; - "istio_adapter_kubernetesenv_Params" = { - options = { - "cacheRefreshDuration" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "istio_adapter_kubernetesenv_Params" = { + options = { + "cacheRefreshDuration" = mkOption { + description = ""; + type = types.nullOr types.int; + }; - "kubeconfigPath" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "kubeconfigPath" = mkOption { + description = ""; + type = types.nullOr types.str; }; + }; - config = { - "cacheRefreshDuration" = mkOverride 1002 null; + config = { + "cacheRefreshDuration" = mkOverride 1002 null; - "kubeconfigPath" = mkOverride 1002 null; - }; + "kubeconfigPath" = mkOverride 1002 null; }; + }; - "istio_adapter_list_Params" = { - options = { - "blacklist" = mkOption { - description = ""; - type = types.nullOr types.bool; - }; + "istio_adapter_list_Params" = { + options = { + "blacklist" = mkOption { + description = ""; + type = types.nullOr types.bool; + }; - "cachingInterval" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "cachingInterval" = mkOption { + description = ""; + type = types.nullOr types.int; + }; - "cachingUseCount" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "cachingUseCount" = mkOption { + description = ""; + type = types.nullOr types.int; + }; - "entryType" = mkOption { - description = ""; - type = types.unspecified; - }; + "entryType" = mkOption { + description = ""; + type = types.unspecified; + }; - "overrides" = mkOption { - description = ""; - type = types.nullOr (types.listOf types.str); - }; + "overrides" = mkOption { + description = ""; + type = types.nullOr (types.listOf types.str); + }; - "providerUrl" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "providerUrl" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "refreshInterval" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "refreshInterval" = mkOption { + description = ""; + type = types.nullOr types.int; + }; - "ttl" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "ttl" = mkOption { + description = ""; + type = types.nullOr types.int; }; + }; - config = { - "blacklist" = mkOverride 1002 null; + config = { + "blacklist" = mkOverride 1002 null; - "cachingInterval" = mkOverride 1002 null; + "cachingInterval" = mkOverride 1002 null; - "cachingUseCount" = mkOverride 1002 null; + "cachingUseCount" = mkOverride 1002 null; - "entryType" = mkOverride 1002 null; + "entryType" = mkOverride 1002 null; - "overrides" = mkOverride 1002 null; + "overrides" = mkOverride 1002 null; - "providerUrl" = mkOverride 1002 null; + "providerUrl" = mkOverride 1002 null; - "refreshInterval" = mkOverride 1002 null; + "refreshInterval" = mkOverride 1002 null; - "ttl" = mkOverride 1002 null; - }; + "ttl" = mkOverride 1002 null; }; + }; - "istio_adapter_memquota_Params" = { - options = { - "minDeduplicationDuration" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "istio_adapter_memquota_Params" = { + options = { + "minDeduplicationDuration" = mkOption { + description = ""; + type = types.nullOr types.int; + }; - "quotas" = mkOption { - description = ""; - type = types.nullOr (types.listOf (submoduleOf "istio_adapter_memquota_Params_Quota")); - }; + "quotas" = mkOption { + description = ""; + type = types.nullOr (types.listOf (submoduleOf "istio_adapter_memquota_Params_Quota")); }; + }; - config = { - "minDeduplicationDuration" = mkOverride 1002 null; + config = { + "minDeduplicationDuration" = mkOverride 1002 null; - "quotas" = mkOverride 1002 null; - }; + "quotas" = mkOverride 1002 null; }; + }; - "istio_adapter_memquota_Params_Override" = { - options = { - "dimensions" = mkOption { - description = ""; - type = types.nullOr (types.attrsOf types.str); - }; + "istio_adapter_memquota_Params_Override" = { + options = { + "dimensions" = mkOption { + description = ""; + type = types.nullOr (types.attrsOf types.str); + }; - "maxAmount" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "maxAmount" = mkOption { + description = ""; + type = types.nullOr types.int; + }; - "validDuration" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "validDuration" = mkOption { + description = ""; + type = types.nullOr types.int; }; + }; - config = { - "dimensions" = mkOverride 1002 null; + config = { + "dimensions" = mkOverride 1002 null; - "maxAmount" = mkOverride 1002 null; + "maxAmount" = mkOverride 1002 null; - "validDuration" = mkOverride 1002 null; - }; + "validDuration" = mkOverride 1002 null; }; + }; - "istio_adapter_memquota_Params_Quota" = { - options = { - "maxAmount" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "istio_adapter_memquota_Params_Quota" = { + options = { + "maxAmount" = mkOption { + description = ""; + type = types.nullOr types.int; + }; - "name" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "name" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "overrides" = mkOption { - description = ""; - type = types.nullOr (types.listOf (submoduleOf "istio_adapter_memquota_Params_Override")); - }; + "overrides" = mkOption { + description = ""; + type = types.nullOr (types.listOf (submoduleOf "istio_adapter_memquota_Params_Override")); + }; - "validDuration" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "validDuration" = mkOption { + description = ""; + type = types.nullOr types.int; }; + }; - config = { - "maxAmount" = mkOverride 1002 null; + config = { + "maxAmount" = mkOverride 1002 null; - "name" = mkOverride 1002 null; + "name" = mkOverride 1002 null; - "overrides" = mkOverride 1002 null; + "overrides" = mkOverride 1002 null; - "validDuration" = mkOverride 1002 null; - }; + "validDuration" = mkOverride 1002 null; }; + }; - "istio_adapter_opa_Params" = { - options = { - "checkMethod" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "istio_adapter_opa_Params" = { + options = { + "checkMethod" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "failClose" = mkOption { - description = ""; - type = types.nullOr types.bool; - }; + "failClose" = mkOption { + description = ""; + type = types.nullOr types.bool; + }; - "policy" = mkOption { - description = ""; - type = types.nullOr (types.listOf types.str); - }; + "policy" = mkOption { + description = ""; + type = types.nullOr (types.listOf types.str); }; + }; - config = { - "checkMethod" = mkOverride 1002 null; + config = { + "checkMethod" = mkOverride 1002 null; - "failClose" = mkOverride 1002 null; + "failClose" = mkOverride 1002 null; - "policy" = mkOverride 1002 null; - }; + "policy" = mkOverride 1002 null; }; + }; - "istio_adapter_prometheus_Params" = { - options = { - "metrics" = mkOption { - description = ""; - type = types.nullOr (types.listOf (submoduleOf "istio_adapter_prometheus_Params_MetricInfo")); - }; + "istio_adapter_prometheus_Params" = { + options = { + "metrics" = mkOption { + description = ""; + type = types.nullOr (types.listOf (submoduleOf "istio_adapter_prometheus_Params_MetricInfo")); + }; - "metricsExpirationPolicy" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "istio_adapter_prometheus_Params_MetricsExpirationPolicy"); - }; + "metricsExpirationPolicy" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "istio_adapter_prometheus_Params_MetricsExpirationPolicy"); }; + }; - config = { - "metrics" = mkOverride 1002 null; + config = { + "metrics" = mkOverride 1002 null; - "metricsExpirationPolicy" = mkOverride 1002 null; - }; + "metricsExpirationPolicy" = mkOverride 1002 null; }; + }; - "istio_adapter_prometheus_Params_MetricInfo" = { - options = { - "buckets" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "istio_adapter_prometheus_Params_MetricInfo_BucketsDefinition"); - }; + "istio_adapter_prometheus_Params_MetricInfo" = { + options = { + "buckets" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "istio_adapter_prometheus_Params_MetricInfo_BucketsDefinition"); + }; - "description" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "description" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "instanceName" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "instanceName" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "kind" = mkOption { - description = ""; - type = types.unspecified; - }; + "kind" = mkOption { + description = ""; + type = types.unspecified; + }; - "labelNames" = mkOption { - description = ""; - type = types.nullOr (types.listOf types.str); - }; + "labelNames" = mkOption { + description = ""; + type = types.nullOr (types.listOf types.str); + }; - "name" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "name" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "namespace" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "namespace" = mkOption { + description = ""; + type = types.nullOr types.str; }; + }; - config = { - "buckets" = mkOverride 1002 null; + config = { + "buckets" = mkOverride 1002 null; - "description" = mkOverride 1002 null; + "description" = mkOverride 1002 null; - "instanceName" = mkOverride 1002 null; + "instanceName" = mkOverride 1002 null; - "kind" = mkOverride 1002 null; + "kind" = mkOverride 1002 null; - "labelNames" = mkOverride 1002 null; + "labelNames" = mkOverride 1002 null; - "name" = mkOverride 1002 null; + "name" = mkOverride 1002 null; - "namespace" = mkOverride 1002 null; - }; + "namespace" = mkOverride 1002 null; }; + }; - "istio_adapter_prometheus_Params_MetricInfo_BucketsDefinition" = { - options = { - "definition" = mkOption { - description = ""; - type = types.unspecified; - }; + "istio_adapter_prometheus_Params_MetricInfo_BucketsDefinition" = { + options = { + "definition" = mkOption { + description = ""; + type = types.unspecified; }; + }; - config = { - "definition" = mkOverride 1002 null; - }; + config = { + "definition" = mkOverride 1002 null; }; + }; - "istio_adapter_prometheus_Params_MetricInfo_BucketsDefinition_Explicit" = { - options = { - "bounds" = mkOption { - description = ""; - type = types.nullOr (types.listOf types.int); - }; + "istio_adapter_prometheus_Params_MetricInfo_BucketsDefinition_Explicit" = { + options = { + "bounds" = mkOption { + description = ""; + type = types.nullOr (types.listOf types.int); }; + }; - config = { - "bounds" = mkOverride 1002 null; - }; + config = { + "bounds" = mkOverride 1002 null; }; + }; - "istio_adapter_prometheus_Params_MetricInfo_BucketsDefinition_ExplicitBuckets" = { - options = { - "explicitBuckets" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "istio_adapter_prometheus_Params_MetricInfo_BucketsDefinition_Explicit"); - }; + "istio_adapter_prometheus_Params_MetricInfo_BucketsDefinition_ExplicitBuckets" = { + options = { + "explicitBuckets" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "istio_adapter_prometheus_Params_MetricInfo_BucketsDefinition_Explicit"); }; + }; - config = { - "explicitBuckets" = mkOverride 1002 null; - }; + config = { + "explicitBuckets" = mkOverride 1002 null; }; + }; - "istio_adapter_prometheus_Params_MetricInfo_BucketsDefinition_Exponential" = { - options = { - "growthFactor" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "istio_adapter_prometheus_Params_MetricInfo_BucketsDefinition_Exponential" = { + options = { + "growthFactor" = mkOption { + description = ""; + type = types.nullOr types.int; + }; - "numFiniteBuckets" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "numFiniteBuckets" = mkOption { + description = ""; + type = types.nullOr types.int; + }; - "scale" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "scale" = mkOption { + description = ""; + type = types.nullOr types.int; }; + }; - config = { - "growthFactor" = mkOverride 1002 null; + config = { + "growthFactor" = mkOverride 1002 null; - "numFiniteBuckets" = mkOverride 1002 null; + "numFiniteBuckets" = mkOverride 1002 null; - "scale" = mkOverride 1002 null; - }; + "scale" = mkOverride 1002 null; }; + }; - "istio_adapter_prometheus_Params_MetricInfo_BucketsDefinition_ExponentialBuckets" = { - options = { - "exponentialBuckets" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "istio_adapter_prometheus_Params_MetricInfo_BucketsDefinition_Exponential"); - }; + "istio_adapter_prometheus_Params_MetricInfo_BucketsDefinition_ExponentialBuckets" = { + options = { + "exponentialBuckets" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "istio_adapter_prometheus_Params_MetricInfo_BucketsDefinition_Exponential"); }; + }; - config = { - "exponentialBuckets" = mkOverride 1002 null; - }; + config = { + "exponentialBuckets" = mkOverride 1002 null; }; + }; - "istio_adapter_prometheus_Params_MetricInfo_BucketsDefinition_Linear" = { - options = { - "numFiniteBuckets" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "istio_adapter_prometheus_Params_MetricInfo_BucketsDefinition_Linear" = { + options = { + "numFiniteBuckets" = mkOption { + description = ""; + type = types.nullOr types.int; + }; - "offset" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "offset" = mkOption { + description = ""; + type = types.nullOr types.int; + }; - "width" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "width" = mkOption { + description = ""; + type = types.nullOr types.int; }; + }; - config = { - "numFiniteBuckets" = mkOverride 1002 null; + config = { + "numFiniteBuckets" = mkOverride 1002 null; - "offset" = mkOverride 1002 null; + "offset" = mkOverride 1002 null; - "width" = mkOverride 1002 null; - }; + "width" = mkOverride 1002 null; }; + }; - "istio_adapter_prometheus_Params_MetricInfo_BucketsDefinition_LinearBuckets" = { - options = { - "linearBuckets" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "istio_adapter_prometheus_Params_MetricInfo_BucketsDefinition_Linear"); - }; + "istio_adapter_prometheus_Params_MetricInfo_BucketsDefinition_LinearBuckets" = { + options = { + "linearBuckets" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "istio_adapter_prometheus_Params_MetricInfo_BucketsDefinition_Linear"); }; + }; - config = { - "linearBuckets" = mkOverride 1002 null; - }; + config = { + "linearBuckets" = mkOverride 1002 null; }; + }; - "istio_adapter_prometheus_Params_MetricsExpirationPolicy" = { - options = { - "expiryCheckIntervalDuration" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "istio_adapter_prometheus_Params_MetricsExpirationPolicy" = { + options = { + "expiryCheckIntervalDuration" = mkOption { + description = ""; + type = types.nullOr types.int; + }; - "metricsExpiryDuration" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "metricsExpiryDuration" = mkOption { + description = ""; + type = types.nullOr types.int; }; + }; - config = { - "expiryCheckIntervalDuration" = mkOverride 1002 null; + config = { + "expiryCheckIntervalDuration" = mkOverride 1002 null; - "metricsExpiryDuration" = mkOverride 1002 null; - }; + "metricsExpiryDuration" = mkOverride 1002 null; }; + }; - "istio_adapter_rbac_Params" = { - options = { - "cacheDuration" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "istio_adapter_rbac_Params" = { + options = { + "cacheDuration" = mkOption { + description = ""; + type = types.nullOr types.int; + }; - "configStoreUrl" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "configStoreUrl" = mkOption { + description = ""; + type = types.nullOr types.str; }; + }; - config = { - "cacheDuration" = mkOverride 1002 null; + config = { + "cacheDuration" = mkOverride 1002 null; - "configStoreUrl" = mkOverride 1002 null; - }; + "configStoreUrl" = mkOverride 1002 null; }; + }; - "istio_adapter_redisquota_Params" = { - options = { - "connectionPoolSize" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "istio_adapter_redisquota_Params" = { + options = { + "connectionPoolSize" = mkOption { + description = ""; + type = types.nullOr types.int; + }; - "quotas" = mkOption { - description = ""; - type = types.nullOr (types.listOf (submoduleOf "istio_adapter_redisquota_Params_Quota")); - }; + "quotas" = mkOption { + description = ""; + type = types.nullOr (types.listOf (submoduleOf "istio_adapter_redisquota_Params_Quota")); + }; - "redisServerUrl" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "redisServerUrl" = mkOption { + description = ""; + type = types.nullOr types.str; }; + }; - config = { - "connectionPoolSize" = mkOverride 1002 null; + config = { + "connectionPoolSize" = mkOverride 1002 null; - "quotas" = mkOverride 1002 null; + "quotas" = mkOverride 1002 null; - "redisServerUrl" = mkOverride 1002 null; - }; + "redisServerUrl" = mkOverride 1002 null; }; + }; - "istio_adapter_redisquota_Params_Override" = { - options = { - "dimensions" = mkOption { - description = ""; - type = types.nullOr (types.attrsOf types.str); - }; + "istio_adapter_redisquota_Params_Override" = { + options = { + "dimensions" = mkOption { + description = ""; + type = types.nullOr (types.attrsOf types.str); + }; - "maxAmount" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "maxAmount" = mkOption { + description = ""; + type = types.nullOr types.int; }; + }; - config = { - "dimensions" = mkOverride 1002 null; + config = { + "dimensions" = mkOverride 1002 null; - "maxAmount" = mkOverride 1002 null; - }; + "maxAmount" = mkOverride 1002 null; }; + }; - "istio_adapter_redisquota_Params_Quota" = { - options = { - "bucketDuration" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "istio_adapter_redisquota_Params_Quota" = { + options = { + "bucketDuration" = mkOption { + description = ""; + type = types.nullOr types.int; + }; - "maxAmount" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "maxAmount" = mkOption { + description = ""; + type = types.nullOr types.int; + }; - "name" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "name" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "overrides" = mkOption { - description = ""; - type = types.nullOr (types.listOf (submoduleOf "istio_adapter_redisquota_Params_Override")); - }; + "overrides" = mkOption { + description = ""; + type = types.nullOr (types.listOf (submoduleOf "istio_adapter_redisquota_Params_Override")); + }; - "rateLimitAlgorithm" = mkOption { - description = ""; - type = types.unspecified; - }; + "rateLimitAlgorithm" = mkOption { + description = ""; + type = types.unspecified; + }; - "validDuration" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "validDuration" = mkOption { + description = ""; + type = types.nullOr types.int; }; + }; - config = { - "bucketDuration" = mkOverride 1002 null; + config = { + "bucketDuration" = mkOverride 1002 null; - "maxAmount" = mkOverride 1002 null; + "maxAmount" = mkOverride 1002 null; - "name" = mkOverride 1002 null; + "name" = mkOverride 1002 null; - "overrides" = mkOverride 1002 null; + "overrides" = mkOverride 1002 null; - "rateLimitAlgorithm" = mkOverride 1002 null; + "rateLimitAlgorithm" = mkOverride 1002 null; - "validDuration" = mkOverride 1002 null; - }; + "validDuration" = mkOverride 1002 null; }; + }; - "istio_adapter_servicecontrol_GcpServiceSetting" = { - options = { - "googleServiceName" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "istio_adapter_servicecontrol_GcpServiceSetting" = { + options = { + "googleServiceName" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "meshServiceName" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "meshServiceName" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "quotas" = mkOption { - description = ""; - type = types.nullOr (types.listOf (submoduleOf "istio_adapter_servicecontrol_Quota")); - }; + "quotas" = mkOption { + description = ""; + type = types.nullOr (types.listOf (submoduleOf "istio_adapter_servicecontrol_Quota")); }; + }; - config = { - "googleServiceName" = mkOverride 1002 null; + config = { + "googleServiceName" = mkOverride 1002 null; - "meshServiceName" = mkOverride 1002 null; + "meshServiceName" = mkOverride 1002 null; - "quotas" = mkOverride 1002 null; - }; + "quotas" = mkOverride 1002 null; }; + }; - "istio_adapter_servicecontrol_Params" = { - options = { - "credentialPath" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "istio_adapter_servicecontrol_Params" = { + options = { + "credentialPath" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "runtimeConfig" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "istio_adapter_servicecontrol_RuntimeConfig"); - }; + "runtimeConfig" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "istio_adapter_servicecontrol_RuntimeConfig"); + }; - "serviceConfigs" = mkOption { - description = ""; - type = types.nullOr (types.listOf (submoduleOf "istio_adapter_servicecontrol_GcpServiceSetting")); - }; + "serviceConfigs" = mkOption { + description = ""; + type = types.nullOr (types.listOf (submoduleOf "istio_adapter_servicecontrol_GcpServiceSetting")); }; + }; - config = { - "credentialPath" = mkOverride 1002 null; + config = { + "credentialPath" = mkOverride 1002 null; - "runtimeConfig" = mkOverride 1002 null; + "runtimeConfig" = mkOverride 1002 null; - "serviceConfigs" = mkOverride 1002 null; - }; + "serviceConfigs" = mkOverride 1002 null; }; + }; - "istio_adapter_servicecontrol_Quota" = { - options = { - "expiration" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "protobuf_types_Duration"); - }; + "istio_adapter_servicecontrol_Quota" = { + options = { + "expiration" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "protobuf_types_Duration"); + }; - "googleQuotaMetricName" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "googleQuotaMetricName" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "name" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "name" = mkOption { + description = ""; + type = types.nullOr types.str; }; + }; - config = { - "expiration" = mkOverride 1002 null; + config = { + "expiration" = mkOverride 1002 null; - "googleQuotaMetricName" = mkOverride 1002 null; + "googleQuotaMetricName" = mkOverride 1002 null; - "name" = mkOverride 1002 null; - }; + "name" = mkOverride 1002 null; }; + }; - "istio_adapter_servicecontrol_RuntimeConfig" = { - options = { - "checkCacheSize" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "istio_adapter_servicecontrol_RuntimeConfig" = { + options = { + "checkCacheSize" = mkOption { + description = ""; + type = types.nullOr types.int; + }; - "checkResultExpiration" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "protobuf_types_Duration"); - }; + "checkResultExpiration" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "protobuf_types_Duration"); }; + }; - config = { - "checkCacheSize" = mkOverride 1002 null; + config = { + "checkCacheSize" = mkOverride 1002 null; - "checkResultExpiration" = mkOverride 1002 null; - }; + "checkResultExpiration" = mkOverride 1002 null; }; + }; - "istio_adapter_signalfx_Params" = { - options = { - "accessToken" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "istio_adapter_signalfx_Params" = { + options = { + "accessToken" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "datapointInterval" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "datapointInterval" = mkOption { + description = ""; + type = types.nullOr types.int; + }; - "ingestUrl" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "ingestUrl" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "metrics" = mkOption { - description = ""; - type = types.nullOr (types.listOf (submoduleOf "istio_adapter_signalfx_Params_MetricConfig")); - }; + "metrics" = mkOption { + description = ""; + type = types.nullOr (types.listOf (submoduleOf "istio_adapter_signalfx_Params_MetricConfig")); }; + }; - config = { - "accessToken" = mkOverride 1002 null; + config = { + "accessToken" = mkOverride 1002 null; - "datapointInterval" = mkOverride 1002 null; + "datapointInterval" = mkOverride 1002 null; - "ingestUrl" = mkOverride 1002 null; + "ingestUrl" = mkOverride 1002 null; - "metrics" = mkOverride 1002 null; - }; + "metrics" = mkOverride 1002 null; }; + }; - "istio_adapter_signalfx_Params_MetricConfig" = { - options = { - "name" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "istio_adapter_signalfx_Params_MetricConfig" = { + options = { + "name" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "type" = mkOption { - description = ""; - type = types.unspecified; - }; + "type" = mkOption { + description = ""; + type = types.unspecified; }; + }; - config = { - "name" = mkOverride 1002 null; + config = { + "name" = mkOverride 1002 null; - "type" = mkOverride 1002 null; - }; + "type" = mkOverride 1002 null; }; + }; - "istio_adapter_solarwinds_Params" = { - options = { - "appopticsAccessToken" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "istio_adapter_solarwinds_Params" = { + options = { + "appopticsAccessToken" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "appopticsBatchSize" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "appopticsBatchSize" = mkOption { + description = ""; + type = types.nullOr types.int; + }; - "logs" = mkOption { - description = ""; - type = types.nullOr types.attrs; - }; + "logs" = mkOption { + description = ""; + type = types.nullOr types.attrs; + }; - "metrics" = mkOption { - description = ""; - type = types.nullOr types.attrs; - }; + "metrics" = mkOption { + description = ""; + type = types.nullOr types.attrs; + }; - "papertrailLocalRetentionDuration" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "papertrailLocalRetentionDuration" = mkOption { + description = ""; + type = types.nullOr types.int; + }; - "papertrailUrl" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "papertrailUrl" = mkOption { + description = ""; + type = types.nullOr types.str; }; + }; - config = { - "appopticsAccessToken" = mkOverride 1002 null; + config = { + "appopticsAccessToken" = mkOverride 1002 null; - "appopticsBatchSize" = mkOverride 1002 null; + "appopticsBatchSize" = mkOverride 1002 null; - "logs" = mkOverride 1002 null; + "logs" = mkOverride 1002 null; - "metrics" = mkOverride 1002 null; + "metrics" = mkOverride 1002 null; - "papertrailLocalRetentionDuration" = mkOverride 1002 null; + "papertrailLocalRetentionDuration" = mkOverride 1002 null; - "papertrailUrl" = mkOverride 1002 null; - }; + "papertrailUrl" = mkOverride 1002 null; }; + }; - "istio_adapter_solarwinds_Params_LogInfo" = { - options = { - "payloadTemplate" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "istio_adapter_solarwinds_Params_LogInfo" = { + options = { + "payloadTemplate" = mkOption { + description = ""; + type = types.nullOr types.str; }; + }; - config = { - "payloadTemplate" = mkOverride 1002 null; - }; + config = { + "payloadTemplate" = mkOverride 1002 null; }; + }; - "istio_adapter_solarwinds_Params_MetricInfo" = { - options = { - "labelNames" = mkOption { - description = ""; - type = types.nullOr (types.listOf types.str); - }; + "istio_adapter_solarwinds_Params_MetricInfo" = { + options = { + "labelNames" = mkOption { + description = ""; + type = types.nullOr (types.listOf types.str); }; + }; - config = { - "labelNames" = mkOverride 1002 null; - }; + config = { + "labelNames" = mkOverride 1002 null; }; + }; - "istio_adapter_stackdriver_Params" = { - options = { - "creds" = mkOption { - description = ""; - type = types.unspecified; - }; + "istio_adapter_stackdriver_Params" = { + options = { + "creds" = mkOption { + description = ""; + type = types.unspecified; + }; - "endpoint" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "endpoint" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "logInfo" = mkOption { - description = ""; - type = types.nullOr types.attrs; - }; + "logInfo" = mkOption { + description = ""; + type = types.nullOr types.attrs; + }; - "metricInfo" = mkOption { - description = ""; - type = types.nullOr types.attrs; - }; + "metricInfo" = mkOption { + description = ""; + type = types.nullOr types.attrs; + }; - "projectId" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "projectId" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "pushInterval" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "pushInterval" = mkOption { + description = ""; + type = types.nullOr types.int; + }; - "trace" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "istio_adapter_stackdriver_Params_Trace"); - }; + "trace" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "istio_adapter_stackdriver_Params_Trace"); }; + }; - config = { - "creds" = mkOverride 1002 null; + config = { + "creds" = mkOverride 1002 null; - "endpoint" = mkOverride 1002 null; + "endpoint" = mkOverride 1002 null; - "logInfo" = mkOverride 1002 null; + "logInfo" = mkOverride 1002 null; - "metricInfo" = mkOverride 1002 null; + "metricInfo" = mkOverride 1002 null; - "projectId" = mkOverride 1002 null; + "projectId" = mkOverride 1002 null; - "pushInterval" = mkOverride 1002 null; + "pushInterval" = mkOverride 1002 null; - "trace" = mkOverride 1002 null; - }; + "trace" = mkOverride 1002 null; }; + }; - "istio_adapter_stackdriver_Params_ApiKey" = { - options = { - "apiKey" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "istio_adapter_stackdriver_Params_ApiKey" = { + options = { + "apiKey" = mkOption { + description = ""; + type = types.nullOr types.str; }; + }; - config = { - "apiKey" = mkOverride 1002 null; - }; + config = { + "apiKey" = mkOverride 1002 null; }; + }; - "istio_adapter_stackdriver_Params_AppCredentials" = { - options = { - "appCredentials" = mkOption { - description = ""; - type = types.nullOr types.bool; - }; + "istio_adapter_stackdriver_Params_AppCredentials" = { + options = { + "appCredentials" = mkOption { + description = ""; + type = types.nullOr types.bool; }; + }; - config = { - "appCredentials" = mkOverride 1002 null; - }; + config = { + "appCredentials" = mkOverride 1002 null; }; + }; - "istio_adapter_stackdriver_Params_LogInfo" = { - options = { - "httpMapping" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "istio_adapter_stackdriver_Params_LogInfo_HttpRequestMapping"); - }; + "istio_adapter_stackdriver_Params_LogInfo" = { + options = { + "httpMapping" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "istio_adapter_stackdriver_Params_LogInfo_HttpRequestMapping"); + }; - "labelNames" = mkOption { - description = ""; - type = types.nullOr (types.listOf types.str); - }; + "labelNames" = mkOption { + description = ""; + type = types.nullOr (types.listOf types.str); + }; - "payloadTemplate" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "payloadTemplate" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "sinkInfo" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "istio_adapter_stackdriver_Params_LogInfo_SinkInfo"); - }; + "sinkInfo" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "istio_adapter_stackdriver_Params_LogInfo_SinkInfo"); }; + }; - config = { - "httpMapping" = mkOverride 1002 null; + config = { + "httpMapping" = mkOverride 1002 null; - "labelNames" = mkOverride 1002 null; + "labelNames" = mkOverride 1002 null; - "payloadTemplate" = mkOverride 1002 null; + "payloadTemplate" = mkOverride 1002 null; - "sinkInfo" = mkOverride 1002 null; - }; + "sinkInfo" = mkOverride 1002 null; }; + }; - "istio_adapter_stackdriver_Params_LogInfo_HttpRequestMapping" = { - options = { - "latency" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "istio_adapter_stackdriver_Params_LogInfo_HttpRequestMapping" = { + options = { + "latency" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "localIp" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "localIp" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "method" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "method" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "referer" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "referer" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "remoteIp" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "remoteIp" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "requestSize" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "requestSize" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "responseSize" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "responseSize" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "status" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "status" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "url" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "url" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "userAgent" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "userAgent" = mkOption { + description = ""; + type = types.nullOr types.str; }; + }; - config = { - "latency" = mkOverride 1002 null; + config = { + "latency" = mkOverride 1002 null; - "localIp" = mkOverride 1002 null; + "localIp" = mkOverride 1002 null; - "method" = mkOverride 1002 null; + "method" = mkOverride 1002 null; - "referer" = mkOverride 1002 null; + "referer" = mkOverride 1002 null; - "remoteIp" = mkOverride 1002 null; + "remoteIp" = mkOverride 1002 null; - "requestSize" = mkOverride 1002 null; + "requestSize" = mkOverride 1002 null; - "responseSize" = mkOverride 1002 null; + "responseSize" = mkOverride 1002 null; - "status" = mkOverride 1002 null; + "status" = mkOverride 1002 null; - "url" = mkOverride 1002 null; + "url" = mkOverride 1002 null; - "userAgent" = mkOverride 1002 null; - }; + "userAgent" = mkOverride 1002 null; }; + }; - "istio_adapter_stackdriver_Params_LogInfo_SinkInfo" = { - options = { - "UniqueWriterIdentity" = mkOption { - description = ""; - type = types.nullOr types.bool; - }; + "istio_adapter_stackdriver_Params_LogInfo_SinkInfo" = { + options = { + "UniqueWriterIdentity" = mkOption { + description = ""; + type = types.nullOr types.bool; + }; - "UpdateDestination" = mkOption { - description = ""; - type = types.nullOr types.bool; - }; + "UpdateDestination" = mkOption { + description = ""; + type = types.nullOr types.bool; + }; - "UpdateFilter" = mkOption { - description = ""; - type = types.nullOr types.bool; - }; + "UpdateFilter" = mkOption { + description = ""; + type = types.nullOr types.bool; + }; - "UpdateIncludeChildren" = mkOption { - description = ""; - type = types.nullOr types.bool; - }; + "UpdateIncludeChildren" = mkOption { + description = ""; + type = types.nullOr types.bool; + }; - "destination" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "destination" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "filter" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "filter" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "id" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "id" = mkOption { + description = ""; + type = types.nullOr types.str; }; + }; - config = { - "UniqueWriterIdentity" = mkOverride 1002 null; + config = { + "UniqueWriterIdentity" = mkOverride 1002 null; - "UpdateDestination" = mkOverride 1002 null; + "UpdateDestination" = mkOverride 1002 null; - "UpdateFilter" = mkOverride 1002 null; + "UpdateFilter" = mkOverride 1002 null; - "UpdateIncludeChildren" = mkOverride 1002 null; + "UpdateIncludeChildren" = mkOverride 1002 null; - "destination" = mkOverride 1002 null; + "destination" = mkOverride 1002 null; - "filter" = mkOverride 1002 null; + "filter" = mkOverride 1002 null; - "id" = mkOverride 1002 null; - }; + "id" = mkOverride 1002 null; }; + }; - "istio_adapter_stackdriver_Params_MetricInfo" = { - options = { - "buckets" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "istio_adapter_stackdriver_Params_MetricInfo_BucketsDefinition"); - }; + "istio_adapter_stackdriver_Params_MetricInfo" = { + options = { + "buckets" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "istio_adapter_stackdriver_Params_MetricInfo_BucketsDefinition"); + }; - "kind" = mkOption { - description = ""; - type = types.unspecified; - }; + "kind" = mkOption { + description = ""; + type = types.unspecified; + }; - "metricType" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "metricType" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "value" = mkOption { - description = ""; - type = types.unspecified; - }; + "value" = mkOption { + description = ""; + type = types.unspecified; }; + }; - config = { - "buckets" = mkOverride 1002 null; + config = { + "buckets" = mkOverride 1002 null; - "kind" = mkOverride 1002 null; + "kind" = mkOverride 1002 null; - "metricType" = mkOverride 1002 null; + "metricType" = mkOverride 1002 null; - "value" = mkOverride 1002 null; - }; + "value" = mkOverride 1002 null; }; + }; - "istio_adapter_stackdriver_Params_MetricInfo_BucketsDefinition" = { - options = { - "definition" = mkOption { - description = ""; - type = types.unspecified; - }; + "istio_adapter_stackdriver_Params_MetricInfo_BucketsDefinition" = { + options = { + "definition" = mkOption { + description = ""; + type = types.unspecified; }; + }; - config = { - "definition" = mkOverride 1002 null; - }; + config = { + "definition" = mkOverride 1002 null; }; + }; - "istio_adapter_stackdriver_Params_ServiceAccountPath" = { - options = { - "serviceAccountPath" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "istio_adapter_stackdriver_Params_ServiceAccountPath" = { + options = { + "serviceAccountPath" = mkOption { + description = ""; + type = types.nullOr types.str; }; + }; - config = { - "serviceAccountPath" = mkOverride 1002 null; - }; + config = { + "serviceAccountPath" = mkOverride 1002 null; }; + }; - "istio_adapter_stackdriver_Params_Trace" = { - options = { - "sampleProbability" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "istio_adapter_stackdriver_Params_Trace" = { + options = { + "sampleProbability" = mkOption { + description = ""; + type = types.nullOr types.int; }; + }; - config = { - "sampleProbability" = mkOverride 1002 null; - }; + config = { + "sampleProbability" = mkOverride 1002 null; }; + }; - "istio_adapter_statsd_Params" = { - options = { - "address" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "istio_adapter_statsd_Params" = { + options = { + "address" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "flushBytes" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "flushBytes" = mkOption { + description = ""; + type = types.nullOr types.int; + }; - "flushDuration" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "flushDuration" = mkOption { + description = ""; + type = types.nullOr types.int; + }; - "metrics" = mkOption { - description = ""; - type = types.nullOr types.attrs; - }; + "metrics" = mkOption { + description = ""; + type = types.nullOr types.attrs; + }; - "prefix" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "prefix" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "samplingRate" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "samplingRate" = mkOption { + description = ""; + type = types.nullOr types.int; }; + }; - config = { - "address" = mkOverride 1002 null; + config = { + "address" = mkOverride 1002 null; - "flushBytes" = mkOverride 1002 null; + "flushBytes" = mkOverride 1002 null; - "flushDuration" = mkOverride 1002 null; + "flushDuration" = mkOverride 1002 null; - "metrics" = mkOverride 1002 null; + "metrics" = mkOverride 1002 null; - "prefix" = mkOverride 1002 null; + "prefix" = mkOverride 1002 null; - "samplingRate" = mkOverride 1002 null; - }; + "samplingRate" = mkOverride 1002 null; }; + }; - "istio_adapter_statsd_Params_MetricInfo" = { - options = { - "nameTemplate" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "istio_adapter_statsd_Params_MetricInfo" = { + options = { + "nameTemplate" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "type" = mkOption { - description = ""; - type = types.unspecified; - }; + "type" = mkOption { + description = ""; + type = types.unspecified; }; + }; - config = { - "nameTemplate" = mkOverride 1002 null; + config = { + "nameTemplate" = mkOverride 1002 null; - "type" = mkOverride 1002 null; - }; + "type" = mkOverride 1002 null; }; + }; - "istio_adapter_stdio_Params" = { - options = { - "logStream" = mkOption { - description = ""; - type = types.unspecified; - }; + "istio_adapter_stdio_Params" = { + options = { + "logStream" = mkOption { + description = ""; + type = types.unspecified; + }; - "maxDaysBeforeRotation" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "maxDaysBeforeRotation" = mkOption { + description = ""; + type = types.nullOr types.int; + }; - "maxMegabytesBeforeRotation" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "maxMegabytesBeforeRotation" = mkOption { + description = ""; + type = types.nullOr types.int; + }; - "maxRotatedFiles" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "maxRotatedFiles" = mkOption { + description = ""; + type = types.nullOr types.int; + }; - "metricLevel" = mkOption { - description = ""; - type = types.unspecified; - }; + "metricLevel" = mkOption { + description = ""; + type = types.unspecified; + }; - "outputAsJson" = mkOption { - description = ""; - type = types.nullOr types.bool; - }; + "outputAsJson" = mkOption { + description = ""; + type = types.nullOr types.bool; + }; - "outputLevel" = mkOption { - description = ""; - type = types.unspecified; - }; + "outputLevel" = mkOption { + description = ""; + type = types.unspecified; + }; - "outputPath" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "outputPath" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "severityLevels" = mkOption { - description = ""; - type = types.nullOr (types.attrsOf types.int); - }; + "severityLevels" = mkOption { + description = ""; + type = types.nullOr (types.attrsOf types.int); }; + }; - config = { - "logStream" = mkOverride 1002 null; + config = { + "logStream" = mkOverride 1002 null; - "maxDaysBeforeRotation" = mkOverride 1002 null; + "maxDaysBeforeRotation" = mkOverride 1002 null; - "maxMegabytesBeforeRotation" = mkOverride 1002 null; + "maxMegabytesBeforeRotation" = mkOverride 1002 null; - "maxRotatedFiles" = mkOverride 1002 null; + "maxRotatedFiles" = mkOverride 1002 null; - "metricLevel" = mkOverride 1002 null; + "metricLevel" = mkOverride 1002 null; - "outputAsJson" = mkOverride 1002 null; + "outputAsJson" = mkOverride 1002 null; - "outputLevel" = mkOverride 1002 null; + "outputLevel" = mkOverride 1002 null; - "outputPath" = mkOverride 1002 null; + "outputPath" = mkOverride 1002 null; - "severityLevels" = mkOverride 1002 null; - }; + "severityLevels" = mkOverride 1002 null; }; + }; - "istio_authentication_v1alpha1_Jwt" = { - options = { - "audiences" = mkOption { - description = ""; - type = types.nullOr (types.listOf types.str); - }; + "istio_authentication_v1alpha1_Jwt" = { + options = { + "audiences" = mkOption { + description = ""; + type = types.nullOr (types.listOf types.str); + }; - "issuer" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "issuer" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "jwksUri" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "jwksUri" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "jwtHeaders" = mkOption { - description = ""; - type = types.nullOr (types.listOf types.str); - }; + "jwtHeaders" = mkOption { + description = ""; + type = types.nullOr (types.listOf types.str); + }; - "jwtParams" = mkOption { - description = ""; - type = types.nullOr (types.listOf types.str); - }; + "jwtParams" = mkOption { + description = ""; + type = types.nullOr (types.listOf types.str); }; + }; - config = { - "audiences" = mkOverride 1002 null; + config = { + "audiences" = mkOverride 1002 null; - "issuer" = mkOverride 1002 null; + "issuer" = mkOverride 1002 null; - "jwksUri" = mkOverride 1002 null; + "jwksUri" = mkOverride 1002 null; - "jwtHeaders" = mkOverride 1002 null; + "jwtHeaders" = mkOverride 1002 null; - "jwtParams" = mkOverride 1002 null; - }; + "jwtParams" = mkOverride 1002 null; }; + }; - "istio_authentication_v1alpha1_MutualTls" = { - options = { - "allowTls" = mkOption { - description = ""; - type = types.nullOr types.bool; - }; + "istio_authentication_v1alpha1_MutualTls" = { + options = { + "allowTls" = mkOption { + description = ""; + type = types.nullOr types.bool; + }; - "mode" = mkOption { - description = ""; - type = types.unspecified; - }; + "mode" = mkOption { + description = ""; + type = types.unspecified; }; + }; - config = { - "allowTls" = mkOverride 1002 null; + config = { + "allowTls" = mkOverride 1002 null; - "mode" = mkOverride 1002 null; - }; + "mode" = mkOverride 1002 null; }; + }; - "istio_authentication_v1alpha1_OriginAuthenticationMethod" = { - options = { - "jwt" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "istio_authentication_v1alpha1_Jwt"); - }; + "istio_authentication_v1alpha1_OriginAuthenticationMethod" = { + options = { + "jwt" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "istio_authentication_v1alpha1_Jwt"); }; + }; - config = { - "jwt" = mkOverride 1002 null; - }; + config = { + "jwt" = mkOverride 1002 null; }; + }; - "istio_authentication_v1alpha1_PeerAuthenticationMethod" = { - options = { - "params" = mkOption { - description = ""; - type = types.unspecified; - }; + "istio_authentication_v1alpha1_PeerAuthenticationMethod" = { + options = { + "params" = mkOption { + description = ""; + type = types.unspecified; }; + }; - config = { - "params" = mkOverride 1002 null; - }; + config = { + "params" = mkOverride 1002 null; }; + }; - "istio_authentication_v1alpha1_PeerAuthenticationMethod_Jwt" = { - options = { - "jwt" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "istio_authentication_v1alpha1_Jwt"); - }; + "istio_authentication_v1alpha1_PeerAuthenticationMethod_Jwt" = { + options = { + "jwt" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "istio_authentication_v1alpha1_Jwt"); }; + }; - config = { - "jwt" = mkOverride 1002 null; - }; + config = { + "jwt" = mkOverride 1002 null; }; + }; - "istio_authentication_v1alpha1_PeerAuthenticationMethod_Mtls" = { - options = { - "mtls" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "istio_authentication_v1alpha1_MutualTls"); - }; + "istio_authentication_v1alpha1_PeerAuthenticationMethod_Mtls" = { + options = { + "mtls" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "istio_authentication_v1alpha1_MutualTls"); }; + }; - config = { - "mtls" = mkOverride 1002 null; - }; + config = { + "mtls" = mkOverride 1002 null; }; + }; - "istio_authentication_v1alpha1_Policy" = { - options = { - "originIsOptional" = mkOption { - description = ""; - type = types.nullOr types.bool; - }; + "istio_authentication_v1alpha1_Policy" = { + options = { + "originIsOptional" = mkOption { + description = ""; + type = types.nullOr types.bool; + }; - "origins" = mkOption { - description = ""; - type = types.nullOr (types.listOf (submoduleOf "istio_authentication_v1alpha1_OriginAuthenticationMethod")); - }; + "origins" = mkOption { + description = ""; + type = types.nullOr (types.listOf (submoduleOf "istio_authentication_v1alpha1_OriginAuthenticationMethod")); + }; - "peerIsOptional" = mkOption { - description = ""; - type = types.nullOr types.bool; - }; + "peerIsOptional" = mkOption { + description = ""; + type = types.nullOr types.bool; + }; - "peers" = mkOption { - description = ""; - type = types.nullOr (types.listOf (submoduleOf "istio_authentication_v1alpha1_PeerAuthenticationMethod")); - }; + "peers" = mkOption { + description = ""; + type = types.nullOr (types.listOf (submoduleOf "istio_authentication_v1alpha1_PeerAuthenticationMethod")); + }; - "principalBinding" = mkOption { - description = ""; - type = types.unspecified; - }; + "principalBinding" = mkOption { + description = ""; + type = types.unspecified; + }; - "targets" = mkOption { - description = ""; - type = types.nullOr (types.listOf (submoduleOf "istio_authentication_v1alpha1_TargetSelector")); - }; + "targets" = mkOption { + description = ""; + type = types.nullOr (types.listOf (submoduleOf "istio_authentication_v1alpha1_TargetSelector")); }; + }; - config = { - "originIsOptional" = mkOverride 1002 null; + config = { + "originIsOptional" = mkOverride 1002 null; - "origins" = mkOverride 1002 null; + "origins" = mkOverride 1002 null; - "peerIsOptional" = mkOverride 1002 null; + "peerIsOptional" = mkOverride 1002 null; - "peers" = mkOverride 1002 null; + "peers" = mkOverride 1002 null; - "principalBinding" = mkOverride 1002 null; + "principalBinding" = mkOverride 1002 null; - "targets" = mkOverride 1002 null; - }; + "targets" = mkOverride 1002 null; }; + }; - "istio_authentication_v1alpha1_PortSelector" = { - options = { - "port" = mkOption { - description = ""; - type = types.unspecified; - }; + "istio_authentication_v1alpha1_PortSelector" = { + options = { + "port" = mkOption { + description = ""; + type = types.unspecified; }; + }; - config = { - "port" = mkOverride 1002 null; - }; + config = { + "port" = mkOverride 1002 null; }; + }; - "istio_authentication_v1alpha1_PortSelector_Name" = { - options = { - "name" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "istio_authentication_v1alpha1_PortSelector_Name" = { + options = { + "name" = mkOption { + description = ""; + type = types.nullOr types.str; }; + }; - config = { - "name" = mkOverride 1002 null; - }; + config = { + "name" = mkOverride 1002 null; }; + }; - "istio_authentication_v1alpha1_PortSelector_Number" = { - options = { - "number" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "istio_authentication_v1alpha1_PortSelector_Number" = { + options = { + "number" = mkOption { + description = ""; + type = types.nullOr types.int; }; + }; - config = { - "number" = mkOverride 1002 null; - }; + config = { + "number" = mkOverride 1002 null; }; + }; - "istio_authentication_v1alpha1_TargetSelector" = { - options = { - "name" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "istio_authentication_v1alpha1_TargetSelector" = { + options = { + "name" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "ports" = mkOption { - description = ""; - type = types.nullOr (types.listOf (submoduleOf "istio_authentication_v1alpha1_PortSelector")); - }; + "ports" = mkOption { + description = ""; + type = types.nullOr (types.listOf (submoduleOf "istio_authentication_v1alpha1_PortSelector")); }; + }; - config = { - "name" = mkOverride 1002 null; + config = { + "name" = mkOverride 1002 null; - "ports" = mkOverride 1002 null; - }; + "ports" = mkOverride 1002 null; }; + }; - "istio_mesh_v1alpha1_MeshConfig" = { - options = { - "accessLogFile" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "istio_mesh_v1alpha1_MeshConfig" = { + options = { + "accessLogFile" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "authPolicy" = mkOption { - description = ""; - type = types.unspecified; - }; + "authPolicy" = mkOption { + description = ""; + type = types.unspecified; + }; - "connectTimeout" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "protobuf_duration_Duration"); - }; + "connectTimeout" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "protobuf_duration_Duration"); + }; - "defaultConfig" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "istio_mesh_v1alpha1_ProxyConfig"); - }; + "defaultConfig" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "istio_mesh_v1alpha1_ProxyConfig"); + }; - "disablePolicyChecks" = mkOption { - description = ""; - type = types.nullOr types.bool; - }; + "disablePolicyChecks" = mkOption { + description = ""; + type = types.nullOr types.bool; + }; - "enableClientSidePolicyCheck" = mkOption { - description = ""; - type = types.nullOr types.bool; - }; + "enableClientSidePolicyCheck" = mkOption { + description = ""; + type = types.nullOr types.bool; + }; - "enableTracing" = mkOption { - description = ""; - type = types.nullOr types.bool; - }; + "enableTracing" = mkOption { + description = ""; + type = types.nullOr types.bool; + }; - "ingressClass" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "ingressClass" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "ingressControllerMode" = mkOption { - description = ""; - type = types.unspecified; - }; + "ingressControllerMode" = mkOption { + description = ""; + type = types.unspecified; + }; - "ingressService" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "ingressService" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "mixerAddress" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "mixerAddress" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "mixerCheckServer" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "mixerCheckServer" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "mixerReportServer" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "mixerReportServer" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "outboundTrafficPolicy" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "istio_mesh_v1alpha1_MeshConfig_OutboundTrafficPolicy"); - }; + "outboundTrafficPolicy" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "istio_mesh_v1alpha1_MeshConfig_OutboundTrafficPolicy"); + }; - "policyCheckFailOpen" = mkOption { - description = ""; - type = types.nullOr types.bool; - }; + "policyCheckFailOpen" = mkOption { + description = ""; + type = types.nullOr types.bool; + }; - "proxyHttpPort" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "proxyHttpPort" = mkOption { + description = ""; + type = types.nullOr types.int; + }; - "proxyListenPort" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "proxyListenPort" = mkOption { + description = ""; + type = types.nullOr types.int; + }; - "rdsRefreshDelay" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "protobuf_duration_Duration"); - }; + "rdsRefreshDelay" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "protobuf_duration_Duration"); + }; - "sdsRefreshDelay" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "protobuf_duration_Duration"); - }; + "sdsRefreshDelay" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "protobuf_duration_Duration"); + }; - "sdsUdsPath" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "sdsUdsPath" = mkOption { + description = ""; + type = types.nullOr types.str; }; + }; - config = { - "accessLogFile" = mkOverride 1002 null; + config = { + "accessLogFile" = mkOverride 1002 null; - "authPolicy" = mkOverride 1002 null; + "authPolicy" = mkOverride 1002 null; - "connectTimeout" = mkOverride 1002 null; + "connectTimeout" = mkOverride 1002 null; - "defaultConfig" = mkOverride 1002 null; + "defaultConfig" = mkOverride 1002 null; - "disablePolicyChecks" = mkOverride 1002 null; + "disablePolicyChecks" = mkOverride 1002 null; - "enableClientSidePolicyCheck" = mkOverride 1002 null; + "enableClientSidePolicyCheck" = mkOverride 1002 null; - "enableTracing" = mkOverride 1002 null; + "enableTracing" = mkOverride 1002 null; - "ingressClass" = mkOverride 1002 null; + "ingressClass" = mkOverride 1002 null; - "ingressControllerMode" = mkOverride 1002 null; + "ingressControllerMode" = mkOverride 1002 null; - "ingressService" = mkOverride 1002 null; + "ingressService" = mkOverride 1002 null; - "mixerAddress" = mkOverride 1002 null; + "mixerAddress" = mkOverride 1002 null; - "mixerCheckServer" = mkOverride 1002 null; + "mixerCheckServer" = mkOverride 1002 null; - "mixerReportServer" = mkOverride 1002 null; + "mixerReportServer" = mkOverride 1002 null; - "outboundTrafficPolicy" = mkOverride 1002 null; + "outboundTrafficPolicy" = mkOverride 1002 null; - "policyCheckFailOpen" = mkOverride 1002 null; + "policyCheckFailOpen" = mkOverride 1002 null; - "proxyHttpPort" = mkOverride 1002 null; + "proxyHttpPort" = mkOverride 1002 null; - "proxyListenPort" = mkOverride 1002 null; + "proxyListenPort" = mkOverride 1002 null; - "rdsRefreshDelay" = mkOverride 1002 null; + "rdsRefreshDelay" = mkOverride 1002 null; - "sdsRefreshDelay" = mkOverride 1002 null; + "sdsRefreshDelay" = mkOverride 1002 null; - "sdsUdsPath" = mkOverride 1002 null; - }; + "sdsUdsPath" = mkOverride 1002 null; }; + }; - "istio_mesh_v1alpha1_MeshConfig_OutboundTrafficPolicy" = { - options = { - "mode" = mkOption { - description = ""; - type = types.unspecified; - }; + "istio_mesh_v1alpha1_MeshConfig_OutboundTrafficPolicy" = { + options = { + "mode" = mkOption { + description = ""; + type = types.unspecified; }; + }; - config = { - "mode" = mkOverride 1002 null; - }; + config = { + "mode" = mkOverride 1002 null; }; + }; - "istio_mesh_v1alpha1_ProxyConfig" = { - options = { - "availabilityZone" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "istio_mesh_v1alpha1_ProxyConfig" = { + options = { + "availabilityZone" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "binaryPath" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "binaryPath" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "concurrency" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "concurrency" = mkOption { + description = ""; + type = types.nullOr types.int; + }; - "configPath" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "configPath" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "connectTimeout" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "protobuf_duration_Duration"); - }; + "connectTimeout" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "protobuf_duration_Duration"); + }; - "controlPlaneAuthPolicy" = mkOption { - description = ""; - type = types.unspecified; - }; + "controlPlaneAuthPolicy" = mkOption { + description = ""; + type = types.unspecified; + }; - "customConfigFile" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "customConfigFile" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "discoveryAddress" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "discoveryAddress" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "discoveryRefreshDelay" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "protobuf_duration_Duration"); - }; + "discoveryRefreshDelay" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "protobuf_duration_Duration"); + }; - "drainDuration" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "protobuf_duration_Duration"); - }; + "drainDuration" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "protobuf_duration_Duration"); + }; - "interceptionMode" = mkOption { - description = ""; - type = types.unspecified; - }; + "interceptionMode" = mkOption { + description = ""; + type = types.unspecified; + }; - "parentShutdownDuration" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "protobuf_duration_Duration"); - }; + "parentShutdownDuration" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "protobuf_duration_Duration"); + }; - "proxyAdminPort" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "proxyAdminPort" = mkOption { + description = ""; + type = types.nullOr types.int; + }; - "proxyBootstrapTemplatePath" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "proxyBootstrapTemplatePath" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "serviceCluster" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "serviceCluster" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "statNameLength" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "statNameLength" = mkOption { + description = ""; + type = types.nullOr types.int; + }; - "statsdUdpAddress" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "statsdUdpAddress" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "zipkinAddress" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "zipkinAddress" = mkOption { + description = ""; + type = types.nullOr types.str; }; + }; - config = { - "availabilityZone" = mkOverride 1002 null; + config = { + "availabilityZone" = mkOverride 1002 null; - "binaryPath" = mkOverride 1002 null; + "binaryPath" = mkOverride 1002 null; - "concurrency" = mkOverride 1002 null; + "concurrency" = mkOverride 1002 null; - "configPath" = mkOverride 1002 null; + "configPath" = mkOverride 1002 null; - "connectTimeout" = mkOverride 1002 null; + "connectTimeout" = mkOverride 1002 null; - "controlPlaneAuthPolicy" = mkOverride 1002 null; + "controlPlaneAuthPolicy" = mkOverride 1002 null; - "customConfigFile" = mkOverride 1002 null; + "customConfigFile" = mkOverride 1002 null; - "discoveryAddress" = mkOverride 1002 null; + "discoveryAddress" = mkOverride 1002 null; - "discoveryRefreshDelay" = mkOverride 1002 null; + "discoveryRefreshDelay" = mkOverride 1002 null; - "drainDuration" = mkOverride 1002 null; + "drainDuration" = mkOverride 1002 null; - "interceptionMode" = mkOverride 1002 null; + "interceptionMode" = mkOverride 1002 null; - "parentShutdownDuration" = mkOverride 1002 null; + "parentShutdownDuration" = mkOverride 1002 null; - "proxyAdminPort" = mkOverride 1002 null; + "proxyAdminPort" = mkOverride 1002 null; - "proxyBootstrapTemplatePath" = mkOverride 1002 null; + "proxyBootstrapTemplatePath" = mkOverride 1002 null; - "serviceCluster" = mkOverride 1002 null; + "serviceCluster" = mkOverride 1002 null; - "statNameLength" = mkOverride 1002 null; + "statNameLength" = mkOverride 1002 null; - "statsdUdpAddress" = mkOverride 1002 null; + "statsdUdpAddress" = mkOverride 1002 null; - "zipkinAddress" = mkOverride 1002 null; - }; + "zipkinAddress" = mkOverride 1002 null; }; + }; - "istio_mixer_apikey_InstanceMsg" = { - options = { - "api" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "istio_mixer_apikey_InstanceMsg" = { + options = { + "api" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "apiKey" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "apiKey" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "apiOperation" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "apiOperation" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "apiVersion" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "apiVersion" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "name" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "name" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "timestamp" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "istio_policy_v1beta1_TimeStamp"); - }; + "timestamp" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "istio_policy_v1beta1_TimeStamp"); }; + }; - config = { - "api" = mkOverride 1002 null; + config = { + "api" = mkOverride 1002 null; - "apiKey" = mkOverride 1002 null; + "apiKey" = mkOverride 1002 null; - "apiOperation" = mkOverride 1002 null; + "apiOperation" = mkOverride 1002 null; - "apiVersion" = mkOverride 1002 null; + "apiVersion" = mkOverride 1002 null; - "name" = mkOverride 1002 null; + "name" = mkOverride 1002 null; - "timestamp" = mkOverride 1002 null; - }; + "timestamp" = mkOverride 1002 null; }; + }; - "istio_mixer_authorization_ActionMsg" = { - options = { - "method" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "istio_mixer_authorization_ActionMsg" = { + options = { + "method" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "namespace" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "namespace" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "path" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "path" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "properties" = mkOption { - description = ""; - type = types.nullOr types.attrs; - }; + "properties" = mkOption { + description = ""; + type = types.nullOr types.attrs; + }; - "service" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "service" = mkOption { + description = ""; + type = types.nullOr types.str; }; + }; - config = { - "method" = mkOverride 1002 null; + config = { + "method" = mkOverride 1002 null; - "namespace" = mkOverride 1002 null; + "namespace" = mkOverride 1002 null; - "path" = mkOverride 1002 null; + "path" = mkOverride 1002 null; - "properties" = mkOverride 1002 null; + "properties" = mkOverride 1002 null; - "service" = mkOverride 1002 null; - }; + "service" = mkOverride 1002 null; }; + }; - "istio_mixer_authorization_InstanceMsg" = { - options = { - "action" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "istio_mixer_authorization_ActionMsg"); - }; + "istio_mixer_authorization_InstanceMsg" = { + options = { + "action" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "istio_mixer_authorization_ActionMsg"); + }; - "name" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "name" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "subject" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "istio_mixer_authorization_SubjectMsg"); - }; + "subject" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "istio_mixer_authorization_SubjectMsg"); }; + }; - config = { - "action" = mkOverride 1002 null; + config = { + "action" = mkOverride 1002 null; - "name" = mkOverride 1002 null; + "name" = mkOverride 1002 null; - "subject" = mkOverride 1002 null; - }; + "subject" = mkOverride 1002 null; }; + }; - "istio_mixer_authorization_SubjectMsg" = { - options = { - "groups" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "istio_mixer_authorization_SubjectMsg" = { + options = { + "groups" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "properties" = mkOption { - description = ""; - type = types.nullOr types.attrs; - }; + "properties" = mkOption { + description = ""; + type = types.nullOr types.attrs; + }; - "user" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "user" = mkOption { + description = ""; + type = types.nullOr types.str; }; + }; - config = { - "groups" = mkOverride 1002 null; + config = { + "groups" = mkOverride 1002 null; - "properties" = mkOverride 1002 null; + "properties" = mkOverride 1002 null; - "user" = mkOverride 1002 null; - }; + "user" = mkOverride 1002 null; }; + }; - "istio_mixer_checknothing_InstanceMsg" = { - options = { - "name" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "istio_mixer_checknothing_InstanceMsg" = { + options = { + "name" = mkOption { + description = ""; + type = types.nullOr types.str; }; + }; - config = { - "name" = mkOverride 1002 null; - }; + config = { + "name" = mkOverride 1002 null; }; + }; - "istio_mixer_edge_InstanceMsg" = { - options = { - "apiProtocol" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "istio_mixer_edge_InstanceMsg" = { + options = { + "apiProtocol" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "contextProtocol" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "contextProtocol" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "destinationOwner" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "destinationOwner" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "destinationUid" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "destinationUid" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "destinationWorkloadName" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "destinationWorkloadName" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "destinationWorkloadNamespace" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "destinationWorkloadNamespace" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "name" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "name" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "sourceOwner" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "sourceOwner" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "sourceUid" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "sourceUid" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "sourceWorkloadName" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "sourceWorkloadName" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "sourceWorkloadNamespace" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "sourceWorkloadNamespace" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "timestamp" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "istio_policy_v1beta1_TimeStamp"); - }; + "timestamp" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "istio_policy_v1beta1_TimeStamp"); }; + }; - config = { - "apiProtocol" = mkOverride 1002 null; + config = { + "apiProtocol" = mkOverride 1002 null; - "contextProtocol" = mkOverride 1002 null; + "contextProtocol" = mkOverride 1002 null; - "destinationOwner" = mkOverride 1002 null; + "destinationOwner" = mkOverride 1002 null; - "destinationUid" = mkOverride 1002 null; + "destinationUid" = mkOverride 1002 null; - "destinationWorkloadName" = mkOverride 1002 null; + "destinationWorkloadName" = mkOverride 1002 null; - "destinationWorkloadNamespace" = mkOverride 1002 null; + "destinationWorkloadNamespace" = mkOverride 1002 null; - "name" = mkOverride 1002 null; + "name" = mkOverride 1002 null; - "sourceOwner" = mkOverride 1002 null; + "sourceOwner" = mkOverride 1002 null; - "sourceUid" = mkOverride 1002 null; + "sourceUid" = mkOverride 1002 null; - "sourceWorkloadName" = mkOverride 1002 null; + "sourceWorkloadName" = mkOverride 1002 null; - "sourceWorkloadNamespace" = mkOverride 1002 null; + "sourceWorkloadNamespace" = mkOverride 1002 null; - "timestamp" = mkOverride 1002 null; - }; + "timestamp" = mkOverride 1002 null; }; + }; - "istio_mixer_listentry_InstanceMsg" = { - options = { - "name" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "istio_mixer_listentry_InstanceMsg" = { + options = { + "name" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "value" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "value" = mkOption { + description = ""; + type = types.nullOr types.str; }; + }; - config = { - "name" = mkOverride 1002 null; + config = { + "name" = mkOverride 1002 null; - "value" = mkOverride 1002 null; - }; + "value" = mkOverride 1002 null; }; + }; - "istio_mixer_logentry_InstanceMsg" = { - options = { - "monitoredResourceDimensions" = mkOption { - description = ""; - type = types.nullOr types.attrs; - }; + "istio_mixer_logentry_InstanceMsg" = { + options = { + "monitoredResourceDimensions" = mkOption { + description = ""; + type = types.nullOr types.attrs; + }; - "monitoredResourceType" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "monitoredResourceType" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "name" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "name" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "severity" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "severity" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "timestamp" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "istio_policy_v1beta1_TimeStamp"); - }; + "timestamp" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "istio_policy_v1beta1_TimeStamp"); + }; - "variables" = mkOption { - description = ""; - type = types.nullOr types.attrs; - }; + "variables" = mkOption { + description = ""; + type = types.nullOr types.attrs; }; + }; - config = { - "monitoredResourceDimensions" = mkOverride 1002 null; + config = { + "monitoredResourceDimensions" = mkOverride 1002 null; - "monitoredResourceType" = mkOverride 1002 null; + "monitoredResourceType" = mkOverride 1002 null; - "name" = mkOverride 1002 null; + "name" = mkOverride 1002 null; - "severity" = mkOverride 1002 null; + "severity" = mkOverride 1002 null; - "timestamp" = mkOverride 1002 null; + "timestamp" = mkOverride 1002 null; - "variables" = mkOverride 1002 null; - }; + "variables" = mkOverride 1002 null; }; + }; - "istio_mixer_metric_InstanceMsg" = { - options = { - "dimensions" = mkOption { - description = ""; - type = types.nullOr types.attrs; - }; + "istio_mixer_metric_InstanceMsg" = { + options = { + "dimensions" = mkOption { + description = ""; + type = types.nullOr types.attrs; + }; - "monitoredResourceDimensions" = mkOption { - description = ""; - type = types.nullOr types.attrs; - }; + "monitoredResourceDimensions" = mkOption { + description = ""; + type = types.nullOr types.attrs; + }; - "monitoredResourceType" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "monitoredResourceType" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "name" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "name" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "value" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "istio_policy_v1beta1_Value"); - }; + "value" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "istio_policy_v1beta1_Value"); }; + }; - config = { - "dimensions" = mkOverride 1002 null; + config = { + "dimensions" = mkOverride 1002 null; - "monitoredResourceDimensions" = mkOverride 1002 null; + "monitoredResourceDimensions" = mkOverride 1002 null; - "monitoredResourceType" = mkOverride 1002 null; + "monitoredResourceType" = mkOverride 1002 null; - "name" = mkOverride 1002 null; + "name" = mkOverride 1002 null; - "value" = mkOverride 1002 null; - }; + "value" = mkOverride 1002 null; }; + }; - "istio_mixer_quota_InstanceMsg" = { - options = { - "dimensions" = mkOption { - description = ""; - type = types.nullOr types.attrs; - }; + "istio_mixer_quota_InstanceMsg" = { + options = { + "dimensions" = mkOption { + description = ""; + type = types.nullOr types.attrs; + }; - "name" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "name" = mkOption { + description = ""; + type = types.nullOr types.str; }; + }; - config = { - "dimensions" = mkOverride 1002 null; + config = { + "dimensions" = mkOverride 1002 null; - "name" = mkOverride 1002 null; - }; + "name" = mkOverride 1002 null; }; + }; - "istio_mixer_reportnothing_InstanceMsg" = { - options = { - "name" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "istio_mixer_reportnothing_InstanceMsg" = { + options = { + "name" = mkOption { + description = ""; + type = types.nullOr types.str; }; + }; - config = { - "name" = mkOverride 1002 null; - }; + config = { + "name" = mkOverride 1002 null; }; + }; - "istio_mixer_tracespan_InstanceMsg" = { - options = { - "clientSpan" = mkOption { - description = ""; - type = types.nullOr types.bool; - }; + "istio_mixer_tracespan_InstanceMsg" = { + options = { + "clientSpan" = mkOption { + description = ""; + type = types.nullOr types.bool; + }; - "endTime" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "istio_policy_v1beta1_TimeStamp"); - }; + "endTime" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "istio_policy_v1beta1_TimeStamp"); + }; - "httpStatusCode" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "httpStatusCode" = mkOption { + description = ""; + type = types.nullOr types.int; + }; - "name" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "name" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "parentSpanId" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "parentSpanId" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "rewriteClientSpanId" = mkOption { - description = ""; - type = types.nullOr types.bool; - }; + "rewriteClientSpanId" = mkOption { + description = ""; + type = types.nullOr types.bool; + }; - "spanId" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "spanId" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "spanName" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "spanName" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "spanTags" = mkOption { - description = ""; - type = types.nullOr types.attrs; - }; + "spanTags" = mkOption { + description = ""; + type = types.nullOr types.attrs; + }; - "startTime" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "istio_policy_v1beta1_TimeStamp"); - }; + "startTime" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "istio_policy_v1beta1_TimeStamp"); + }; - "traceId" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "traceId" = mkOption { + description = ""; + type = types.nullOr types.str; }; + }; - config = { - "clientSpan" = mkOverride 1002 null; + config = { + "clientSpan" = mkOverride 1002 null; - "endTime" = mkOverride 1002 null; + "endTime" = mkOverride 1002 null; - "httpStatusCode" = mkOverride 1002 null; + "httpStatusCode" = mkOverride 1002 null; - "name" = mkOverride 1002 null; + "name" = mkOverride 1002 null; - "parentSpanId" = mkOverride 1002 null; + "parentSpanId" = mkOverride 1002 null; - "rewriteClientSpanId" = mkOverride 1002 null; + "rewriteClientSpanId" = mkOverride 1002 null; - "spanId" = mkOverride 1002 null; + "spanId" = mkOverride 1002 null; - "spanName" = mkOverride 1002 null; + "spanName" = mkOverride 1002 null; - "spanTags" = mkOverride 1002 null; + "spanTags" = mkOverride 1002 null; - "startTime" = mkOverride 1002 null; + "startTime" = mkOverride 1002 null; - "traceId" = mkOverride 1002 null; - }; + "traceId" = mkOverride 1002 null; }; + }; - "istio_mixer_v1_Attributes" = { - options = { - "attributes" = mkOption { - description = ""; - type = types.nullOr types.attrs; - }; + "istio_mixer_v1_Attributes" = { + options = { + "attributes" = mkOption { + description = ""; + type = types.nullOr types.attrs; }; + }; - config = { - "attributes" = mkOverride 1002 null; - }; + config = { + "attributes" = mkOverride 1002 null; }; + }; - "istio_mixer_v1_Attributes_AttributeValue" = { - options = { - "value" = mkOption { - description = ""; - type = types.unspecified; - }; + "istio_mixer_v1_Attributes_AttributeValue" = { + options = { + "value" = mkOption { + description = ""; + type = types.unspecified; }; + }; - config = { - "value" = mkOverride 1002 null; - }; + config = { + "value" = mkOverride 1002 null; }; + }; - "istio_mixer_v1_CheckRequest" = { - options = { - "attributes" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "istio_mixer_v1_CompressedAttributes"); - }; + "istio_mixer_v1_CheckRequest" = { + options = { + "attributes" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "istio_mixer_v1_CompressedAttributes"); + }; - "deduplicationId" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "deduplicationId" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "globalWordCount" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "globalWordCount" = mkOption { + description = ""; + type = types.nullOr types.int; + }; - "quotas" = mkOption { - description = ""; - type = types.nullOr types.attrs; - }; + "quotas" = mkOption { + description = ""; + type = types.nullOr types.attrs; }; + }; - config = { - "attributes" = mkOverride 1002 null; + config = { + "attributes" = mkOverride 1002 null; - "deduplicationId" = mkOverride 1002 null; + "deduplicationId" = mkOverride 1002 null; - "globalWordCount" = mkOverride 1002 null; + "globalWordCount" = mkOverride 1002 null; - "quotas" = mkOverride 1002 null; - }; + "quotas" = mkOverride 1002 null; }; + }; - "istio_mixer_v1_CheckRequest_QuotaParams" = { - options = { - "amount" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "istio_mixer_v1_CheckRequest_QuotaParams" = { + options = { + "amount" = mkOption { + description = ""; + type = types.nullOr types.int; + }; - "bestEffort" = mkOption { - description = ""; - type = types.nullOr types.bool; - }; + "bestEffort" = mkOption { + description = ""; + type = types.nullOr types.bool; }; + }; - config = { - "amount" = mkOverride 1002 null; + config = { + "amount" = mkOverride 1002 null; - "bestEffort" = mkOverride 1002 null; - }; + "bestEffort" = mkOverride 1002 null; }; + }; - "istio_mixer_v1_CheckResponse" = { - options = { - "precondition" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "istio_mixer_v1_CheckResponse_PreconditionResult"); - }; + "istio_mixer_v1_CheckResponse" = { + options = { + "precondition" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "istio_mixer_v1_CheckResponse_PreconditionResult"); + }; - "quotas" = mkOption { - description = ""; - type = types.nullOr types.attrs; - }; + "quotas" = mkOption { + description = ""; + type = types.nullOr types.attrs; }; + }; - config = { - "precondition" = mkOverride 1002 null; + config = { + "precondition" = mkOverride 1002 null; - "quotas" = mkOverride 1002 null; - }; + "quotas" = mkOverride 1002 null; }; + }; - "istio_mixer_v1_CheckResponse_PreconditionResult" = { - options = { - "referencedAttributes" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "istio_mixer_v1_ReferencedAttributes"); - }; + "istio_mixer_v1_CheckResponse_PreconditionResult" = { + options = { + "referencedAttributes" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "istio_mixer_v1_ReferencedAttributes"); + }; - "routeDirective" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "istio_mixer_v1_RouteDirective"); - }; + "routeDirective" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "istio_mixer_v1_RouteDirective"); + }; - "status" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "google_rpc_Status"); - }; + "status" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "google_rpc_Status"); + }; - "validDuration" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "validDuration" = mkOption { + description = ""; + type = types.nullOr types.int; + }; - "validUseCount" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "validUseCount" = mkOption { + description = ""; + type = types.nullOr types.int; }; + }; - config = { - "referencedAttributes" = mkOverride 1002 null; + config = { + "referencedAttributes" = mkOverride 1002 null; - "routeDirective" = mkOverride 1002 null; + "routeDirective" = mkOverride 1002 null; - "status" = mkOverride 1002 null; + "status" = mkOverride 1002 null; - "validDuration" = mkOverride 1002 null; + "validDuration" = mkOverride 1002 null; - "validUseCount" = mkOverride 1002 null; - }; + "validUseCount" = mkOverride 1002 null; }; + }; - "istio_mixer_v1_CheckResponse_QuotaResult" = { - options = { - "grantedAmount" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "istio_mixer_v1_CheckResponse_QuotaResult" = { + options = { + "grantedAmount" = mkOption { + description = ""; + type = types.nullOr types.int; + }; - "referencedAttributes" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "istio_mixer_v1_ReferencedAttributes"); - }; + "referencedAttributes" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "istio_mixer_v1_ReferencedAttributes"); + }; - "validDuration" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "validDuration" = mkOption { + description = ""; + type = types.nullOr types.int; }; + }; - config = { - "grantedAmount" = mkOverride 1002 null; + config = { + "grantedAmount" = mkOverride 1002 null; - "referencedAttributes" = mkOverride 1002 null; + "referencedAttributes" = mkOverride 1002 null; - "validDuration" = mkOverride 1002 null; - }; + "validDuration" = mkOverride 1002 null; }; + }; - "istio_mixer_v1_CompressedAttributes" = { - options = { - "bools" = mkOption { - description = ""; - type = types.nullOr (types.attrsOf types.bool); - }; + "istio_mixer_v1_CompressedAttributes" = { + options = { + "bools" = mkOption { + description = ""; + type = types.nullOr (types.attrsOf types.bool); + }; - "bytes" = mkOption { - description = ""; - type = types.nullOr (types.attrsOf types.str); - }; + "bytes" = mkOption { + description = ""; + type = types.nullOr (types.attrsOf types.str); + }; - "doubles" = mkOption { - description = ""; - type = types.nullOr (types.attrsOf types.int); - }; + "doubles" = mkOption { + description = ""; + type = types.nullOr (types.attrsOf types.int); + }; - "durations" = mkOption { - description = ""; - type = types.nullOr (types.attrsOf types.int); - }; + "durations" = mkOption { + description = ""; + type = types.nullOr (types.attrsOf types.int); + }; - "int64s" = mkOption { - description = ""; - type = types.nullOr (types.attrsOf types.int); - }; + "int64s" = mkOption { + description = ""; + type = types.nullOr (types.attrsOf types.int); + }; - "stringMaps" = mkOption { - description = ""; - type = types.nullOr types.attrs; - }; + "stringMaps" = mkOption { + description = ""; + type = types.nullOr types.attrs; + }; - "strings" = mkOption { - description = ""; - type = types.nullOr (types.attrsOf types.int); - }; + "strings" = mkOption { + description = ""; + type = types.nullOr (types.attrsOf types.int); + }; - "timestamps" = mkOption { - description = ""; - type = types.nullOr (types.attrsOf types.str); - }; + "timestamps" = mkOption { + description = ""; + type = types.nullOr (types.attrsOf types.str); + }; - "words" = mkOption { - description = ""; - type = types.nullOr (types.listOf types.str); - }; + "words" = mkOption { + description = ""; + type = types.nullOr (types.listOf types.str); }; + }; - config = { - "bools" = mkOverride 1002 null; + config = { + "bools" = mkOverride 1002 null; - "bytes" = mkOverride 1002 null; + "bytes" = mkOverride 1002 null; - "doubles" = mkOverride 1002 null; + "doubles" = mkOverride 1002 null; - "durations" = mkOverride 1002 null; + "durations" = mkOverride 1002 null; - "int64s" = mkOverride 1002 null; + "int64s" = mkOverride 1002 null; - "stringMaps" = mkOverride 1002 null; + "stringMaps" = mkOverride 1002 null; - "strings" = mkOverride 1002 null; + "strings" = mkOverride 1002 null; - "timestamps" = mkOverride 1002 null; + "timestamps" = mkOverride 1002 null; - "words" = mkOverride 1002 null; - }; + "words" = mkOverride 1002 null; }; + }; - "istio_mixer_v1_HeaderOperation" = { - options = { - "name" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "istio_mixer_v1_HeaderOperation" = { + options = { + "name" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "operation" = mkOption { - description = ""; - type = types.unspecified; - }; + "operation" = mkOption { + description = ""; + type = types.unspecified; + }; - "value" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "value" = mkOption { + description = ""; + type = types.nullOr types.str; }; + }; - config = { - "name" = mkOverride 1002 null; + config = { + "name" = mkOverride 1002 null; - "operation" = mkOverride 1002 null; + "operation" = mkOverride 1002 null; - "value" = mkOverride 1002 null; - }; + "value" = mkOverride 1002 null; }; + }; - "istio_mixer_v1_ReferencedAttributes" = { - options = { - "attributeMatches" = mkOption { - description = ""; - type = types.nullOr (types.listOf (submoduleOf "istio_mixer_v1_ReferencedAttributes_AttributeMatch")); - }; + "istio_mixer_v1_ReferencedAttributes" = { + options = { + "attributeMatches" = mkOption { + description = ""; + type = types.nullOr (types.listOf (submoduleOf "istio_mixer_v1_ReferencedAttributes_AttributeMatch")); + }; - "words" = mkOption { - description = ""; - type = types.nullOr (types.listOf types.str); - }; + "words" = mkOption { + description = ""; + type = types.nullOr (types.listOf types.str); }; + }; - config = { - "attributeMatches" = mkOverride 1002 null; + config = { + "attributeMatches" = mkOverride 1002 null; - "words" = mkOverride 1002 null; - }; + "words" = mkOverride 1002 null; }; + }; - "istio_mixer_v1_ReferencedAttributes_AttributeMatch" = { - options = { - "condition" = mkOption { - description = ""; - type = types.unspecified; - }; + "istio_mixer_v1_ReferencedAttributes_AttributeMatch" = { + options = { + "condition" = mkOption { + description = ""; + type = types.unspecified; + }; - "mapKey" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "mapKey" = mkOption { + description = ""; + type = types.nullOr types.int; + }; - "name" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "name" = mkOption { + description = ""; + type = types.nullOr types.int; + }; - "regex" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "regex" = mkOption { + description = ""; + type = types.nullOr types.str; }; + }; - config = { - "condition" = mkOverride 1002 null; + config = { + "condition" = mkOverride 1002 null; - "mapKey" = mkOverride 1002 null; + "mapKey" = mkOverride 1002 null; - "name" = mkOverride 1002 null; + "name" = mkOverride 1002 null; - "regex" = mkOverride 1002 null; - }; + "regex" = mkOverride 1002 null; }; + }; - "istio_mixer_v1_ReportRequest" = { - options = { - "attributes" = mkOption { - description = ""; - type = types.nullOr (types.listOf (submoduleOf "istio_mixer_v1_CompressedAttributes")); - }; + "istio_mixer_v1_ReportRequest" = { + options = { + "attributes" = mkOption { + description = ""; + type = types.nullOr (types.listOf (submoduleOf "istio_mixer_v1_CompressedAttributes")); + }; - "defaultWords" = mkOption { - description = ""; - type = types.nullOr (types.listOf types.str); - }; + "defaultWords" = mkOption { + description = ""; + type = types.nullOr (types.listOf types.str); + }; - "globalWordCount" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "globalWordCount" = mkOption { + description = ""; + type = types.nullOr types.int; }; + }; - config = { - "attributes" = mkOverride 1002 null; + config = { + "attributes" = mkOverride 1002 null; - "defaultWords" = mkOverride 1002 null; + "defaultWords" = mkOverride 1002 null; - "globalWordCount" = mkOverride 1002 null; - }; + "globalWordCount" = mkOverride 1002 null; }; + }; - "istio_mixer_v1_ReportResponse" = {}; + "istio_mixer_v1_ReportResponse" = { }; - "istio_mixer_v1_RouteDirective" = { - options = { - "directResponseBody" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "istio_mixer_v1_RouteDirective" = { + options = { + "directResponseBody" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "directResponseCode" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "directResponseCode" = mkOption { + description = ""; + type = types.nullOr types.int; + }; - "requestHeaderOperations" = mkOption { - description = ""; - type = types.nullOr (types.listOf (submoduleOf "istio_mixer_v1_HeaderOperation")); - }; + "requestHeaderOperations" = mkOption { + description = ""; + type = types.nullOr (types.listOf (submoduleOf "istio_mixer_v1_HeaderOperation")); + }; - "responseHeaderOperations" = mkOption { - description = ""; - type = types.nullOr (types.listOf (submoduleOf "istio_mixer_v1_HeaderOperation")); - }; + "responseHeaderOperations" = mkOption { + description = ""; + type = types.nullOr (types.listOf (submoduleOf "istio_mixer_v1_HeaderOperation")); }; + }; - config = { - "directResponseBody" = mkOverride 1002 null; + config = { + "directResponseBody" = mkOverride 1002 null; - "directResponseCode" = mkOverride 1002 null; + "directResponseCode" = mkOverride 1002 null; - "requestHeaderOperations" = mkOverride 1002 null; + "requestHeaderOperations" = mkOverride 1002 null; - "responseHeaderOperations" = mkOverride 1002 null; - }; + "responseHeaderOperations" = mkOverride 1002 null; }; + }; - "istio_mixer_v1_StringMap" = { - options = { - "entries" = mkOption { - description = ""; - type = types.nullOr (types.attrsOf types.int); - }; + "istio_mixer_v1_StringMap" = { + options = { + "entries" = mkOption { + description = ""; + type = types.nullOr (types.attrsOf types.int); }; + }; - config = { - "entries" = mkOverride 1002 null; - }; + config = { + "entries" = mkOverride 1002 null; }; + }; - "istio_networking_v1alpha3_ConnectionPoolSettings" = { - options = { - "http" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "istio_networking_v1alpha3_ConnectionPoolSettings_HTTPSettings"); - }; + "istio_networking_v1alpha3_ConnectionPoolSettings" = { + options = { + "http" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "istio_networking_v1alpha3_ConnectionPoolSettings_HTTPSettings"); + }; - "tcp" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "istio_networking_v1alpha3_ConnectionPoolSettings_TCPSettings"); - }; + "tcp" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "istio_networking_v1alpha3_ConnectionPoolSettings_TCPSettings"); }; + }; - config = { - "http" = mkOverride 1002 null; + config = { + "http" = mkOverride 1002 null; - "tcp" = mkOverride 1002 null; - }; + "tcp" = mkOverride 1002 null; }; + }; - "istio_networking_v1alpha3_ConnectionPoolSettings_HTTPSettings" = { - options = { - "http1MaxPendingRequests" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "istio_networking_v1alpha3_ConnectionPoolSettings_HTTPSettings" = { + options = { + "http1MaxPendingRequests" = mkOption { + description = ""; + type = types.nullOr types.int; + }; - "http2MaxRequests" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "http2MaxRequests" = mkOption { + description = ""; + type = types.nullOr types.int; + }; - "maxRequestsPerConnection" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "maxRequestsPerConnection" = mkOption { + description = ""; + type = types.nullOr types.int; + }; - "maxRetries" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "maxRetries" = mkOption { + description = ""; + type = types.nullOr types.int; }; + }; - config = { - "http1MaxPendingRequests" = mkOverride 1002 null; + config = { + "http1MaxPendingRequests" = mkOverride 1002 null; - "http2MaxRequests" = mkOverride 1002 null; + "http2MaxRequests" = mkOverride 1002 null; - "maxRequestsPerConnection" = mkOverride 1002 null; + "maxRequestsPerConnection" = mkOverride 1002 null; - "maxRetries" = mkOverride 1002 null; - }; + "maxRetries" = mkOverride 1002 null; }; + }; - "istio_networking_v1alpha3_ConnectionPoolSettings_TCPSettings" = { - options = { - "connectTimeout" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "protobuf_types_Duration"); - }; + "istio_networking_v1alpha3_ConnectionPoolSettings_TCPSettings" = { + options = { + "connectTimeout" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "protobuf_types_Duration"); + }; - "maxConnections" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "maxConnections" = mkOption { + description = ""; + type = types.nullOr types.int; }; + }; - config = { - "connectTimeout" = mkOverride 1002 null; + config = { + "connectTimeout" = mkOverride 1002 null; - "maxConnections" = mkOverride 1002 null; - }; + "maxConnections" = mkOverride 1002 null; }; + }; - "istio_networking_v1alpha3_CorsPolicy" = { - options = { - "allowCredentials" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "protobuf_types_BoolValue"); - }; + "istio_networking_v1alpha3_CorsPolicy" = { + options = { + "allowCredentials" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "protobuf_types_BoolValue"); + }; - "allowHeaders" = mkOption { - description = ""; - type = types.nullOr (types.listOf types.str); - }; + "allowHeaders" = mkOption { + description = ""; + type = types.nullOr (types.listOf types.str); + }; - "allowMethods" = mkOption { - description = ""; - type = types.nullOr (types.listOf types.str); - }; + "allowMethods" = mkOption { + description = ""; + type = types.nullOr (types.listOf types.str); + }; - "allowOrigin" = mkOption { - description = ""; - type = types.nullOr (types.listOf types.str); - }; + "allowOrigin" = mkOption { + description = ""; + type = types.nullOr (types.listOf types.str); + }; - "exposeHeaders" = mkOption { - description = ""; - type = types.nullOr (types.listOf types.str); - }; + "exposeHeaders" = mkOption { + description = ""; + type = types.nullOr (types.listOf types.str); + }; - "maxAge" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "protobuf_types_Duration"); - }; + "maxAge" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "protobuf_types_Duration"); }; + }; - config = { - "allowCredentials" = mkOverride 1002 null; + config = { + "allowCredentials" = mkOverride 1002 null; - "allowHeaders" = mkOverride 1002 null; + "allowHeaders" = mkOverride 1002 null; - "allowMethods" = mkOverride 1002 null; + "allowMethods" = mkOverride 1002 null; - "allowOrigin" = mkOverride 1002 null; + "allowOrigin" = mkOverride 1002 null; - "exposeHeaders" = mkOverride 1002 null; + "exposeHeaders" = mkOverride 1002 null; - "maxAge" = mkOverride 1002 null; - }; + "maxAge" = mkOverride 1002 null; }; + }; - "istio_networking_v1alpha3_Destination" = { - options = { - "host" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "istio_networking_v1alpha3_Destination" = { + options = { + "host" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "port" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "istio_networking_v1alpha3_PortSelector"); - }; + "port" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "istio_networking_v1alpha3_PortSelector"); + }; - "subset" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "subset" = mkOption { + description = ""; + type = types.nullOr types.str; }; + }; - config = { - "host" = mkOverride 1002 null; + config = { + "host" = mkOverride 1002 null; - "port" = mkOverride 1002 null; + "port" = mkOverride 1002 null; - "subset" = mkOverride 1002 null; - }; + "subset" = mkOverride 1002 null; }; + }; - "istio_networking_v1alpha3_DestinationRule" = { - options = { - "host" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "istio_networking_v1alpha3_DestinationRule" = { + options = { + "host" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "subsets" = mkOption { - description = ""; - type = types.nullOr (types.listOf (submoduleOf "istio_networking_v1alpha3_Subset")); - }; + "subsets" = mkOption { + description = ""; + type = types.nullOr (types.listOf (submoduleOf "istio_networking_v1alpha3_Subset")); + }; - "trafficPolicy" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "istio_networking_v1alpha3_TrafficPolicy"); - }; + "trafficPolicy" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "istio_networking_v1alpha3_TrafficPolicy"); }; + }; - config = { - "host" = mkOverride 1002 null; + config = { + "host" = mkOverride 1002 null; - "subsets" = mkOverride 1002 null; + "subsets" = mkOverride 1002 null; - "trafficPolicy" = mkOverride 1002 null; - }; + "trafficPolicy" = mkOverride 1002 null; }; + }; - "istio_networking_v1alpha3_DestinationWeight" = { - options = { - "destination" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "istio_networking_v1alpha3_Destination"); - }; + "istio_networking_v1alpha3_DestinationWeight" = { + options = { + "destination" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "istio_networking_v1alpha3_Destination"); + }; - "weight" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "weight" = mkOption { + description = ""; + type = types.nullOr types.int; }; + }; - config = { - "destination" = mkOverride 1002 null; + config = { + "destination" = mkOverride 1002 null; - "weight" = mkOverride 1002 null; - }; + "weight" = mkOverride 1002 null; }; + }; - "istio_networking_v1alpha3_EnvoyFilter" = { - options = { - "filters" = mkOption { - description = ""; - type = types.nullOr (types.listOf (submoduleOf "istio_networking_v1alpha3_EnvoyFilter_Filter")); - }; + "istio_networking_v1alpha3_EnvoyFilter" = { + options = { + "filters" = mkOption { + description = ""; + type = types.nullOr (types.listOf (submoduleOf "istio_networking_v1alpha3_EnvoyFilter_Filter")); + }; - "workloadLabels" = mkOption { - description = ""; - type = types.nullOr (types.attrsOf types.str); - }; + "workloadLabels" = mkOption { + description = ""; + type = types.nullOr (types.attrsOf types.str); }; + }; - config = { - "filters" = mkOverride 1002 null; + config = { + "filters" = mkOverride 1002 null; - "workloadLabels" = mkOverride 1002 null; - }; + "workloadLabels" = mkOverride 1002 null; }; + }; - "istio_networking_v1alpha3_EnvoyFilter_Filter" = { - options = { - "filterConfig" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "protobuf_types_Struct"); - }; + "istio_networking_v1alpha3_EnvoyFilter_Filter" = { + options = { + "filterConfig" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "protobuf_types_Struct"); + }; - "filterName" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "filterName" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "filterType" = mkOption { - description = ""; - type = types.unspecified; - }; + "filterType" = mkOption { + description = ""; + type = types.unspecified; + }; - "insertPosition" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "istio_networking_v1alpha3_EnvoyFilter_InsertPosition"); - }; + "insertPosition" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "istio_networking_v1alpha3_EnvoyFilter_InsertPosition"); + }; - "listenerMatch" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "istio_networking_v1alpha3_EnvoyFilter_ListenerMatch"); - }; + "listenerMatch" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "istio_networking_v1alpha3_EnvoyFilter_ListenerMatch"); }; + }; - config = { - "filterConfig" = mkOverride 1002 null; + config = { + "filterConfig" = mkOverride 1002 null; - "filterName" = mkOverride 1002 null; + "filterName" = mkOverride 1002 null; - "filterType" = mkOverride 1002 null; + "filterType" = mkOverride 1002 null; - "insertPosition" = mkOverride 1002 null; + "insertPosition" = mkOverride 1002 null; - "listenerMatch" = mkOverride 1002 null; - }; + "listenerMatch" = mkOverride 1002 null; }; + }; - "istio_networking_v1alpha3_EnvoyFilter_InsertPosition" = { - options = { - "index" = mkOption { - description = ""; - type = types.unspecified; - }; + "istio_networking_v1alpha3_EnvoyFilter_InsertPosition" = { + options = { + "index" = mkOption { + description = ""; + type = types.unspecified; + }; - "relativeTo" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "relativeTo" = mkOption { + description = ""; + type = types.nullOr types.str; }; + }; - config = { - "index" = mkOverride 1002 null; + config = { + "index" = mkOverride 1002 null; - "relativeTo" = mkOverride 1002 null; - }; + "relativeTo" = mkOverride 1002 null; }; + }; - "istio_networking_v1alpha3_EnvoyFilter_ListenerMatch" = { - options = { - "address" = mkOption { - description = ""; - type = types.nullOr (types.listOf types.str); - }; + "istio_networking_v1alpha3_EnvoyFilter_ListenerMatch" = { + options = { + "address" = mkOption { + description = ""; + type = types.nullOr (types.listOf types.str); + }; - "listenerProtocol" = mkOption { - description = ""; - type = types.unspecified; - }; + "listenerProtocol" = mkOption { + description = ""; + type = types.unspecified; + }; - "listenerType" = mkOption { - description = ""; - type = types.unspecified; - }; + "listenerType" = mkOption { + description = ""; + type = types.unspecified; + }; - "portNamePrefix" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "portNamePrefix" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "portNumber" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "portNumber" = mkOption { + description = ""; + type = types.nullOr types.int; }; + }; - config = { - "address" = mkOverride 1002 null; + config = { + "address" = mkOverride 1002 null; - "listenerProtocol" = mkOverride 1002 null; + "listenerProtocol" = mkOverride 1002 null; - "listenerType" = mkOverride 1002 null; + "listenerType" = mkOverride 1002 null; - "portNamePrefix" = mkOverride 1002 null; + "portNamePrefix" = mkOverride 1002 null; - "portNumber" = mkOverride 1002 null; - }; + "portNumber" = mkOverride 1002 null; }; + }; - "istio_networking_v1alpha3_Gateway" = { - options = { - "selector" = mkOption { - description = ""; - type = types.nullOr (types.attrsOf types.str); - }; + "istio_networking_v1alpha3_Gateway" = { + options = { + "selector" = mkOption { + description = ""; + type = types.nullOr (types.attrsOf types.str); + }; - "servers" = mkOption { - description = ""; - type = types.nullOr (types.listOf (submoduleOf "istio_networking_v1alpha3_Server")); - }; + "servers" = mkOption { + description = ""; + type = types.nullOr (types.listOf (submoduleOf "istio_networking_v1alpha3_Server")); }; + }; - config = { - "selector" = mkOverride 1002 null; + config = { + "selector" = mkOverride 1002 null; - "servers" = mkOverride 1002 null; - }; + "servers" = mkOverride 1002 null; }; + }; - "istio_networking_v1alpha3_HTTPFaultInjection" = { - options = { - "abort" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "istio_networking_v1alpha3_HTTPFaultInjection_Abort"); - }; + "istio_networking_v1alpha3_HTTPFaultInjection" = { + options = { + "abort" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "istio_networking_v1alpha3_HTTPFaultInjection_Abort"); + }; - "delay" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "istio_networking_v1alpha3_HTTPFaultInjection_Delay"); - }; + "delay" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "istio_networking_v1alpha3_HTTPFaultInjection_Delay"); }; + }; - config = { - "abort" = mkOverride 1002 null; + config = { + "abort" = mkOverride 1002 null; - "delay" = mkOverride 1002 null; - }; + "delay" = mkOverride 1002 null; }; + }; - "istio_networking_v1alpha3_HTTPFaultInjection_Abort" = { - options = { - "errorType" = mkOption { - description = ""; - type = types.unspecified; - }; + "istio_networking_v1alpha3_HTTPFaultInjection_Abort" = { + options = { + "errorType" = mkOption { + description = ""; + type = types.unspecified; + }; - "percent" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "percent" = mkOption { + description = ""; + type = types.nullOr types.int; }; + }; - config = { - "errorType" = mkOverride 1002 null; + config = { + "errorType" = mkOverride 1002 null; - "percent" = mkOverride 1002 null; - }; + "percent" = mkOverride 1002 null; }; + }; - "istio_networking_v1alpha3_HTTPFaultInjection_Abort_GrpcStatus" = { - options = { - "grpcStatus" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "istio_networking_v1alpha3_HTTPFaultInjection_Abort_GrpcStatus" = { + options = { + "grpcStatus" = mkOption { + description = ""; + type = types.nullOr types.str; }; + }; - config = { - "grpcStatus" = mkOverride 1002 null; - }; + config = { + "grpcStatus" = mkOverride 1002 null; }; + }; - "istio_networking_v1alpha3_HTTPFaultInjection_Abort_Http2Error" = { - options = { - "http2Error" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "istio_networking_v1alpha3_HTTPFaultInjection_Abort_Http2Error" = { + options = { + "http2Error" = mkOption { + description = ""; + type = types.nullOr types.str; }; + }; - config = { - "http2Error" = mkOverride 1002 null; - }; + config = { + "http2Error" = mkOverride 1002 null; }; + }; - "istio_networking_v1alpha3_HTTPFaultInjection_Abort_HttpStatus" = { - options = { - "httpStatus" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "istio_networking_v1alpha3_HTTPFaultInjection_Abort_HttpStatus" = { + options = { + "httpStatus" = mkOption { + description = ""; + type = types.nullOr types.int; }; + }; - config = { - "httpStatus" = mkOverride 1002 null; - }; + config = { + "httpStatus" = mkOverride 1002 null; }; + }; - "istio_networking_v1alpha3_HTTPFaultInjection_Delay" = { - options = { - "httpDelayType" = mkOption { - description = ""; - type = types.unspecified; - }; + "istio_networking_v1alpha3_HTTPFaultInjection_Delay" = { + options = { + "httpDelayType" = mkOption { + description = ""; + type = types.unspecified; + }; - "percent" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "percent" = mkOption { + description = ""; + type = types.nullOr types.int; }; + }; - config = { - "httpDelayType" = mkOverride 1002 null; + config = { + "httpDelayType" = mkOverride 1002 null; - "percent" = mkOverride 1002 null; - }; + "percent" = mkOverride 1002 null; }; + }; - "istio_networking_v1alpha3_HTTPFaultInjection_Delay_ExponentialDelay" = { - options = { - "exponentialDelay" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "protobuf_types_Duration"); - }; + "istio_networking_v1alpha3_HTTPFaultInjection_Delay_ExponentialDelay" = { + options = { + "exponentialDelay" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "protobuf_types_Duration"); }; + }; - config = { - "exponentialDelay" = mkOverride 1002 null; - }; + config = { + "exponentialDelay" = mkOverride 1002 null; }; + }; - "istio_networking_v1alpha3_HTTPFaultInjection_Delay_FixedDelay" = { - options = { - "fixedDelay" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "protobuf_types_Duration"); - }; + "istio_networking_v1alpha3_HTTPFaultInjection_Delay_FixedDelay" = { + options = { + "fixedDelay" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "protobuf_types_Duration"); }; + }; - config = { - "fixedDelay" = mkOverride 1002 null; - }; + config = { + "fixedDelay" = mkOverride 1002 null; }; + }; - "istio_networking_v1alpha3_HTTPMatchRequest" = { - options = { - "authority" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "istio_networking_v1alpha3_StringMatch"); - }; + "istio_networking_v1alpha3_HTTPMatchRequest" = { + options = { + "authority" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "istio_networking_v1alpha3_StringMatch"); + }; - "gateways" = mkOption { - description = ""; - type = types.nullOr (types.listOf types.str); - }; + "gateways" = mkOption { + description = ""; + type = types.nullOr (types.listOf types.str); + }; - "headers" = mkOption { - description = ""; - type = types.nullOr types.attrs; - }; + "headers" = mkOption { + description = ""; + type = types.nullOr types.attrs; + }; - "method" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "istio_networking_v1alpha3_StringMatch"); - }; + "method" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "istio_networking_v1alpha3_StringMatch"); + }; - "port" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "port" = mkOption { + description = ""; + type = types.nullOr types.int; + }; - "scheme" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "istio_networking_v1alpha3_StringMatch"); - }; + "scheme" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "istio_networking_v1alpha3_StringMatch"); + }; - "sourceLabels" = mkOption { - description = ""; - type = types.nullOr (types.attrsOf types.str); - }; + "sourceLabels" = mkOption { + description = ""; + type = types.nullOr (types.attrsOf types.str); + }; - "uri" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "istio_networking_v1alpha3_StringMatch"); - }; + "uri" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "istio_networking_v1alpha3_StringMatch"); }; + }; - config = { - "authority" = mkOverride 1002 null; + config = { + "authority" = mkOverride 1002 null; - "gateways" = mkOverride 1002 null; + "gateways" = mkOverride 1002 null; - "headers" = mkOverride 1002 null; + "headers" = mkOverride 1002 null; - "method" = mkOverride 1002 null; + "method" = mkOverride 1002 null; - "port" = mkOverride 1002 null; + "port" = mkOverride 1002 null; - "scheme" = mkOverride 1002 null; + "scheme" = mkOverride 1002 null; - "sourceLabels" = mkOverride 1002 null; + "sourceLabels" = mkOverride 1002 null; - "uri" = mkOverride 1002 null; - }; + "uri" = mkOverride 1002 null; }; + }; - "istio_networking_v1alpha3_HTTPRedirect" = { - options = { - "authority" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "istio_networking_v1alpha3_HTTPRedirect" = { + options = { + "authority" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "uri" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "uri" = mkOption { + description = ""; + type = types.nullOr types.str; }; + }; - config = { - "authority" = mkOverride 1002 null; + config = { + "authority" = mkOverride 1002 null; - "uri" = mkOverride 1002 null; - }; + "uri" = mkOverride 1002 null; }; + }; - "istio_networking_v1alpha3_HTTPRetry" = { - options = { - "attempts" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "istio_networking_v1alpha3_HTTPRetry" = { + options = { + "attempts" = mkOption { + description = ""; + type = types.nullOr types.int; + }; - "perTryTimeout" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "protobuf_types_Duration"); - }; + "perTryTimeout" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "protobuf_types_Duration"); }; + }; - config = { - "attempts" = mkOverride 1002 null; + config = { + "attempts" = mkOverride 1002 null; - "perTryTimeout" = mkOverride 1002 null; - }; + "perTryTimeout" = mkOverride 1002 null; }; + }; - "istio_networking_v1alpha3_HTTPRewrite" = { - options = { - "authority" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "istio_networking_v1alpha3_HTTPRewrite" = { + options = { + "authority" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "uri" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "uri" = mkOption { + description = ""; + type = types.nullOr types.str; }; + }; - config = { - "authority" = mkOverride 1002 null; + config = { + "authority" = mkOverride 1002 null; - "uri" = mkOverride 1002 null; - }; + "uri" = mkOverride 1002 null; }; + }; - "istio_networking_v1alpha3_HTTPRoute" = { - options = { - "appendHeaders" = mkOption { - description = ""; - type = types.nullOr (types.attrsOf types.str); - }; + "istio_networking_v1alpha3_HTTPRoute" = { + options = { + "appendHeaders" = mkOption { + description = ""; + type = types.nullOr (types.attrsOf types.str); + }; - "corsPolicy" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "istio_networking_v1alpha3_CorsPolicy"); - }; + "corsPolicy" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "istio_networking_v1alpha3_CorsPolicy"); + }; - "fault" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "istio_networking_v1alpha3_HTTPFaultInjection"); - }; + "fault" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "istio_networking_v1alpha3_HTTPFaultInjection"); + }; - "match" = mkOption { - description = ""; - type = types.nullOr (types.listOf (submoduleOf "istio_networking_v1alpha3_HTTPMatchRequest")); - }; + "match" = mkOption { + description = ""; + type = types.nullOr (types.listOf (submoduleOf "istio_networking_v1alpha3_HTTPMatchRequest")); + }; - "mirror" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "istio_networking_v1alpha3_Destination"); - }; + "mirror" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "istio_networking_v1alpha3_Destination"); + }; - "redirect" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "istio_networking_v1alpha3_HTTPRedirect"); - }; + "redirect" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "istio_networking_v1alpha3_HTTPRedirect"); + }; - "removeResponseHeaders" = mkOption { - description = ""; - type = types.nullOr (types.listOf types.str); - }; + "removeResponseHeaders" = mkOption { + description = ""; + type = types.nullOr (types.listOf types.str); + }; - "retries" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "istio_networking_v1alpha3_HTTPRetry"); - }; + "retries" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "istio_networking_v1alpha3_HTTPRetry"); + }; - "rewrite" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "istio_networking_v1alpha3_HTTPRewrite"); - }; + "rewrite" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "istio_networking_v1alpha3_HTTPRewrite"); + }; - "route" = mkOption { - description = ""; - type = types.nullOr (types.listOf (submoduleOf "istio_networking_v1alpha3_DestinationWeight")); - }; + "route" = mkOption { + description = ""; + type = types.nullOr (types.listOf (submoduleOf "istio_networking_v1alpha3_DestinationWeight")); + }; - "timeout" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "protobuf_types_Duration"); - }; + "timeout" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "protobuf_types_Duration"); + }; - "websocketUpgrade" = mkOption { - description = ""; - type = types.nullOr types.bool; - }; + "websocketUpgrade" = mkOption { + description = ""; + type = types.nullOr types.bool; }; + }; - config = { - "appendHeaders" = mkOverride 1002 null; + config = { + "appendHeaders" = mkOverride 1002 null; - "corsPolicy" = mkOverride 1002 null; + "corsPolicy" = mkOverride 1002 null; - "fault" = mkOverride 1002 null; + "fault" = mkOverride 1002 null; - "match" = mkOverride 1002 null; + "match" = mkOverride 1002 null; - "mirror" = mkOverride 1002 null; + "mirror" = mkOverride 1002 null; - "redirect" = mkOverride 1002 null; + "redirect" = mkOverride 1002 null; - "removeResponseHeaders" = mkOverride 1002 null; + "removeResponseHeaders" = mkOverride 1002 null; - "retries" = mkOverride 1002 null; + "retries" = mkOverride 1002 null; - "rewrite" = mkOverride 1002 null; + "rewrite" = mkOverride 1002 null; - "route" = mkOverride 1002 null; + "route" = mkOverride 1002 null; - "timeout" = mkOverride 1002 null; + "timeout" = mkOverride 1002 null; - "websocketUpgrade" = mkOverride 1002 null; - }; + "websocketUpgrade" = mkOverride 1002 null; }; + }; - "istio_networking_v1alpha3_L4MatchAttributes" = { - options = { - "destinationSubnets" = mkOption { - description = ""; - type = types.nullOr (types.listOf types.str); - }; + "istio_networking_v1alpha3_L4MatchAttributes" = { + options = { + "destinationSubnets" = mkOption { + description = ""; + type = types.nullOr (types.listOf types.str); + }; - "gateways" = mkOption { - description = ""; - type = types.nullOr (types.listOf types.str); - }; + "gateways" = mkOption { + description = ""; + type = types.nullOr (types.listOf types.str); + }; - "port" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "port" = mkOption { + description = ""; + type = types.nullOr types.int; + }; - "sourceLabels" = mkOption { - description = ""; - type = types.nullOr (types.attrsOf types.str); - }; + "sourceLabels" = mkOption { + description = ""; + type = types.nullOr (types.attrsOf types.str); + }; - "sourceSubnet" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "sourceSubnet" = mkOption { + description = ""; + type = types.nullOr types.str; }; + }; - config = { - "destinationSubnets" = mkOverride 1002 null; + config = { + "destinationSubnets" = mkOverride 1002 null; - "gateways" = mkOverride 1002 null; + "gateways" = mkOverride 1002 null; - "port" = mkOverride 1002 null; + "port" = mkOverride 1002 null; - "sourceLabels" = mkOverride 1002 null; + "sourceLabels" = mkOverride 1002 null; - "sourceSubnet" = mkOverride 1002 null; - }; + "sourceSubnet" = mkOverride 1002 null; }; + }; - "istio_networking_v1alpha3_LoadBalancerSettings" = { - options = { - "lbPolicy" = mkOption { - description = ""; - type = types.unspecified; - }; + "istio_networking_v1alpha3_LoadBalancerSettings" = { + options = { + "lbPolicy" = mkOption { + description = ""; + type = types.unspecified; }; + }; - config = { - "lbPolicy" = mkOverride 1002 null; - }; + config = { + "lbPolicy" = mkOverride 1002 null; }; + }; - "istio_networking_v1alpha3_LoadBalancerSettings_ConsistentHash" = { - options = { - "consistentHash" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "istio_networking_v1alpha3_LoadBalancerSettings_ConsistentHashLB"); - }; + "istio_networking_v1alpha3_LoadBalancerSettings_ConsistentHash" = { + options = { + "consistentHash" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "istio_networking_v1alpha3_LoadBalancerSettings_ConsistentHashLB"); }; + }; - config = { - "consistentHash" = mkOverride 1002 null; - }; + config = { + "consistentHash" = mkOverride 1002 null; }; + }; - "istio_networking_v1alpha3_LoadBalancerSettings_ConsistentHashLB" = { - options = { - "hashKey" = mkOption { - description = ""; - type = types.unspecified; - }; + "istio_networking_v1alpha3_LoadBalancerSettings_ConsistentHashLB" = { + options = { + "hashKey" = mkOption { + description = ""; + type = types.unspecified; + }; - "minimumRingSize" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "minimumRingSize" = mkOption { + description = ""; + type = types.nullOr types.int; }; + }; - config = { - "hashKey" = mkOverride 1002 null; + config = { + "hashKey" = mkOverride 1002 null; - "minimumRingSize" = mkOverride 1002 null; - }; + "minimumRingSize" = mkOverride 1002 null; }; + }; - "istio_networking_v1alpha3_LoadBalancerSettings_ConsistentHashLB_HTTPCookie" = { - options = { - "name" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "istio_networking_v1alpha3_LoadBalancerSettings_ConsistentHashLB_HTTPCookie" = { + options = { + "name" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "path" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "path" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "ttl" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "ttl" = mkOption { + description = ""; + type = types.nullOr types.int; }; + }; - config = { - "name" = mkOverride 1002 null; + config = { + "name" = mkOverride 1002 null; - "path" = mkOverride 1002 null; + "path" = mkOverride 1002 null; - "ttl" = mkOverride 1002 null; - }; + "ttl" = mkOverride 1002 null; }; + }; - "istio_networking_v1alpha3_LoadBalancerSettings_ConsistentHashLB_HttpCookie" = { - options = { - "httpCookie" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "istio_networking_v1alpha3_LoadBalancerSettings_ConsistentHashLB_HTTPCookie"); - }; + "istio_networking_v1alpha3_LoadBalancerSettings_ConsistentHashLB_HttpCookie" = { + options = { + "httpCookie" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "istio_networking_v1alpha3_LoadBalancerSettings_ConsistentHashLB_HTTPCookie"); }; + }; - config = { - "httpCookie" = mkOverride 1002 null; - }; + config = { + "httpCookie" = mkOverride 1002 null; }; + }; - "istio_networking_v1alpha3_LoadBalancerSettings_ConsistentHashLB_HttpHeaderName" = { - options = { - "httpHeaderName" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "istio_networking_v1alpha3_LoadBalancerSettings_ConsistentHashLB_HttpHeaderName" = { + options = { + "httpHeaderName" = mkOption { + description = ""; + type = types.nullOr types.str; }; + }; - config = { - "httpHeaderName" = mkOverride 1002 null; - }; + config = { + "httpHeaderName" = mkOverride 1002 null; }; + }; - "istio_networking_v1alpha3_LoadBalancerSettings_ConsistentHashLB_UseSourceIp" = { - options = { - "useSourceIp" = mkOption { - description = ""; - type = types.nullOr types.bool; - }; + "istio_networking_v1alpha3_LoadBalancerSettings_ConsistentHashLB_UseSourceIp" = { + options = { + "useSourceIp" = mkOption { + description = ""; + type = types.nullOr types.bool; }; + }; - config = { - "useSourceIp" = mkOverride 1002 null; - }; + config = { + "useSourceIp" = mkOverride 1002 null; }; + }; - "istio_networking_v1alpha3_LoadBalancerSettings_Simple" = { - options = { - "simple" = mkOption { - description = ""; - type = types.unspecified; - }; + "istio_networking_v1alpha3_LoadBalancerSettings_Simple" = { + options = { + "simple" = mkOption { + description = ""; + type = types.unspecified; }; + }; - config = { - "simple" = mkOverride 1002 null; - }; + config = { + "simple" = mkOverride 1002 null; }; + }; - "istio_networking_v1alpha3_OutlierDetection" = { - options = { - "baseEjectionTime" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "protobuf_types_Duration"); - }; + "istio_networking_v1alpha3_OutlierDetection" = { + options = { + "baseEjectionTime" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "protobuf_types_Duration"); + }; - "consecutiveErrors" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "consecutiveErrors" = mkOption { + description = ""; + type = types.nullOr types.int; + }; - "interval" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "protobuf_types_Duration"); - }; + "interval" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "protobuf_types_Duration"); + }; - "maxEjectionPercent" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "maxEjectionPercent" = mkOption { + description = ""; + type = types.nullOr types.int; }; + }; - config = { - "baseEjectionTime" = mkOverride 1002 null; + config = { + "baseEjectionTime" = mkOverride 1002 null; - "consecutiveErrors" = mkOverride 1002 null; + "consecutiveErrors" = mkOverride 1002 null; - "interval" = mkOverride 1002 null; + "interval" = mkOverride 1002 null; - "maxEjectionPercent" = mkOverride 1002 null; - }; + "maxEjectionPercent" = mkOverride 1002 null; }; + }; - "istio_networking_v1alpha3_Port" = { - options = { - "name" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "istio_networking_v1alpha3_Port" = { + options = { + "name" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "number" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "number" = mkOption { + description = ""; + type = types.nullOr types.int; + }; - "protocol" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "protocol" = mkOption { + description = ""; + type = types.nullOr types.str; }; + }; - config = { - "name" = mkOverride 1002 null; + config = { + "name" = mkOverride 1002 null; - "number" = mkOverride 1002 null; + "number" = mkOverride 1002 null; - "protocol" = mkOverride 1002 null; - }; + "protocol" = mkOverride 1002 null; }; + }; - "istio_networking_v1alpha3_PortSelector" = { - options = { - "port" = mkOption { - description = ""; - type = types.unspecified; - }; + "istio_networking_v1alpha3_PortSelector" = { + options = { + "port" = mkOption { + description = ""; + type = types.unspecified; }; + }; - config = { - "port" = mkOverride 1002 null; - }; + config = { + "port" = mkOverride 1002 null; }; + }; - "istio_networking_v1alpha3_PortSelector_Name" = { - options = { - "name" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "istio_networking_v1alpha3_PortSelector_Name" = { + options = { + "name" = mkOption { + description = ""; + type = types.nullOr types.str; }; + }; - config = { - "name" = mkOverride 1002 null; - }; + config = { + "name" = mkOverride 1002 null; }; + }; - "istio_networking_v1alpha3_PortSelector_Number" = { - options = { - "number" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "istio_networking_v1alpha3_PortSelector_Number" = { + options = { + "number" = mkOption { + description = ""; + type = types.nullOr types.int; }; + }; - config = { - "number" = mkOverride 1002 null; - }; + config = { + "number" = mkOverride 1002 null; }; + }; - "istio_networking_v1alpha3_Server" = { - options = { - "hosts" = mkOption { - description = ""; - type = types.nullOr (types.listOf types.str); - }; + "istio_networking_v1alpha3_Server" = { + options = { + "hosts" = mkOption { + description = ""; + type = types.nullOr (types.listOf types.str); + }; - "port" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "istio_networking_v1alpha3_Port"); - }; + "port" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "istio_networking_v1alpha3_Port"); + }; - "tls" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "istio_networking_v1alpha3_Server_TLSOptions"); - }; + "tls" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "istio_networking_v1alpha3_Server_TLSOptions"); }; + }; - config = { - "hosts" = mkOverride 1002 null; + config = { + "hosts" = mkOverride 1002 null; - "port" = mkOverride 1002 null; + "port" = mkOverride 1002 null; - "tls" = mkOverride 1002 null; - }; + "tls" = mkOverride 1002 null; }; + }; - "istio_networking_v1alpha3_Server_TLSOptions" = { - options = { - "caCertificates" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "istio_networking_v1alpha3_Server_TLSOptions" = { + options = { + "caCertificates" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "httpsRedirect" = mkOption { - description = ""; - type = types.nullOr types.bool; - }; + "httpsRedirect" = mkOption { + description = ""; + type = types.nullOr types.bool; + }; - "mode" = mkOption { - description = ""; - type = types.unspecified; - }; + "mode" = mkOption { + description = ""; + type = types.unspecified; + }; - "privateKey" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "privateKey" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "serverCertificate" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "serverCertificate" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "subjectAltNames" = mkOption { - description = ""; - type = types.nullOr (types.listOf types.str); - }; + "subjectAltNames" = mkOption { + description = ""; + type = types.nullOr (types.listOf types.str); }; + }; - config = { - "caCertificates" = mkOverride 1002 null; + config = { + "caCertificates" = mkOverride 1002 null; - "httpsRedirect" = mkOverride 1002 null; + "httpsRedirect" = mkOverride 1002 null; - "mode" = mkOverride 1002 null; + "mode" = mkOverride 1002 null; - "privateKey" = mkOverride 1002 null; + "privateKey" = mkOverride 1002 null; - "serverCertificate" = mkOverride 1002 null; + "serverCertificate" = mkOverride 1002 null; - "subjectAltNames" = mkOverride 1002 null; - }; + "subjectAltNames" = mkOverride 1002 null; }; + }; - "istio_networking_v1alpha3_ServiceEntry" = { - options = { - "addresses" = mkOption { - description = ""; - type = types.nullOr (types.listOf types.str); - }; + "istio_networking_v1alpha3_ServiceEntry" = { + options = { + "addresses" = mkOption { + description = ""; + type = types.nullOr (types.listOf types.str); + }; - "endpoints" = mkOption { - description = ""; - type = types.nullOr (types.listOf (submoduleOf "istio_networking_v1alpha3_ServiceEntry_Endpoint")); - }; + "endpoints" = mkOption { + description = ""; + type = types.nullOr (types.listOf (submoduleOf "istio_networking_v1alpha3_ServiceEntry_Endpoint")); + }; - "hosts" = mkOption { - description = ""; - type = types.nullOr (types.listOf types.str); - }; + "hosts" = mkOption { + description = ""; + type = types.nullOr (types.listOf types.str); + }; - "location" = mkOption { - description = ""; - type = types.unspecified; - }; + "location" = mkOption { + description = ""; + type = types.unspecified; + }; - "ports" = mkOption { - description = ""; - type = types.nullOr (types.listOf (submoduleOf "istio_networking_v1alpha3_Port")); - }; + "ports" = mkOption { + description = ""; + type = types.nullOr (types.listOf (submoduleOf "istio_networking_v1alpha3_Port")); + }; - "resolution" = mkOption { - description = ""; - type = types.unspecified; - }; + "resolution" = mkOption { + description = ""; + type = types.unspecified; }; + }; - config = { - "addresses" = mkOverride 1002 null; + config = { + "addresses" = mkOverride 1002 null; - "endpoints" = mkOverride 1002 null; + "endpoints" = mkOverride 1002 null; - "hosts" = mkOverride 1002 null; + "hosts" = mkOverride 1002 null; - "location" = mkOverride 1002 null; + "location" = mkOverride 1002 null; - "ports" = mkOverride 1002 null; + "ports" = mkOverride 1002 null; - "resolution" = mkOverride 1002 null; - }; + "resolution" = mkOverride 1002 null; }; + }; - "istio_networking_v1alpha3_ServiceEntry_Endpoint" = { - options = { - "address" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "istio_networking_v1alpha3_ServiceEntry_Endpoint" = { + options = { + "address" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "labels" = mkOption { - description = ""; - type = types.nullOr (types.attrsOf types.str); - }; + "labels" = mkOption { + description = ""; + type = types.nullOr (types.attrsOf types.str); + }; - "ports" = mkOption { - description = ""; - type = types.nullOr (types.attrsOf types.int); - }; + "ports" = mkOption { + description = ""; + type = types.nullOr (types.attrsOf types.int); }; + }; - config = { - "address" = mkOverride 1002 null; + config = { + "address" = mkOverride 1002 null; - "labels" = mkOverride 1002 null; + "labels" = mkOverride 1002 null; - "ports" = mkOverride 1002 null; - }; + "ports" = mkOverride 1002 null; }; + }; - "istio_networking_v1alpha3_StringMatch" = { - options = { - "matchType" = mkOption { - description = ""; - type = types.unspecified; - }; + "istio_networking_v1alpha3_StringMatch" = { + options = { + "matchType" = mkOption { + description = ""; + type = types.unspecified; }; + }; - config = { - "matchType" = mkOverride 1002 null; - }; + config = { + "matchType" = mkOverride 1002 null; }; + }; - "istio_networking_v1alpha3_StringMatch_Exact" = { - options = { - "exact" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "istio_networking_v1alpha3_StringMatch_Exact" = { + options = { + "exact" = mkOption { + description = ""; + type = types.nullOr types.str; }; + }; - config = { - "exact" = mkOverride 1002 null; - }; + config = { + "exact" = mkOverride 1002 null; }; + }; - "istio_networking_v1alpha3_StringMatch_Prefix" = { - options = { - "prefix" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "istio_networking_v1alpha3_StringMatch_Prefix" = { + options = { + "prefix" = mkOption { + description = ""; + type = types.nullOr types.str; }; + }; - config = { - "prefix" = mkOverride 1002 null; - }; + config = { + "prefix" = mkOverride 1002 null; }; + }; - "istio_networking_v1alpha3_StringMatch_Regex" = { - options = { - "regex" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "istio_networking_v1alpha3_StringMatch_Regex" = { + options = { + "regex" = mkOption { + description = ""; + type = types.nullOr types.str; }; + }; - config = { - "regex" = mkOverride 1002 null; - }; + config = { + "regex" = mkOverride 1002 null; }; + }; - "istio_networking_v1alpha3_Subset" = { - options = { - "labels" = mkOption { - description = ""; - type = types.nullOr (types.attrsOf types.str); - }; + "istio_networking_v1alpha3_Subset" = { + options = { + "labels" = mkOption { + description = ""; + type = types.nullOr (types.attrsOf types.str); + }; - "name" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "name" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "trafficPolicy" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "istio_networking_v1alpha3_TrafficPolicy"); - }; + "trafficPolicy" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "istio_networking_v1alpha3_TrafficPolicy"); }; + }; - config = { - "labels" = mkOverride 1002 null; + config = { + "labels" = mkOverride 1002 null; - "name" = mkOverride 1002 null; + "name" = mkOverride 1002 null; - "trafficPolicy" = mkOverride 1002 null; - }; + "trafficPolicy" = mkOverride 1002 null; }; + }; - "istio_networking_v1alpha3_TCPRoute" = { - options = { - "match" = mkOption { - description = ""; - type = types.nullOr (types.listOf (submoduleOf "istio_networking_v1alpha3_L4MatchAttributes")); - }; + "istio_networking_v1alpha3_TCPRoute" = { + options = { + "match" = mkOption { + description = ""; + type = types.nullOr (types.listOf (submoduleOf "istio_networking_v1alpha3_L4MatchAttributes")); + }; - "route" = mkOption { - description = ""; - type = types.nullOr (types.listOf (submoduleOf "istio_networking_v1alpha3_DestinationWeight")); - }; + "route" = mkOption { + description = ""; + type = types.nullOr (types.listOf (submoduleOf "istio_networking_v1alpha3_DestinationWeight")); }; + }; - config = { - "match" = mkOverride 1002 null; + config = { + "match" = mkOverride 1002 null; - "route" = mkOverride 1002 null; - }; + "route" = mkOverride 1002 null; }; + }; - "istio_networking_v1alpha3_TLSMatchAttributes" = { - options = { - "destinationSubnets" = mkOption { - description = ""; - type = types.nullOr (types.listOf types.str); - }; + "istio_networking_v1alpha3_TLSMatchAttributes" = { + options = { + "destinationSubnets" = mkOption { + description = ""; + type = types.nullOr (types.listOf types.str); + }; - "gateways" = mkOption { - description = ""; - type = types.nullOr (types.listOf types.str); - }; + "gateways" = mkOption { + description = ""; + type = types.nullOr (types.listOf types.str); + }; - "port" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "port" = mkOption { + description = ""; + type = types.nullOr types.int; + }; - "sniHosts" = mkOption { - description = ""; - type = types.nullOr (types.listOf types.str); - }; + "sniHosts" = mkOption { + description = ""; + type = types.nullOr (types.listOf types.str); + }; - "sourceLabels" = mkOption { - description = ""; - type = types.nullOr (types.attrsOf types.str); - }; + "sourceLabels" = mkOption { + description = ""; + type = types.nullOr (types.attrsOf types.str); + }; - "sourceSubnet" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "sourceSubnet" = mkOption { + description = ""; + type = types.nullOr types.str; }; + }; - config = { - "destinationSubnets" = mkOverride 1002 null; + config = { + "destinationSubnets" = mkOverride 1002 null; - "gateways" = mkOverride 1002 null; + "gateways" = mkOverride 1002 null; - "port" = mkOverride 1002 null; + "port" = mkOverride 1002 null; - "sniHosts" = mkOverride 1002 null; + "sniHosts" = mkOverride 1002 null; - "sourceLabels" = mkOverride 1002 null; + "sourceLabels" = mkOverride 1002 null; - "sourceSubnet" = mkOverride 1002 null; - }; + "sourceSubnet" = mkOverride 1002 null; }; + }; - "istio_networking_v1alpha3_TLSRoute" = { - options = { - "match" = mkOption { - description = ""; - type = types.nullOr (types.listOf (submoduleOf "istio_networking_v1alpha3_TLSMatchAttributes")); - }; + "istio_networking_v1alpha3_TLSRoute" = { + options = { + "match" = mkOption { + description = ""; + type = types.nullOr (types.listOf (submoduleOf "istio_networking_v1alpha3_TLSMatchAttributes")); + }; - "route" = mkOption { - description = ""; - type = types.nullOr (types.listOf (submoduleOf "istio_networking_v1alpha3_DestinationWeight")); - }; + "route" = mkOption { + description = ""; + type = types.nullOr (types.listOf (submoduleOf "istio_networking_v1alpha3_DestinationWeight")); }; + }; - config = { - "match" = mkOverride 1002 null; + config = { + "match" = mkOverride 1002 null; - "route" = mkOverride 1002 null; - }; + "route" = mkOverride 1002 null; }; + }; - "istio_networking_v1alpha3_TLSSettings" = { - options = { - "caCertificates" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "istio_networking_v1alpha3_TLSSettings" = { + options = { + "caCertificates" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "clientCertificate" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "clientCertificate" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "mode" = mkOption { - description = ""; - type = types.unspecified; - }; + "mode" = mkOption { + description = ""; + type = types.unspecified; + }; - "privateKey" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "privateKey" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "sni" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "sni" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "subjectAltNames" = mkOption { - description = ""; - type = types.nullOr (types.listOf types.str); - }; + "subjectAltNames" = mkOption { + description = ""; + type = types.nullOr (types.listOf types.str); }; + }; - config = { - "caCertificates" = mkOverride 1002 null; + config = { + "caCertificates" = mkOverride 1002 null; - "clientCertificate" = mkOverride 1002 null; + "clientCertificate" = mkOverride 1002 null; - "mode" = mkOverride 1002 null; + "mode" = mkOverride 1002 null; - "privateKey" = mkOverride 1002 null; + "privateKey" = mkOverride 1002 null; - "sni" = mkOverride 1002 null; + "sni" = mkOverride 1002 null; - "subjectAltNames" = mkOverride 1002 null; - }; + "subjectAltNames" = mkOverride 1002 null; }; + }; - "istio_networking_v1alpha3_TrafficPolicy" = { - options = { - "connectionPool" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "istio_networking_v1alpha3_ConnectionPoolSettings"); - }; + "istio_networking_v1alpha3_TrafficPolicy" = { + options = { + "connectionPool" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "istio_networking_v1alpha3_ConnectionPoolSettings"); + }; - "loadBalancer" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "istio_networking_v1alpha3_LoadBalancerSettings"); - }; + "loadBalancer" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "istio_networking_v1alpha3_LoadBalancerSettings"); + }; - "outlierDetection" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "istio_networking_v1alpha3_OutlierDetection"); - }; + "outlierDetection" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "istio_networking_v1alpha3_OutlierDetection"); + }; - "portLevelSettings" = mkOption { - description = ""; - type = types.nullOr (types.listOf (submoduleOf "istio_networking_v1alpha3_TrafficPolicy_PortTrafficPolicy")); - }; + "portLevelSettings" = mkOption { + description = ""; + type = types.nullOr (types.listOf (submoduleOf "istio_networking_v1alpha3_TrafficPolicy_PortTrafficPolicy")); + }; - "tls" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "istio_networking_v1alpha3_TLSSettings"); - }; + "tls" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "istio_networking_v1alpha3_TLSSettings"); }; + }; - config = { - "connectionPool" = mkOverride 1002 null; + config = { + "connectionPool" = mkOverride 1002 null; - "loadBalancer" = mkOverride 1002 null; + "loadBalancer" = mkOverride 1002 null; - "outlierDetection" = mkOverride 1002 null; + "outlierDetection" = mkOverride 1002 null; - "portLevelSettings" = mkOverride 1002 null; + "portLevelSettings" = mkOverride 1002 null; - "tls" = mkOverride 1002 null; - }; + "tls" = mkOverride 1002 null; }; + }; - "istio_networking_v1alpha3_TrafficPolicy_PortTrafficPolicy" = { - options = { - "connectionPool" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "istio_networking_v1alpha3_ConnectionPoolSettings"); - }; + "istio_networking_v1alpha3_TrafficPolicy_PortTrafficPolicy" = { + options = { + "connectionPool" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "istio_networking_v1alpha3_ConnectionPoolSettings"); + }; - "loadBalancer" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "istio_networking_v1alpha3_LoadBalancerSettings"); - }; + "loadBalancer" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "istio_networking_v1alpha3_LoadBalancerSettings"); + }; - "outlierDetection" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "istio_networking_v1alpha3_OutlierDetection"); - }; + "outlierDetection" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "istio_networking_v1alpha3_OutlierDetection"); + }; - "port" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "istio_networking_v1alpha3_PortSelector"); - }; + "port" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "istio_networking_v1alpha3_PortSelector"); + }; - "tls" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "istio_networking_v1alpha3_TLSSettings"); - }; + "tls" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "istio_networking_v1alpha3_TLSSettings"); }; + }; - config = { - "connectionPool" = mkOverride 1002 null; + config = { + "connectionPool" = mkOverride 1002 null; - "loadBalancer" = mkOverride 1002 null; + "loadBalancer" = mkOverride 1002 null; - "outlierDetection" = mkOverride 1002 null; + "outlierDetection" = mkOverride 1002 null; - "port" = mkOverride 1002 null; + "port" = mkOverride 1002 null; - "tls" = mkOverride 1002 null; - }; + "tls" = mkOverride 1002 null; }; + }; - "istio_networking_v1alpha3_VirtualService" = { - options = { - "gateways" = mkOption { - description = ""; - type = types.nullOr (types.listOf types.str); - }; + "istio_networking_v1alpha3_VirtualService" = { + options = { + "gateways" = mkOption { + description = ""; + type = types.nullOr (types.listOf types.str); + }; - "hosts" = mkOption { - description = ""; - type = types.nullOr (types.listOf types.str); - }; + "hosts" = mkOption { + description = ""; + type = types.nullOr (types.listOf types.str); + }; - "http" = mkOption { - description = ""; - type = types.nullOr (types.listOf (submoduleOf "istio_networking_v1alpha3_HTTPRoute")); - }; + "http" = mkOption { + description = ""; + type = types.nullOr (types.listOf (submoduleOf "istio_networking_v1alpha3_HTTPRoute")); + }; - "tcp" = mkOption { - description = ""; - type = types.nullOr (types.listOf (submoduleOf "istio_networking_v1alpha3_TCPRoute")); - }; + "tcp" = mkOption { + description = ""; + type = types.nullOr (types.listOf (submoduleOf "istio_networking_v1alpha3_TCPRoute")); + }; - "tls" = mkOption { - description = ""; - type = types.nullOr (types.listOf (submoduleOf "istio_networking_v1alpha3_TLSRoute")); - }; + "tls" = mkOption { + description = ""; + type = types.nullOr (types.listOf (submoduleOf "istio_networking_v1alpha3_TLSRoute")); }; + }; - config = { - "gateways" = mkOverride 1002 null; + config = { + "gateways" = mkOverride 1002 null; - "hosts" = mkOverride 1002 null; + "hosts" = mkOverride 1002 null; - "http" = mkOverride 1002 null; + "http" = mkOverride 1002 null; - "tcp" = mkOverride 1002 null; + "tcp" = mkOverride 1002 null; - "tls" = mkOverride 1002 null; - }; + "tls" = mkOverride 1002 null; }; + }; - "istio_policy_v1beta1_Action" = { - options = { - "handler" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "istio_policy_v1beta1_Action" = { + options = { + "handler" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "instances" = mkOption { - description = ""; - type = types.nullOr (types.listOf types.str); - }; + "instances" = mkOption { + description = ""; + type = types.nullOr (types.listOf types.str); }; + }; - config = { - "handler" = mkOverride 1002 null; + config = { + "handler" = mkOverride 1002 null; - "instances" = mkOverride 1002 null; - }; + "instances" = mkOverride 1002 null; }; + }; - "istio_policy_v1beta1_Rule" = { - options = { - "actions" = mkOption { - description = ""; - type = types.nullOr (types.listOf (submoduleOf "istio_policy_v1beta1_Action")); - }; + "istio_policy_v1beta1_Rule" = { + options = { + "actions" = mkOption { + description = ""; + type = types.nullOr (types.listOf (submoduleOf "istio_policy_v1beta1_Action")); + }; - "match" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "match" = mkOption { + description = ""; + type = types.nullOr types.str; }; + }; - config = { - "actions" = mkOverride 1002 null; + config = { + "actions" = mkOverride 1002 null; - "match" = mkOverride 1002 null; - }; + "match" = mkOverride 1002 null; }; + }; - "istio_policy_v1beta1_TimeStamp" = { - options = { - "value" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "protobuf_types_Timestamp"); - }; + "istio_policy_v1beta1_TimeStamp" = { + options = { + "value" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "protobuf_types_Timestamp"); }; + }; - config = { - "value" = mkOverride 1002 null; - }; + config = { + "value" = mkOverride 1002 null; }; + }; - "istio_policy_v1beta1_Value" = { - options = { - "value" = mkOption { - description = ""; - type = types.unspecified; - }; + "istio_policy_v1beta1_Value" = { + options = { + "value" = mkOption { + description = ""; + type = types.unspecified; }; + }; - config = { - "value" = mkOverride 1002 null; - }; + config = { + "value" = mkOverride 1002 null; }; + }; - "istio_rbac_v1alpha1_AccessRule" = { - options = { - "constraints" = mkOption { - description = ""; - type = types.nullOr (types.listOf (submoduleOf "istio_rbac_v1alpha1_AccessRule_Constraint")); - }; + "istio_rbac_v1alpha1_AccessRule" = { + options = { + "constraints" = mkOption { + description = ""; + type = types.nullOr (types.listOf (submoduleOf "istio_rbac_v1alpha1_AccessRule_Constraint")); + }; - "methods" = mkOption { - description = ""; - type = types.nullOr (types.listOf types.str); - }; + "methods" = mkOption { + description = ""; + type = types.nullOr (types.listOf types.str); + }; - "paths" = mkOption { - description = ""; - type = types.nullOr (types.listOf types.str); - }; + "paths" = mkOption { + description = ""; + type = types.nullOr (types.listOf types.str); + }; - "services" = mkOption { - description = ""; - type = types.nullOr (types.listOf types.str); - }; + "services" = mkOption { + description = ""; + type = types.nullOr (types.listOf types.str); }; + }; - config = { - "constraints" = mkOverride 1002 null; + config = { + "constraints" = mkOverride 1002 null; - "methods" = mkOverride 1002 null; + "methods" = mkOverride 1002 null; - "paths" = mkOverride 1002 null; + "paths" = mkOverride 1002 null; - "services" = mkOverride 1002 null; - }; + "services" = mkOverride 1002 null; }; + }; - "istio_rbac_v1alpha1_AccessRule_Constraint" = { - options = { - "key" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "istio_rbac_v1alpha1_AccessRule_Constraint" = { + options = { + "key" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "values" = mkOption { - description = ""; - type = types.nullOr (types.listOf types.str); - }; + "values" = mkOption { + description = ""; + type = types.nullOr (types.listOf types.str); }; + }; - config = { - "key" = mkOverride 1002 null; + config = { + "key" = mkOverride 1002 null; - "values" = mkOverride 1002 null; - }; + "values" = mkOverride 1002 null; }; + }; - "istio_rbac_v1alpha1_RbacConfig" = { - options = { - "exclusion" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "istio_rbac_v1alpha1_RbacConfig_Target"); - }; + "istio_rbac_v1alpha1_RbacConfig" = { + options = { + "exclusion" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "istio_rbac_v1alpha1_RbacConfig_Target"); + }; - "inclusion" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "istio_rbac_v1alpha1_RbacConfig_Target"); - }; + "inclusion" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "istio_rbac_v1alpha1_RbacConfig_Target"); + }; - "mode" = mkOption { - description = ""; - type = types.unspecified; - }; + "mode" = mkOption { + description = ""; + type = types.unspecified; }; + }; - config = { - "exclusion" = mkOverride 1002 null; + config = { + "exclusion" = mkOverride 1002 null; - "inclusion" = mkOverride 1002 null; + "inclusion" = mkOverride 1002 null; - "mode" = mkOverride 1002 null; - }; + "mode" = mkOverride 1002 null; }; + }; - "istio_rbac_v1alpha1_RbacConfig_Target" = { - options = { - "namespaces" = mkOption { - description = ""; - type = types.nullOr (types.listOf types.str); - }; + "istio_rbac_v1alpha1_RbacConfig_Target" = { + options = { + "namespaces" = mkOption { + description = ""; + type = types.nullOr (types.listOf types.str); + }; - "services" = mkOption { - description = ""; - type = types.nullOr (types.listOf types.str); - }; + "services" = mkOption { + description = ""; + type = types.nullOr (types.listOf types.str); }; + }; - config = { - "namespaces" = mkOverride 1002 null; + config = { + "namespaces" = mkOverride 1002 null; - "services" = mkOverride 1002 null; - }; + "services" = mkOverride 1002 null; }; + }; - "istio_rbac_v1alpha1_RoleRef" = { - options = { - "kind" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "istio_rbac_v1alpha1_RoleRef" = { + options = { + "kind" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "name" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "name" = mkOption { + description = ""; + type = types.nullOr types.str; }; + }; - config = { - "kind" = mkOverride 1002 null; + config = { + "kind" = mkOverride 1002 null; - "name" = mkOverride 1002 null; - }; + "name" = mkOverride 1002 null; }; + }; - "istio_rbac_v1alpha1_ServiceRole" = { - options = { - "rules" = mkOption { - description = ""; - type = types.nullOr (types.listOf (submoduleOf "istio_rbac_v1alpha1_AccessRule")); - }; + "istio_rbac_v1alpha1_ServiceRole" = { + options = { + "rules" = mkOption { + description = ""; + type = types.nullOr (types.listOf (submoduleOf "istio_rbac_v1alpha1_AccessRule")); }; + }; - config = { - "rules" = mkOverride 1002 null; - }; + config = { + "rules" = mkOverride 1002 null; }; + }; - "istio_rbac_v1alpha1_ServiceRoleBinding" = { - options = { - "mode" = mkOption { - description = ""; - type = types.unspecified; - }; + "istio_rbac_v1alpha1_ServiceRoleBinding" = { + options = { + "mode" = mkOption { + description = ""; + type = types.unspecified; + }; - "roleRef" = mkOption { - description = ""; - type = types.nullOr (submoduleOf "istio_rbac_v1alpha1_RoleRef"); - }; + "roleRef" = mkOption { + description = ""; + type = types.nullOr (submoduleOf "istio_rbac_v1alpha1_RoleRef"); + }; - "subjects" = mkOption { - description = ""; - type = types.nullOr (types.listOf (submoduleOf "istio_rbac_v1alpha1_Subject")); - }; + "subjects" = mkOption { + description = ""; + type = types.nullOr (types.listOf (submoduleOf "istio_rbac_v1alpha1_Subject")); }; + }; - config = { - "mode" = mkOverride 1002 null; + config = { + "mode" = mkOverride 1002 null; - "roleRef" = mkOverride 1002 null; + "roleRef" = mkOverride 1002 null; - "subjects" = mkOverride 1002 null; - }; + "subjects" = mkOverride 1002 null; }; + }; - "istio_rbac_v1alpha1_Subject" = { - options = { - "group" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "istio_rbac_v1alpha1_Subject" = { + options = { + "group" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "properties" = mkOption { - description = ""; - type = types.nullOr (types.attrsOf types.str); - }; + "properties" = mkOption { + description = ""; + type = types.nullOr (types.attrsOf types.str); + }; - "user" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "user" = mkOption { + description = ""; + type = types.nullOr types.str; }; + }; - config = { - "group" = mkOverride 1002 null; + config = { + "group" = mkOverride 1002 null; - "properties" = mkOverride 1002 null; + "properties" = mkOverride 1002 null; - "user" = mkOverride 1002 null; - }; + "user" = mkOverride 1002 null; }; + }; - "protobuf_duration_Duration" = { - options = { - "nanos" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "protobuf_duration_Duration" = { + options = { + "nanos" = mkOption { + description = ""; + type = types.nullOr types.int; + }; - "seconds" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "seconds" = mkOption { + description = ""; + type = types.nullOr types.int; }; + }; - config = { - "nanos" = mkOverride 1002 null; + config = { + "nanos" = mkOverride 1002 null; - "seconds" = mkOverride 1002 null; - }; + "seconds" = mkOverride 1002 null; }; + }; - "protobuf_types_Any" = { - options = { - "typeUrl" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "protobuf_types_Any" = { + options = { + "typeUrl" = mkOption { + description = ""; + type = types.nullOr types.str; + }; - "value" = mkOption { - description = ""; - type = types.nullOr types.str; - }; + "value" = mkOption { + description = ""; + type = types.nullOr types.str; }; + }; - config = { - "typeUrl" = mkOverride 1002 null; + config = { + "typeUrl" = mkOverride 1002 null; - "value" = mkOverride 1002 null; - }; + "value" = mkOverride 1002 null; }; + }; - "protobuf_types_BoolValue" = { - options = { - "value" = mkOption { - description = ""; - type = types.nullOr types.bool; - }; + "protobuf_types_BoolValue" = { + options = { + "value" = mkOption { + description = ""; + type = types.nullOr types.bool; }; + }; - config = { - "value" = mkOverride 1002 null; - }; + config = { + "value" = mkOverride 1002 null; }; + }; - "protobuf_types_Duration" = { - options = { - "nanos" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "protobuf_types_Duration" = { + options = { + "nanos" = mkOption { + description = ""; + type = types.nullOr types.int; + }; - "seconds" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "seconds" = mkOption { + description = ""; + type = types.nullOr types.int; }; + }; - config = { - "nanos" = mkOverride 1002 null; + config = { + "nanos" = mkOverride 1002 null; - "seconds" = mkOverride 1002 null; - }; + "seconds" = mkOverride 1002 null; }; + }; - "protobuf_types_Struct" = { - options = { - "fields" = mkOption { - description = ""; - type = types.nullOr types.attrs; - }; + "protobuf_types_Struct" = { + options = { + "fields" = mkOption { + description = ""; + type = types.nullOr types.attrs; }; + }; - config = { - "fields" = mkOverride 1002 null; - }; + config = { + "fields" = mkOverride 1002 null; }; + }; - "protobuf_types_Timestamp" = { - options = { - "nanos" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "protobuf_types_Timestamp" = { + options = { + "nanos" = mkOption { + description = ""; + type = types.nullOr types.int; + }; - "seconds" = mkOption { - description = ""; - type = types.nullOr types.int; - }; + "seconds" = mkOption { + description = ""; + type = types.nullOr types.int; }; + }; - config = { - "nanos" = mkOverride 1002 null; + config = { + "nanos" = mkOverride 1002 null; - "seconds" = mkOverride 1002 null; - }; + "seconds" = mkOverride 1002 null; }; + }; - "protobuf_types_Value" = { - options = { - "kind" = mkOption { - description = ""; - type = types.unspecified; - }; + "protobuf_types_Value" = { + options = { + "kind" = mkOption { + description = ""; + type = types.unspecified; }; + }; - config = { - "kind" = mkOverride 1002 null; - }; + config = { + "kind" = mkOverride 1002 null; }; - } - // (import ./istio-overrides.nix {inherit definitions lib;}); -in { + }; + } + // (import ./istio-overrides.nix { inherit definitions lib; }); +in +{ kubernetes.customResources = [ { group = "networking.istio.io"; diff --git a/modules/k8s.nix b/modules/k8s.nix index 2567f6d..f26677f 100644 --- a/modules/k8s.nix +++ b/modules/k8s.nix @@ -1,12 +1,5 @@ # K8S module defines kubernetes definitions for kubenix -{ - options, - config, - lib, - pkgs, - k8s, - ... -}: +{ options, config, lib, pkgs, k8s, ... }: with lib; let versions = (import ../versions.nix).versions; cfg = config.kubernetes; @@ -15,12 +8,11 @@ with lib; let getDefaults = resource: group: version: kind: catAttrs "default" (filter - ( - default: - (resource == null || default.resource == null || default.resource == resource) - && (default.group == null || default.group == group) - && (default.version == null || default.version == version) - && (default.kind == null || default.kind == kind) + (default: + (resource == null || default.resource == null || default.resource == resource) + && (default.group == null || default.group == group) + && (default.version == null || default.version == version) + && (default.kind == null || default.kind == kind) ) cfg.api.defaults); @@ -31,7 +23,7 @@ with lib; let then map moduleToAttrs value else value; - apiOptions = {config, ...}: { + apiOptions = { config, ... }: { options = { definitions = mkOption { description = "Attribute set of kubernetes definitions"; @@ -74,18 +66,17 @@ with lib; let default = mkOption { description = "Default to apply"; type = types.unspecified; - default = {}; + default = { }; }; }; })); - default = []; + default = [ ]; apply = unique; }; types = mkOption { description = "List of registered kubernetes types"; - type = - coerceListOfSubmodulesToAttrs + type = coerceListOfSubmodulesToAttrs { options = { group = mkOption { @@ -115,7 +106,7 @@ with lib; let }; } gvkKeyFn; - default = {}; + default = { }; }; }; @@ -133,20 +124,21 @@ with lib; let else -1) lst)); - compareVersions = ver1: ver2: let - getVersion = substring 1 10; - splittedVer1 = builtins.splitVersion (getVersion ver1); - splittedVer2 = builtins.splitVersion (getVersion ver2); + compareVersions = ver1: ver2: + let + getVersion = substring 1 10; + splittedVer1 = builtins.splitVersion (getVersion ver1); + splittedVer2 = builtins.splitVersion (getVersion ver2); - v1 = - if length splittedVer1 == 1 - then "${getVersion ver1}prod" - else getVersion ver1; - v2 = - if length splittedVer2 == 1 - then "${getVersion ver2}prod" - else getVersion ver2; - in + v1 = + if length splittedVer1 == 1 + then "${getVersion ver1}prod" + else getVersion ver1; + v2 = + if length splittedVer2 == 1 + then "${getVersion ver2}prod" + else getVersion ver2; + in builtins.compareVersions v1 v2; customResourceTypesByAttrName = zipAttrs (mapAttrsToList @@ -155,23 +147,20 @@ with lib; let }) cfg.customTypes); - customResourceTypesByAttrNameSortByVersion = - mapAttrs - ( - _: resourceTypes: - reverseList (sort - ( - r1: r2: - compareVersions r1.version r2.version > 0 - ) - resourceTypes) + customResourceTypesByAttrNameSortByVersion = mapAttrs + (_: resourceTypes: + reverseList (sort + ( + r1: r2: + compareVersions r1.version r2.version > 0 + ) + resourceTypes) ) customResourceTypesByAttrName; - latestCustomResourceTypes = - mapAttrsToList (_: last) customResourceTypesByAttrNameSortByVersion; + latestCustomResourceTypes = mapAttrsToList (_: last) customResourceTypesByAttrNameSortByVersion; - customResourceModuleForType = config: ct: {name, ...}: { + customResourceModuleForType = config: ct: { name, ... }: { imports = getDefaults ct.name ct.group ct.version ct.kind; options = { apiVersion = mkOption { @@ -192,7 +181,7 @@ with lib; let spec = mkOption { description = "Module spec"; type = types.either types.attrs (types.submodule ct.module); - default = {}; + default = { }; }; }; @@ -203,73 +192,74 @@ with lib; let }; }; - customResourceOptions = - (mapAttrsToList - (_: ct: {config, ...}: let + customResourceOptions = (mapAttrsToList + (_: ct: { config, ... }: + let module = customResourceModuleForType config ct; - in { + in + { options.resources.${ct.group}.${ct.version}.${ct.kind} = mkOption { inherit (ct) description; type = types.attrsOf (types.submodule module); - default = {}; + default = { }; }; }) - cfg.customTypes) - ++ (map - (ct: { - options, - config, - ... - }: let + cfg.customTypes) + ++ (map + (ct: { options, config, ... }: + let module = customResourceModuleForType config ct; - in { + in + { options.resources.${ct.attrName} = mkOption { inherit (ct) description; type = types.attrsOf (types.submodule module); - default = {}; + default = { }; }; config.resources.${ct.group}.${ct.version}.${ct.kind} = mkAliasDefinitions options.resources.${ct.attrName}; }) - latestCustomResourceTypes); + latestCustomResourceTypes); - coerceListOfSubmodulesToAttrs = submodule: keyFn: let - mergeValuesByFn = keyFn: values: - listToAttrs (map - ( - value: + coerceListOfSubmodulesToAttrs = submodule: keyFn: + let + mergeValuesByFn = keyFn: values: + listToAttrs (map + (value: nameValuePair (toString (keyFn value)) value - ) - values); + ) + values); - # Either value of type `finalType` or `coercedType`, the latter is - # converted to `finalType` using `coerceFunc`. - coercedTo = coercedType: coerceFunc: finalType: - mkOptionType rec { - name = "coercedTo"; - description = "${finalType.description} or ${coercedType.description}"; - check = x: finalType.check x || coercedType.check x; - merge = loc: defs: let - coerceVal = val: - if finalType.check val - then val - else let coerced = coerceFunc val; in assert finalType.check coerced; coerced; - in - finalType.merge loc (map (def: def // {value = coerceVal def.value;}) defs); - inherit (finalType) getSubOptions; - inherit (finalType) getSubModules; - substSubModules = m: coercedTo coercedType coerceFunc (finalType.substSubModules m); - typeMerge = _t1: _t2: null; - functor = (defaultFunctor name) // {wrapped = finalType;}; - }; - in + # Either value of type `finalType` or `coercedType`, the latter is + # converted to `finalType` using `coerceFunc`. + coercedTo = coercedType: coerceFunc: finalType: + mkOptionType rec { + name = "coercedTo"; + description = "${finalType.description} or ${coercedType.description}"; + check = x: finalType.check x || coercedType.check x; + merge = loc: defs: + let + coerceVal = val: + if finalType.check val + then val + else let coerced = coerceFunc val; in assert finalType.check coerced; coerced; + in + finalType.merge loc (map (def: def // { value = coerceVal def.value; }) defs); + inherit (finalType) getSubOptions; + inherit (finalType) getSubModules; + substSubModules = m: coercedTo coercedType coerceFunc (finalType.substSubModules m); + typeMerge = _t1: _t2: null; + functor = (defaultFunctor name) // { wrapped = finalType; }; + }; + in coercedTo - (types.listOf (types.submodule submodule)) - (mergeValuesByFn keyFn) - (types.attrsOf (types.submodule submodule)); -in { - imports = [./base.nix]; + (types.listOf (types.submodule submodule)) + (mergeValuesByFn keyFn) + (types.attrsOf (types.submodule submodule)); +in +{ + imports = [ ./base.nix ]; options.kubernetes = { kubeconfig = mkOption { @@ -296,7 +286,7 @@ in { customResources = mkOption { description = "Setup custom resources"; type = types.listOf types.attrs; - default = []; + default = [ ]; }; resourceOrder = mkOption { @@ -310,25 +300,24 @@ in { api = mkOption { type = types.submodule { - imports = - [ - ./generated/v${cfg.version}.nix - apiOptions - ] - ++ customResourceOptions; + imports = [ + ./generated/v${cfg.version}.nix + apiOptions + ] + ++ customResourceOptions; }; - default = {}; + default = { }; }; imports = mkOption { type = types.listOf (types.either types.package types.path); description = "List of resources to import"; - default = []; + default = [ ]; }; resources = mkOption { description = "Alias for `config.kubernetes.api.resources` options"; - default = {}; + default = { }; type = types.attrsOf types.attrs; }; @@ -342,8 +331,7 @@ in { group = "helm.cattle.io"; }; }; - type = - coerceListOfSubmodulesToAttrs + type = coerceListOfSubmodulesToAttrs { options = { group = mkOption { @@ -385,12 +373,12 @@ in { module = mkOption { description = "Custom type module"; type = types.unspecified; - default = {}; + default = { }; }; }; } gvkKeyFn; - default = {}; + default = { }; }; objects = mkOption { @@ -398,16 +386,15 @@ in { type = types.listOf types.attrs; apply = items: sort - ( - r1: r2: + (r1: r2: if elem r1.kind cfg.resourceOrder && elem r2.kind cfg.resourceOrder then indexOf cfg.resourceOrder r1.kind < indexOf cfg.resourceOrder r2.kind else if elem r1.kind cfg.resourceOrder then true else false - ) - (unique items); - default = []; + ) + (unique items); + default = [ ]; }; generated = mkOption { @@ -428,12 +415,12 @@ in { config = { # features that module is defining - _m.features = ["k8s"]; + _m.features = [ "k8s" ]; # module propagation options _m.propagate = [ { - features = ["k8s"]; + features = [ "k8s" ]; module = _: { # propagate kubernetes version and namespace kubernetes.version = mkDefault cfg.version; @@ -441,8 +428,8 @@ in { }; } { - features = ["k8s" "submodule"]; - module = {config, ...}: { + features = [ "k8s" "submodule" ]; + module = { config, ... }: { # set module defaults kubernetes.api.defaults = (filter (default: default.propagate) cfg.api.defaults) @@ -460,40 +447,37 @@ in { ]; # expose k8s helper methods as module argument - _module.args.k8s = import ../lib/k8s {inherit lib;}; + _module.args.k8s = import ../lib/k8s { inherit lib; }; kubernetes.api = mkMerge ([ - { - # register custom types - types = - mapAttrsToList - (_: cr: { - inherit (cr) name group version kind attrName; - }) - cfg.customTypes; + { + # register custom types + types = mapAttrsToList + (_: cr: { + inherit (cr) name group version kind attrName; + }) + cfg.customTypes; - defaults = [ - { - default = { - # set default kubernetes namespace to all resources - metadata.namespace = - mkIf (config.kubernetes.namespace != null) - (mkDefault config.kubernetes.namespace); + defaults = [{ + default = { + # set default kubernetes namespace to all resources + metadata.namespace = mkIf (config.kubernetes.namespace != null) + (mkDefault config.kubernetes.namespace); - # set project name to all resources - metadata.annotations = { - "kubenix/project-name" = config.kubenix.project; - "kubenix/k8s-version" = cfg.version; - }; - }; - } - ]; - } - ] - ++ - # import of yaml files - (map - (i: let + # set project name to all resources + metadata.annotations = { + "kubenix/project-name" = config.kubenix.project; + "kubenix/k8s-version" = cfg.version; + }; + }; + }]; + } + ] + ++ + # import of yaml files + (map + (i: + let # load yaml file object = importYAML i; groupVersion = splitString "/" object.apiVersion; @@ -504,15 +488,15 @@ in { then "core" else head groupVersion; inherit (object) kind; - in { + in + { resources.${group}.${version}.${kind}.${name} = object; }) - cfg.imports)); + cfg.imports)); kubernetes.objects = flatten (mapAttrsToList - ( - _: type: - mapAttrsToList (_name: moduleToAttrs) + (_: type: + mapAttrsToList (_name: moduleToAttrs) cfg.api.resources.${type.group}.${type.version}.${type.kind} ) cfg.api.types); diff --git a/modules/submodule.nix b/modules/submodule.nix index 34e5f60..e8f8796 100644 --- a/modules/submodule.nix +++ b/modules/submodule.nix @@ -1,10 +1,6 @@ -{ - config, - lib, - ... -}: +{ config, lib, ... }: with lib; { - imports = [./base.nix]; + imports = [ ./base.nix ]; options.submodule = { name = mkOption { @@ -27,24 +23,24 @@ with lib; { tags = mkOption { description = "List of submodule tags"; type = types.listOf types.str; - default = []; + default = [ ]; }; exports = mkOption { description = "Attribute set of functions to export"; type = types.attrs; - default = {}; + default = { }; }; passthru = mkOption { description = "Attribute set to passthru"; type = types.attrs; - default = {}; + default = { }; }; - args._empty = mkOption {}; + args._empty = mkOption { }; }; config._module.args.args = config.submodule.args; - config._m.features = ["submodule"]; + config._m.features = [ "submodule" ]; } diff --git a/modules/submodules.nix b/modules/submodules.nix index e01ab79..aec8a5f 100644 --- a/modules/submodules.nix +++ b/modules/submodules.nix @@ -1,11 +1,4 @@ -{ - config, - options, - kubenix, - pkgs, - lib, - ... -}: +{ config, options, kubenix, pkgs, lib, ... }: with lib; let cfg = config.submodules; parentConfig = config; @@ -18,161 +11,139 @@ with lib; let else requiredVersion == version else true; - getDefaults = { - name, - version, - tags, - features, - }: + getDefaults = { name, version, tags, features }: catAttrs "default" (filter - ( - submoduleDefault: - (submoduleDefault.name == null || submoduleDefault.name == name) - && (matchesVersion submoduleDefault.version version) - && ( - (length submoduleDefault.tags == 0) - || (length (intersectLists submoduleDefault.tags tags)) > 0 - ) - && ( - (length submoduleDefault.features == 0) - || (length (intersectLists submoduleDefault.features features)) > 0 - ) + (submoduleDefault: + (submoduleDefault.name == null || submoduleDefault.name == name) + && (matchesVersion submoduleDefault.version version) + && ( + (length submoduleDefault.tags == 0) + || (length (intersectLists submoduleDefault.tags tags)) > 0 + ) + && ( + (length submoduleDefault.features == 0) + || (length (intersectLists submoduleDefault.features features)) > 0 + ) ) config.submodules.defaults); - specialArgs = - cfg.specialArgs - // { - parentConfig = config; - }; + specialArgs = cfg.specialArgs // { + parentConfig = config; + }; - findSubmodule = { - name, - version ? null, - latest ? true, - }: let - matchingSubmodules = - filter - ( - el: + findSubmodule = { name, version ? null, latest ? true }: + let + matchingSubmodules = filter + (el: el.definition.name == name && (matchesVersion version el.definition.version) - ) - cfg.imports; + ) + cfg.imports; - versionSortedSubmodules = - sort - ( - s1: s2: + versionSortedSubmodules = sort + (s1: s2: if builtins.compareVersions s1.definition.version s2.definition.version > 0 then true else false - ) - matchingSubmodules; + ) + matchingSubmodules; - matchingModule = - if length versionSortedSubmodules == 0 - then - throw "No module found ${name}/${ + matchingModule = + if length versionSortedSubmodules == 0 + then + throw "No module found ${name}/${ if version == null then "latest" else version }" - else head versionSortedSubmodules; - in + else head versionSortedSubmodules; + in matchingModule; - passthruConfig = - mapAttrsToList + passthruConfig = mapAttrsToList (name: _opt: { ${name} = mkMerge (mapAttrsToList - ( - _: inst: - if inst.passthru.enable - then inst.config.submodule.passthru.${name} or {} - else {} + (_: inst: + if inst.passthru.enable + then inst.config.submodule.passthru.${name} or { } + else { } ) config.submodules.instances); _module.args = mkMerge (mapAttrsToList - ( - _: inst: - if inst.passthru.enable - then inst.config.submodule.passthru._module.args or {} - else {} + (_: inst: + if inst.passthru.enable + then inst.config.submodule.passthru._module.args or { } + else { } ) config.submodules.instances); }) - (removeAttrs options ["_definedNames" "_module" "_m" "submodules"]); + (removeAttrs options [ "_definedNames" "_module" "_m" "submodules" ]); - submoduleWithSpecialArgs = opts: specialArgs: let - opts' = toList opts; - inherit (lib.modules) evalModules; - in + submoduleWithSpecialArgs = opts: specialArgs: + let + opts' = toList opts; + inherit (lib.modules) evalModules; + in mkOptionType rec { name = "submodule"; check = x: isAttrs x || isFunction x; - merge = loc: defs: let - coerce = def: - if isFunction def - then def - else {config = def;}; - modules = - opts' - ++ map (def: { - _file = def.file; - imports = [(coerce def.value)]; - }) - defs; - in + merge = loc: defs: + let + coerce = def: + if isFunction def + then def + else { config = def; }; + modules = opts' ++ map + (def: { + _file = def.file; + imports = [ (coerce def.value) ]; + }) + defs; + in (evalModules { inherit modules specialArgs; prefix = loc; - }) - .config; - getSubOptions = prefix: - (evalModules - { - modules = opts'; - inherit prefix specialArgs; - # This is a work-around due to the fact that some sub-modules, - # such as the one included in an attribute set, expects a "args" - # attribute to be given to the sub-module. As the option - # evaluation does not have any specific attribute name, we - # provide a default one for the documentation. - # - # This is mandatory as some option declaration might use the - # "name" attribute given as argument of the submodule and use it - # as the default of option declarations. - # - # Using lookalike unicode single angle quotation marks because - # of the docbook transformation the options receive. In all uses - # > and < wouldn't be encoded correctly so the encoded values - # would be used, and use of `<` and `>` would break the XML document. - # It shouldn't cause an issue since this is cosmetic for the manual. - args.name = "‹name›"; - }) - .options; + }).config; + getSubOptions = prefix: (evalModules { + modules = opts'; + inherit prefix specialArgs; + # This is a work-around due to the fact that some sub-modules, + # such as the one included in an attribute set, expects a "args" + # attribute to be given to the sub-module. As the option + # evaluation does not have any specific attribute name, we + # provide a default one for the documentation. + # + # This is mandatory as some option declaration might use the + # "name" attribute given as argument of the submodule and use it + # as the default of option declarations. + # + # Using lookalike unicode single angle quotation marks because + # of the docbook transformation the options receive. In all uses + # > and < wouldn't be encoded correctly so the encoded values + # would be used, and use of `<` and `>` would break the XML document. + # It shouldn't cause an issue since this is cosmetic for the manual. + args.name = "‹name›"; + }).options; getSubModules = opts'; substSubModules = m: submoduleWithSpecialArgs m specialArgs; - functor = - (defaultFunctor name) - // { - # Merging of submodules is done as part of mergeOptionDecls, as we have to annotate - # each submodule with its location. - payload = []; - binOp = _lhs: _rhs: []; - }; + functor = (defaultFunctor name) // { + # Merging of submodules is done as part of mergeOptionDecls, as we have to annotate + # each submodule with its location. + payload = [ ]; + binOp = _lhs: _rhs: [ ]; + }; }; -in { - imports = [./base.nix]; +in +{ + imports = [ ./base.nix ]; options = { submodules.specialArgs = mkOption { description = "Special args to pass to submodules. These arguments can be used for imports"; type = types.attrs; - default = {}; + default = { }; }; submodules.defaults = mkOption { @@ -197,23 +168,23 @@ in { tags = mkOption { description = "List of tags to apply defaults for"; type = types.listOf types.str; - default = []; + default = [ ]; }; features = mkOption { description = "List of features that submodule has to have to apply defaults"; type = types.listOf types.str; - default = []; + default = [ ]; }; default = mkOption { description = "Default to apply to submodule instance"; type = types.unspecified; - default = {}; + default = { }; }; }; })); - default = []; + default = [ ]; }; submodules.propagate.enable = mkOption { @@ -226,197 +197,184 @@ in { description = "List of submodule imports"; type = types.listOf ( types.coercedTo - types.path - (module: {inherit module;}) - ( - types.submodule ({ - name, - config, - ... - }: let - evaledSubmodule' = evalModules { - inherit specialArgs; - modules = - config.modules - ++ [./base.nix] - ++ [ - { + types.path + (module: { inherit module; }) + ( + types.submodule ({ name, config, ... }: + let + evaledSubmodule' = evalModules { + inherit specialArgs; + modules = config.modules + ++ [ ./base.nix ] + ++ [{ _module.args.check = false; - } - ]; - }; + }]; + }; - evaledSubmodule = - if (!(elem "submodule" evaledSubmodule'.config._m.features)) - then throw "no submodule defined" - else evaledSubmodule'; - in { - options = { - module = mkOption { - description = "Module defining submodule"; - type = types.unspecified; - }; + evaledSubmodule = + if (!(elem "submodule" evaledSubmodule'.config._m.features)) + then throw "no submodule defined" + else evaledSubmodule'; + in + { + options = { + module = mkOption { + description = "Module defining submodule"; + type = types.unspecified; + }; - modules = mkOption { - description = "List of modules defining submodule"; - type = types.listOf types.unspecified; - default = [config.module]; - }; + modules = mkOption { + description = "List of modules defining submodule"; + type = types.listOf types.unspecified; + default = [ config.module ]; + }; - features = mkOption { - description = "List of features exposed by submodule"; - type = types.listOf types.str; - }; + features = mkOption { + description = "List of features exposed by submodule"; + type = types.listOf types.str; + }; - definition = mkOption { - description = "Submodule definition"; - type = types.attrs; - }; + definition = mkOption { + description = "Submodule definition"; + type = types.attrs; + }; - exportAs = mkOption { - description = "Name under which to register exports"; - type = types.nullOr types.str; - default = null; - }; - }; + exportAs = mkOption { + description = "Name under which to register exports"; + type = types.nullOr types.str; + default = null; + }; + }; - config = { - definition = { - inherit (evaledSubmodule.config.submodule) name description version tags exports; - }; + config = { + definition = { + inherit (evaledSubmodule.config.submodule) name description version tags exports; + }; - inherit (evaledSubmodule.config._m) features; - }; - }) - ) + inherit (evaledSubmodule.config._m) features; + }; + }) + ) ); - default = []; + default = [ ]; }; submodules.instances = mkOption { description = "Attribute set of submodule instances"; - default = {}; - type = types.attrsOf (types.submodule ({ - name, - config, - options, - ... - }: let - # submodule associated with - submodule = findSubmodule { - name = config.submodule; - inherit (config) version; - }; - - # definition of a submodule - submoduleDefinition = submodule.definition; - - # submodule defaults - defaults = getDefaults { - inherit (submoduleDefinition) name; - inherit (submoduleDefinition) version; - inherit (submoduleDefinition) tags; - inherit (submodule) features; - }; - in { - options = { - name = mkOption { - description = "Submodule instance name"; - type = types.str; - default = name; + default = { }; + type = types.attrsOf (types.submodule ({ name, config, options, ... }: + let + # submodule associated with + submodule = findSubmodule { + name = config.submodule; + inherit (config) version; }; - submodule = mkOption { - description = "Name of the submodule to use"; - type = types.str; - default = name; - }; + # definition of a submodule + submoduleDefinition = submodule.definition; - version = mkOption { - description = '' - Version of submodule to use, if version starts with "~" it is - threated as regex pattern for example "~1.0.*" - ''; - type = types.nullOr types.str; - default = null; + # submodule defaults + defaults = getDefaults { + inherit (submoduleDefinition) name; + inherit (submoduleDefinition) version; + inherit (submoduleDefinition) tags; + inherit (submodule) features; }; + in + { + options = { + name = mkOption { + description = "Submodule instance name"; + type = types.str; + default = name; + }; - passthru.enable = mkOption { - description = "Whether to passthru submodule resources"; - type = types.bool; - default = true; - }; + submodule = mkOption { + description = "Name of the submodule to use"; + type = types.str; + default = name; + }; - config = mkOption { - description = "Submodule instance ${config.name} for ${submoduleDefinition.name}:${submoduleDefinition.version} config"; - type = - submoduleWithSpecialArgs - ({...}: { - imports = submodule.modules ++ defaults ++ [./base.nix]; - _module.args.pkgs = pkgs; - _module.args.name = config.name; - _module.args.submodule = config; - submodule.args = mkAliasDefinitions options.args; - }) - specialArgs; - default = {}; - }; + version = mkOption { + description = '' + Version of submodule to use, if version starts with "~" it is + threated as regex pattern for example "~1.0.*" + ''; + type = types.nullOr types.str; + default = null; + }; - args = mkOption { - description = "Submodule arguments (alias of config.submodule.args)"; + passthru.enable = mkOption { + description = "Whether to passthru submodule resources"; + type = types.bool; + default = true; + }; + + config = mkOption { + description = "Submodule instance ${config.name} for ${submoduleDefinition.name}:${submoduleDefinition.version} config"; + type = submoduleWithSpecialArgs + ({ ... }: { + imports = submodule.modules ++ defaults ++ [ ./base.nix ]; + _module.args.pkgs = pkgs; + _module.args.name = config.name; + _module.args.submodule = config; + submodule.args = mkAliasDefinitions options.args; + }) + specialArgs; + default = { }; + }; + + args = mkOption { + description = "Submodule arguments (alias of config.submodule.args)"; + }; }; - }; - })); + })); }; - default = {}; + default = { }; }; config = mkMerge ([ - { - # register exported functions as args - _module.args = mkMerge (map - (submodule: { - ${submodule.exportAs} = submodule.definition.exports; + { + # register exported functions as args + _module.args = mkMerge (map + (submodule: { + ${submodule.exportAs} = submodule.definition.exports; + }) + (filter (submodule: submodule.exportAs != null) cfg.imports)); + + _m.features = [ "submodules" ]; + + submodules.specialArgs.kubenix = kubenix; + + # passthru kubenix.project to submodules + submodules.defaults = mkMerge [ + [{ + default = { + kubenix.project = parentConfig.kubenix.project; + }; + }] + + (map + (propagate: { + inherit (propagate) features; + default = propagate.module; }) - (filter (submodule: submodule.exportAs != null) cfg.imports)); + config._m.propagate) + ]; + } - _m.features = ["submodules"]; - - submodules.specialArgs.kubenix = kubenix; - - # passthru kubenix.project to submodules - submodules.defaults = mkMerge [ - [ - { - default = { - kubenix.project = parentConfig.kubenix.project; - }; - } - ] - - (map - (propagate: { - inherit (propagate) features; - default = propagate.module; - }) - config._m.propagate) - ]; - } - - (mkIf cfg.propagate.enable { - # if propagate is enabled and submodule has submodules included propagage defaults and imports - submodules.defaults = [ - { - features = ["submodules"]; - default = { - submodules = { - inherit (cfg) defaults; - inherit (cfg) imports; - }; - }; - } - ]; - }) - ] - ++ passthruConfig); + (mkIf cfg.propagate.enable { + # if propagate is enabled and submodule has submodules included propagage defaults and imports + submodules.defaults = [{ + features = [ "submodules" ]; + default = { + submodules = { + inherit (cfg) defaults; + inherit (cfg) imports; + }; + }; + }]; + }) + ] + ++ passthruConfig); } diff --git a/modules/testing/default.nix b/modules/testing/default.nix index 95ee1c7..2f83b74 100644 --- a/modules/testing/default.nix +++ b/modules/testing/default.nix @@ -1,15 +1,9 @@ -{ - config, - pkgs, - lib, - kubenix, - ... -}: +{ config, pkgs, lib, kubenix, ... }: with lib; let cfg = config.testing; testModule = { - imports = [./evalTest.nix]; + imports = [ ./evalTest.nix ]; # passthru testing configuration config._module.args = { @@ -18,9 +12,9 @@ with lib; let }; }; - isTestEnabled = test: - (cfg.enabledTests == null || elem test.name cfg.enabledTests) && test.enable; -in { + isTestEnabled = test: (cfg.enabledTests == null || elem test.name cfg.enabledTests) && test.enable; +in +{ imports = [ ./docker.nix ./driver/kubetest.nix @@ -48,23 +42,23 @@ in { features = mkOption { description = "List of features that test has to have to apply options"; type = types.listOf types.str; - default = []; + default = [ ]; }; options = mkOption { description = "Options to apply to test"; type = types.unspecified; - default = {}; - apply = default: {_file = "testing.common";} // default; + default = { }; + apply = default: { _file = "testing.common"; } // default; }; }; })); - default = []; + default = [ ]; }; tests = mkOption { description = "List of test cases"; - default = []; + default = [ ]; type = types.listOf (types.coercedTo types.path (module: { inherit module; @@ -88,7 +82,7 @@ in { args = mkOption { description = "Attribute set of extra args passed to tests"; type = types.attrs; - default = {}; + default = { }; }; success = mkOption { diff --git a/modules/testing/docker.nix b/modules/testing/docker.nix index ec519c6..86704cb 100644 --- a/modules/testing/docker.nix +++ b/modules/testing/docker.nix @@ -1,17 +1,13 @@ -{ - config, - lib, - pkgs, - ... -}: +{ config, lib, pkgs, ... }: with lib; -with import ../../lib/docker {inherit lib pkgs;}; let +with import ../../lib/docker { inherit lib pkgs; }; let inherit (config) testing; - allImages = unique (flatten (map (t: t.evaled.config.docker.export or []) testing.tests)); + allImages = unique (flatten (map (t: t.evaled.config.docker.export or [ ]) testing.tests)); cfg = config.testing.docker; -in { +in +{ options.testing.docker = { registryUrl = mkOption { description = "Docker registry url"; @@ -38,13 +34,11 @@ in { }; }; - config.testing.common = [ - { - features = ["docker"]; - options = { - _file = "testing.docker.registryUrl"; - docker.registry.url = cfg.registryUrl; - }; - } - ]; + config.testing.common = [{ + features = [ "docker" ]; + options = { + _file = "testing.docker.registryUrl"; + docker.registry.url = cfg.registryUrl; + }; + }]; } diff --git a/modules/testing/driver/kubetest.nix b/modules/testing/driver/kubetest.nix index 8edbe49..516c270 100644 --- a/modules/testing/driver/kubetest.nix +++ b/modules/testing/driver/kubetest.nix @@ -1,23 +1,15 @@ -{ - lib, - config, - pkgs, - ... -}: +{ lib, config, pkgs, ... }: with lib; let inherit (config) testing; cfg = testing.driver.kubetest; - kubetest = import ./kubetestdrv.nix {inherit pkgs;}; + kubetest = import ./kubetestdrv.nix { inherit pkgs; }; - pythonEnv = pkgs.python38.withPackages (ps: - with ps; - [ - pytest - kubetest - kubernetes - ] - ++ cfg.extraPackages); + pythonEnv = pkgs.python38.withPackages (ps: with ps; [ + pytest + kubetest + kubernetes + ] ++ cfg.extraPackages); toTestScript = t: if isString t.script @@ -28,26 +20,29 @@ with lib; let '' else t.script; - tests = let - # make sure tests are prefixed so that alphanumerical - # sorting reproduces them in the same order as they - # have been declared in the list. - seive = t: t.script != null && t.enabled; - allEligibleTests = filter seive testing.tests; - listLengthPadding = builtins.length ( - lib.stringToCharacters ( - builtins.toString ( - builtins.length allEligibleTests + tests = + let + # make sure tests are prefixed so that alphanumerical + # sorting reproduces them in the same order as they + # have been declared in the list. + seive = t: t.script != null && t.enabled; + allEligibleTests = filter seive testing.tests; + listLengthPadding = builtins.length ( + lib.stringToCharacters ( + builtins.toString ( + builtins.length allEligibleTests + ) ) - ) - ); - op = i: t: { - path = toTestScript t; - name = let - prefix = lib.fixedWidthNumber listLengthPadding i; - in "${prefix}_${t.name}_test.py"; - }; - in + ); + op = i: t: { + path = toTestScript t; + name = + let + prefix = lib.fixedWidthNumber listLengthPadding i; + in + "${prefix}_${t.name}_test.py"; + }; + in pkgs.linkFarm "${testing.name}-tests" ( lib.imap0 op allEligibleTests ); @@ -56,7 +51,8 @@ with lib; let #!/usr/bin/env bash ${pythonEnv}/bin/pytest -p no:cacheprovider ${tests} $@ ''; -in { +in +{ options.testing.driver.kubetest = { defaultHeader = mkOption { type = types.lines; @@ -69,7 +65,7 @@ in { extraPackages = mkOption { type = types.listOf types.package; description = "Extra packages to pass to tests"; - default = []; + default = [ ]; }; }; diff --git a/modules/testing/driver/kubetestdrv.nix b/modules/testing/driver/kubetestdrv.nix index 45c540d..40c34c4 100644 --- a/modules/testing/driver/kubetestdrv.nix +++ b/modules/testing/driver/kubetestdrv.nix @@ -1,14 +1,14 @@ -{pkgs ? import {}}: +{ pkgs ? import { } }: with pkgs; with pkgs.python38Packages; with pkgs.python38; - pkgs.python38Packages.buildPythonPackage rec { - pname = "kubetest"; - version = "0.9.5"; - src = fetchPypi { - inherit pname version; - sha256 = "sha256-TqDHMciAEXv4vMWLJY1YdtXsP4ho+INgdFB3xQQNoZU="; - }; - propagatedBuildInputs = [pytest kubernetes]; - doCheck = false; - } +pkgs.python38Packages.buildPythonPackage rec { + pname = "kubetest"; + version = "0.9.5"; + src = fetchPypi { + inherit pname version; + sha256 = "sha256-TqDHMciAEXv4vMWLJY1YdtXsP4ho+INgdFB3xQQNoZU="; + }; + propagatedBuildInputs = [ pytest kubernetes ]; + doCheck = false; +} diff --git a/modules/testing/evalTest.nix b/modules/testing/evalTest.nix index adc46a4..b757e66 100644 --- a/modules/testing/evalTest.nix +++ b/modules/testing/evalTest.nix @@ -1,10 +1,4 @@ -{ - lib, - config, - testing, - kubenix, - ... -}: +{ lib, config, testing, kubenix, ... }: with lib; let modules = [ # testing module @@ -29,13 +23,9 @@ with lib; let # eval without checking evaled' = kubenix.evalModules { - modules = - modules - ++ [ - { - _module.args.check = false; - } - ]; + modules = modules ++ [{ + _module.args.check = false; + }]; }; # test configuration @@ -45,13 +35,11 @@ with lib; let testFeatures = evaled'.config._m.features; # common options that can be applied on this test - commonOpts = - filter - ( - d: - (intersectLists d.features testFeatures) - == d.features - || (length d.features) == 0 + commonOpts = filter + (d: + (intersectLists d.features testFeatures) + == d.features + || (length d.features) == 0 ) testing.common; @@ -59,17 +47,19 @@ with lib; let modulesWithCommonOptions = modules ++ (map (d: d.options) commonOpts); # evaled test - evaled = let - evaled' = kubenix.evalModules { - modules = modulesWithCommonOptions; - }; - in + evaled = + let + evaled' = kubenix.evalModules { + modules = modulesWithCommonOptions; + }; + in if testing.doThrowError then evaled' else if (builtins.tryEval evaled'.config.test.assertions).success then evaled' else null; -in { +in +{ options = { module = mkOption { description = "Module defining kubenix test"; @@ -112,7 +102,7 @@ in { description = "Test result"; type = types.unspecified; internal = true; - default = []; + default = [ ]; }; script = mkOption { diff --git a/modules/testing/runtime/local.nix b/modules/testing/runtime/local.nix index b443f20..24f31c0 100644 --- a/modules/testing/runtime/local.nix +++ b/modules/testing/runtime/local.nix @@ -1,9 +1,4 @@ -{ - lib, - config, - pkgs, - ... -}: +{ lib, config, pkgs, ... }: with lib; let inherit (config) testing; @@ -34,7 +29,8 @@ with lib; let echo "--> running tests" ${testing.testScript} --kube-config=$KUBECONFIG ''; -in { +in +{ options.testing.runtime.local = { script = mkOption { type = types.package; diff --git a/modules/testing/runtime/nixos-k8s.nix b/modules/testing/runtime/nixos-k8s.nix index b31b96f..ec9c66e 100644 --- a/modules/testing/runtime/nixos-k8s.nix +++ b/modules/testing/runtime/nixos-k8s.nix @@ -1,10 +1,5 @@ # nixos-k8s implements nixos kubernetes testing runtime -{ - config, - pkgs, - lib, - ... -}: +{ config, pkgs, lib, ... }: with lib; let inherit (config) testing; # kubeconfig = "/etc/${config.services.kubernetes.pki.etcClusterAdminKubeconfig}"; @@ -12,15 +7,15 @@ with lib; let kubecerts = "/var/lib/kubernetes/secrets"; # how we differ from the standard configuration of mkKubernetesBaseTest - extraConfiguration = {config, ...}: { + extraConfiguration = { config, ... }: { virtualisation = { memorySize = 2048; }; networking = { - nameservers = ["10.0.0.254"]; + nameservers = [ "10.0.0.254" ]; firewall = { - trustedInterfaces = ["docker0" "cni0"]; + trustedInterfaces = [ "docker0" "cni0" ]; }; }; @@ -29,26 +24,22 @@ with lib; let kubelet = { seedDockerImages = testing.docker.images; networkPlugin = "cni"; - cni.config = [ - { - name = "mynet"; - type = "bridge"; - bridge = "cni0"; - addIf = true; - ipMasq = true; - isGateway = true; - ipam = { - type = "host-local"; - subnet = "10.1.0.0/16"; - gateway = "10.1.0.1"; - routes = [ - { - dst = "0.0.0.0/0"; - } - ]; - }; - } - ]; + cni.config = [{ + name = "mynet"; + type = "bridge"; + bridge = "cni0"; + addIf = true; + ipMasq = true; + isGateway = true; + ipam = { + type = "host-local"; + subnet = "10.1.0.0/16"; + gateway = "10.1.0.1"; + routes = [{ + dst = "0.0.0.0/0"; + }]; + }; + }]; }; }; @@ -58,8 +49,8 @@ with lib; let services.copy-certs = { description = "Share k8s certificates with host"; script = "cp -rf ${kubecerts} /tmp/xchg/; cp -f ${kubeconfig} /tmp/xchg/;"; - after = ["kubernetes.target"]; - wantedBy = ["multi-user.target"]; + after = [ "kubernetes.target" ]; + wantedBy = [ "multi-user.target" ]; serviceConfig = { Type = "oneshot"; RemainAfterExit = true; @@ -72,16 +63,18 @@ with lib; let machine1.succeed("${testing.testScript} --kube-config=${kubeconfig}") ''; - test = with import "${pkgs.path}/nixos/tests/kubernetes/base.nix" { - inherit pkgs; - inherit (pkgs) system; - }; + test = with import "${pkgs.path}/nixos/tests/kubernetes/base.nix" + { + inherit pkgs; + inherit (pkgs) system; + }; mkKubernetesSingleNodeTest { inherit extraConfiguration; inherit (config.testing) name; test = script; }; -in { +in +{ options.testing.runtime.nixos-k8s = { driver = mkOption { description = "Test driver"; diff --git a/modules/testing/test-options.nix b/modules/testing/test-options.nix index f6b229b..63b93d3 100644 --- a/modules/testing/test-options.nix +++ b/modules/testing/test-options.nix @@ -1,8 +1,4 @@ -{ - lib, - config, - ... -}: +{ lib, config, ... }: with lib; { options.test = { name = mkOption { @@ -36,13 +32,11 @@ with lib; { }; }; }); - default = []; - example = [ - { - assertion = false; - message = "you can't enable this for some reason"; - } - ]; + default = [ ]; + example = [{ + assertion = false; + message = "you can't enable this for some reason"; + }]; description = '' This option allows modules to express conditions that must hold for the evaluation of the system configuration to diff --git a/pkgs/applications/networking/cluster/kubectl/default.nix b/pkgs/applications/networking/cluster/kubectl/default.nix index 2853605..73736b9 100644 --- a/pkgs/applications/networking/cluster/kubectl/default.nix +++ b/pkgs/applications/networking/cluster/kubectl/default.nix @@ -1,7 +1,6 @@ -{ - stdenv, - kubernetes, - installShellFiles, +{ stdenv +, kubernetes +, installShellFiles }: stdenv.mkDerivation { name = "kubectl-${kubernetes.version}"; @@ -10,9 +9,9 @@ stdenv.mkDerivation { # split out (see homepage) dontUnpack = true; - nativeBuildInputs = [installShellFiles]; + nativeBuildInputs = [ installShellFiles ]; - outputs = ["out" "man"]; + outputs = [ "out" "man" ]; installPhase = '' install -D ${kubernetes}/bin/kubectl -t $out/bin diff --git a/pkgs/applications/networking/cluster/kubernetes/default.nix b/pkgs/applications/networking/cluster/kubernetes/default.nix index 775dfbb..febaf42 100644 --- a/pkgs/applications/networking/cluster/kubernetes/default.nix +++ b/pkgs/applications/networking/cluster/kubernetes/default.nix @@ -1,21 +1,20 @@ -{ - stdenv, - lib, - fetchFromGitHub, - removeReferencesTo, - which, - go, - makeWrapper, - rsync, - installShellFiles, - components ? [ +{ stdenv +, lib +, fetchFromGitHub +, removeReferencesTo +, which +, go +, makeWrapper +, rsync +, installShellFiles +, components ? [ "cmd/kubelet" "cmd/kube-apiserver" "cmd/kube-controller-manager" "cmd/kube-proxy" "cmd/kube-scheduler" "test/e2e/e2e.test" - ], + ] }: stdenv.mkDerivation rec { pname = "kubernetes"; @@ -28,11 +27,11 @@ stdenv.mkDerivation rec { hash = "sha256-r9Clwr+87Ns4VXUW9F6cgks+LknY39ngbQgZ5UMZ0Vo="; }; - nativeBuildInputs = [removeReferencesTo makeWrapper which go rsync installShellFiles]; + nativeBuildInputs = [ removeReferencesTo makeWrapper which go rsync installShellFiles ]; - outputs = ["out" "man" "pause"]; + outputs = [ "out" "man" "pause" ]; - patches = [./fixup-addonmanager-lib-path.patch]; + patches = [ ./fixup-addonmanager-lib-path.patch ]; postPatch = '' # go env breaks the sandbox @@ -48,10 +47,10 @@ stdenv.mkDerivation rec { ''; WHAT = lib.concatStringsSep " " ([ - "cmd/kubeadm" - "cmd/kubectl" - ] - ++ components); + "cmd/kubeadm" + "cmd/kubectl" + ] + ++ components); postBuild = '' ./hack/update-generated-docs.sh @@ -84,7 +83,7 @@ stdenv.mkDerivation rec { description = "Production-Grade Container Scheduling and Management"; license = licenses.asl20; homepage = "https://kubernetes.io"; - maintainers = with maintainers; [johanot offline saschagrunert]; + maintainers = with maintainers; [ johanot offline saschagrunert ]; platforms = platforms.unix; }; } diff --git a/pkgs/generators/default.nix b/pkgs/generators/default.nix index 7af65fd..920df7a 100644 --- a/pkgs/generators/default.nix +++ b/pkgs/generators/default.nix @@ -1,45 +1,36 @@ -{ - pkgs, - lib, -}: let +{ pkgs, lib }: +let generateIstio = import ./istio { - inherit - pkgs - lib - ; + inherit pkgs lib; }; generateK8S = name: spec: import ./k8s { - inherit - name - pkgs - lib - spec - ; + inherit name pkgs lib spec; }; -in { - istio = pkgs.linkFarm "istio-generated" [ - { - name = "latest.nix"; - path = generateIstio; - } - ]; +in +{ + istio = pkgs.linkFarm "istio-generated" [{ + name = "latest.nix"; + path = generateIstio; + }]; k8s = pkgs.linkFarm "k8s-generated" ( builtins.attrValues ( - builtins.mapAttrs ( - version: sha: let - short = builtins.concatStringsSep "." (lib.lists.sublist 0 2 (builtins.splitVersion version)); - in { - name = "v${short}.nix"; - path = generateK8S "v${short}" (builtins.fetchurl { - url = "https://github.com/kubernetes/kubernetes/raw/v${version}/api/openapi-spec/swagger.json"; - sha256 = sha; - }); - } - ) - (import ../../versions.nix).full + builtins.mapAttrs + (version: sha: + let + short = builtins.concatStringsSep "." (lib.lists.sublist 0 2 (builtins.splitVersion version)); + in + { + name = "v${short}.nix"; + path = generateK8S "v${short}" (builtins.fetchurl { + url = "https://github.com/kubernetes/kubernetes/raw/v${version}/api/openapi-spec/swagger.json"; + sha256 = sha; + }); + } + ) + (import ../../versions.nix).full ) ); } diff --git a/pkgs/generators/istio/default.nix b/pkgs/generators/istio/default.nix index 004ce15..05fa84f 100644 --- a/pkgs/generators/istio/default.nix +++ b/pkgs/generators/istio/default.nix @@ -1,7 +1,6 @@ -{ - pkgs ? import {}, - lib ? pkgs.lib, - spec ? ./istio-schema.json, +{ pkgs ? import { } +, lib ? pkgs.lib +, spec ? ./istio-schema.json }: with lib; let gen = rec { @@ -20,14 +19,9 @@ with lib; let then "null" else builtins.toString value; - removeEmptyLines = str: concatStringsSep "\n" (filter (l: builtins.match "[[:space:]]*" l != []) (splitString "\n" str)); + removeEmptyLines = str: concatStringsSep "\n" (filter (l: builtins.match "[[:space:]]*" l != [ ]) (splitString "\n" str)); - mkOption = { - description ? null, - type ? null, - default ? null, - apply ? null, - }: + mkOption = { description ? null, type ? null, default ? null, apply ? null }: removeEmptyLines '' mkOption { ${optionalString (description != null) "description = ${builtins.toJSON description};"} ${optionalString (type != null) ''type = ${type};''} @@ -53,7 +47,7 @@ with lib; let hasTypeMapping = def: hasAttr "type" def - && elem def.type ["string" "integer" "boolean"]; + && elem def.type [ "string" "integer" "boolean" ]; mergeValuesByKey = mergeKey: ''(mergeValuesByKey "${mergeKey}")''; @@ -84,157 +78,152 @@ with lib; let refDefinition = attr: head (tail (tail (splitString "/" attr."$ref"))); }; - fixJSON = replaceStrings ["\\u"] ["u"]; + fixJSON = replaceStrings [ "\\u" ] [ "u" ]; fetchSpecs = path: builtins.fromJSON (fixJSON (builtins.readFile path)); - genDefinitions = swagger: - with gen; (mapAttrs - ( - _name: definition: - # if $ref is in definition it means it's an alias of other definition - if hasAttr "$ref" definition - then definitions."${refDefinition definition}" - else if !(hasAttr "properties" definition) - then { - type = mapType definition; - } - else { - options = - mapAttrs - ( - propName: property: let - isRequired = elem propName (definition.required or []); - requiredOrNot = type: - if isRequired - then type - else types.nullOr type; - optionProperties = - # if $ref is in property it references other definition, - # but if other definition does not have properties, then just take it's type - if hasAttr "$ref" property - then - if hasTypeMapping swagger.definitions.${refDefinition property} - then { - type = requiredOrNot (mapType swagger.definitions.${refDefinition property}); - } - else { - type = requiredOrNot (submoduleOf definitions (refDefinition property)); - } - else if !(hasAttr "type" property) + genDefinitions = swagger: with gen; (mapAttrs + (_name: definition: + # if $ref is in definition it means it's an alias of other definition + if hasAttr "$ref" definition + then definitions."${refDefinition definition}" + else if !(hasAttr "properties" definition) + then { + type = mapType definition; + } + else { + options = mapAttrs + (propName: property: + let + isRequired = elem propName (definition.required or [ ]); + requiredOrNot = type: + if isRequired + then type + else types.nullOr type; + optionProperties = + # if $ref is in property it references other definition, + # but if other definition does not have properties, then just take it's type + if hasAttr "$ref" property + then + if hasTypeMapping swagger.definitions.${refDefinition property} + then { + type = requiredOrNot (mapType swagger.definitions.${refDefinition property}); + } + else { + type = requiredOrNot (submoduleOf definitions (refDefinition property)); + } + else if !(hasAttr "type" property) + then { + type = types.unspecified; + } + # if property has an array type + else if property.type == "array" + then + # if reference is in items it can reference other type of another + # definition + if hasAttr "$ref" property.items + then + # if it is a reference to simple type + if hasTypeMapping swagger.definitions.${refDefinition property.items} then { - type = types.unspecified; + type = requiredOrNot (types.listOf (mapType swagger.definitions.${refDefinition property.items}.type)); } - # if property has an array type - else if property.type == "array" - then - # if reference is in items it can reference other type of another - # definition - if hasAttr "$ref" property.items + # if a reference is to complex type + else + # if x-kubernetes-patch-merge-key is set then make it an + # attribute set of submodules + if hasAttr "x-kubernetes-patch-merge-key" property then - # if it is a reference to simple type - if hasTypeMapping swagger.definitions.${refDefinition property.items} - then { - type = requiredOrNot (types.listOf (mapType swagger.definitions.${refDefinition property.items}.type)); + let + mergeKey = property."x-kubernetes-patch-merge-key"; + in + { + type = requiredOrNot (coerceAttrsOfSubmodulesToListByKey (refDefinition property.items) mergeKey); + apply = attrsToList; } - # if a reference is to complex type - else - # if x-kubernetes-patch-merge-key is set then make it an - # attribute set of submodules - if hasAttr "x-kubernetes-patch-merge-key" property - then let - mergeKey = property."x-kubernetes-patch-merge-key"; - in { - type = requiredOrNot (coerceAttrsOfSubmodulesToListByKey (refDefinition property.items) mergeKey); - apply = attrsToList; - } - # in other case it's a simple list - else { - type = requiredOrNot (types.listOf (submoduleOf definitions (refDefinition property.items))); - } - # in other case it only references a simple type + # in other case it's a simple list else { - type = requiredOrNot (types.listOf (mapType property.items)); + type = requiredOrNot (types.listOf (submoduleOf definitions (refDefinition property.items))); } - else if property.type == "object" && hasAttr "additionalProperties" property - then - # if it is a reference to simple type - if - ( - hasAttr "$ref" property.additionalProperties - && hasTypeMapping swagger.definitions.${refDefinition property.additionalProperties} - ) - then { - type = requiredOrNot (types.attrsOf (mapType swagger.definitions.${refDefinition property.additionalProperties})); - } - else if hasAttr "$ref" property.additionalProperties - then { - type = requiredOrNot types.attrs; - } - # if is an array - else if property.additionalProperties.type == "array" - then { - type = requiredOrNot (types.loaOf (mapType property.additionalProperties.items)); - } - else { - type = requiredOrNot (types.attrsOf (mapType property.additionalProperties)); - } - # just a simple property - else { - type = requiredOrNot (mapType property); - }; - in - mkOption ({ - description = property.description or ""; - } - // optionProperties) + # in other case it only references a simple type + else { + type = requiredOrNot (types.listOf (mapType property.items)); + } + else if property.type == "object" && hasAttr "additionalProperties" property + then + # if it is a reference to simple type + if + ( + hasAttr "$ref" property.additionalProperties + && hasTypeMapping swagger.definitions.${refDefinition property.additionalProperties} + ) + then { + type = requiredOrNot (types.attrsOf (mapType swagger.definitions.${refDefinition property.additionalProperties})); + } + else if hasAttr "$ref" property.additionalProperties + then { + type = requiredOrNot types.attrs; + } + # if is an array + else if property.additionalProperties.type == "array" + then { + type = requiredOrNot (types.loaOf (mapType property.additionalProperties.items)); + } + else { + type = requiredOrNot (types.attrsOf (mapType property.additionalProperties)); + } + # just a simple property + else { + type = requiredOrNot (mapType property); + }; + in + mkOption ({ + description = property.description or ""; + } + // optionProperties) + ) + definition.properties; + config = + let + optionalProps = filterAttrs + (propName: _property: + !(elem propName (definition.required or [ ])) ) definition.properties; - config = let - optionalProps = - filterAttrs - ( - propName: _property: - !(elem propName (definition.required or [])) - ) - definition.properties; - in - mapAttrs (_name: _property: mkOverride 1002 null) optionalProps; - } - ) - swagger.definitions); + in + mapAttrs (_name: _property: mkOverride 1002 null) optionalProps; + } + ) + swagger.definitions); - genResources = swagger: - (mapAttrsToList - (_name: property: rec { - splittedType = splitString "." (removePrefix "me.snowdrop.istio.api." property.javaType); - group = (concatStringsSep "." (take ((length splittedType) - 2) splittedType)) + ".istio.io"; - kind = removeSuffix "Spec" (last splittedType); - version = last (take ((length splittedType) - 1) splittedType); - ref = removePrefix "#/definitions/" property."$ref"; - }) - (filterAttrs - ( - _name: property: - (hasPrefix "me.snowdrop.istio.api" property.javaType) - && hasSuffix "Spec" property.javaType - ) - swagger.properties)) - ++ (mapAttrsToList - (_name: property: rec { - splittedType = splitString "." (removePrefix "me.snowdrop.istio.mixer." property.javaType); - group = "config.istio.io"; - version = "v1alpha2"; - kind = head (tail splittedType); - ref = removePrefix "#/definitions/" property."$ref"; - }) - (filterAttrs - ( - _name: property: - (hasPrefix "me.snowdrop.istio.mixer" property.javaType) - && hasSuffix "Spec" property.javaType - ) - swagger.properties)); + genResources = swagger: (mapAttrsToList + (_name: property: rec { + splittedType = splitString "." (removePrefix "me.snowdrop.istio.api." property.javaType); + group = (concatStringsSep "." (take ((length splittedType) - 2) splittedType)) + ".istio.io"; + kind = removeSuffix "Spec" (last splittedType); + version = last (take ((length splittedType) - 1) splittedType); + ref = removePrefix "#/definitions/" property."$ref"; + }) + (filterAttrs + (_name: property: + (hasPrefix "me.snowdrop.istio.api" property.javaType) + && hasSuffix "Spec" property.javaType + ) + swagger.properties)) + ++ (mapAttrsToList + (_name: property: rec { + splittedType = splitString "." (removePrefix "me.snowdrop.istio.mixer." property.javaType); + group = "config.istio.io"; + version = "v1alpha2"; + kind = head (tail splittedType); + ref = removePrefix "#/definitions/" property."$ref"; + }) + (filterAttrs + (_name: property: + (hasPrefix "me.snowdrop.istio.mixer" property.javaType) + && hasSuffix "Spec" property.javaType + ) + swagger.properties)); swagger = fetchSpecs spec; @@ -367,14 +356,14 @@ with lib; let } ''; in - pkgs.runCommand "istio-gen.nix" - { - buildInputs = [pkgs.nixpkgs-fmt]; - } '' - cat << 'GENERATED' > ./raw - "${generated}" - GENERATED +pkgs.runCommand "istio-gen.nix" +{ + buildInputs = [ pkgs.nixpkgs-fmt ]; +} '' + cat << 'GENERATED' > ./raw + "${generated}" + GENERATED - nixpkgs-fmt ./raw - cp ./raw $out - '' + nixpkgs-fmt ./raw + cp ./raw $out +'' diff --git a/pkgs/generators/k8s/default.nix b/pkgs/generators/k8s/default.nix index 6bf6b8e..b5d088c 100644 --- a/pkgs/generators/k8s/default.nix +++ b/pkgs/generators/k8s/default.nix @@ -1,9 +1,4 @@ -{ - name, - pkgs, - lib, - spec, -}: +{ name, pkgs, lib, spec }: with lib; let gen = rec { mkMerge = values: ''mkMerge [${concatMapStrings @@ -21,14 +16,9 @@ with lib; let then "null" else builtins.toString value; - removeEmptyLines = str: concatStringsSep "\n" (filter (l: builtins.match "[[:space:]]*" l != []) (splitString "\n" str)); + removeEmptyLines = str: concatStringsSep "\n" (filter (l: builtins.match "[[:space:]]*" l != [ ]) (splitString "\n" str)); - mkOption = { - description ? null, - type ? null, - default ? null, - apply ? null, - }: + mkOption = { description ? null, type ? null, default ? null, apply ? null }: removeEmptyLines '' mkOption { ${optionalString (description != null) "description = ${builtins.toJSON description};"} ${optionalString (type != null) ''type = ${type};''} @@ -52,9 +42,7 @@ with lib; let loaOf = type: "(types.loaOf ${type})"; }; - hasTypeMapping = def: - hasAttr "type" def - && elem def.type ["string" "integer" "boolean"]; + hasTypeMapping = def: hasAttr "type" def && elem def.type [ "string" "integer" "boolean" ]; mergeValuesByKey = mergeKey: ''(mergeValuesByKey "${mergeKey}")''; @@ -87,43 +75,42 @@ with lib; let refType = attr: head (tail (tail (splitString "/" attr."$ref"))); - compareVersions = ver1: ver2: let - getVersion = substring 1 10; - splitVersion = v: builtins.splitVersion (getVersion v); - isAlpha = v: elem "alpha" (splitVersion v); - patchVersion = v: - if isAlpha v - then "" - else if length (splitVersion v) == 1 - then "${getVersion v}prod" - else getVersion v; + compareVersions = ver1: ver2: + let + getVersion = substring 1 10; + splitVersion = v: builtins.splitVersion (getVersion v); + isAlpha = v: elem "alpha" (splitVersion v); + patchVersion = v: + if isAlpha v + then "" + else if length (splitVersion v) == 1 + then "${getVersion v}prod" + else getVersion v; - v1 = patchVersion ver1; - v2 = patchVersion ver2; - in + v1 = patchVersion ver1; + v2 = patchVersion ver2; + in builtins.compareVersions v1 v2; - fixJSON = replaceStrings ["\\u"] ["u"]; + fixJSON = replaceStrings [ "\\u" ] [ "u" ]; fetchSpecs = path: builtins.fromJSON (fixJSON (builtins.readFile path)); - genDefinitions = swagger: - with gen; - mapAttrs - ( - _name: definition: - # if $ref is in definition it means it's an alias of other definition - if hasAttr "$ref" definition - then definitions."${refDefinition definition}" - else if !(hasAttr "properties" definition) - then {} - # in other case it's an actual definition - else { - options = - mapAttrs - ( - propName: property: let - isRequired = elem propName (definition.required or []); + genDefinitions = swagger: with gen; mapAttrs + (_name: definition: + # if $ref is in definition it means it's an alias of other definition + if hasAttr "$ref" definition + then definitions."${refDefinition definition}" + else if !(hasAttr "properties" definition) + then { } + # in other case it's an actual definition + else { + options = + mapAttrs + ( + propName: property: + let + isRequired = elem propName (definition.required or [ ]); requiredOrNot = type: if isRequired then type @@ -146,43 +133,47 @@ with lib; let # if property has an array type else if property.type == "array" then - # if reference is in items it can reference other type of another - # definition + # if reference is in items it can reference other type of another + # definition if hasAttr "$ref" property.items then - # if it is a reference to simple type + # if it is a reference to simple type if hasTypeMapping swagger.definitions.${refDefinition property.items} then { type = requiredOrNot (types.listOf (mapType swagger.definitions.${refDefinition property.items}.type)); } # if a reference is to complex type 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 "x-kubernetes-patch-merge-key" property) && (!(hasAttr "x-kubernetes-list-map-keys" property) || (property."x-kubernetes-list-map-keys" == [property."x-kubernetes-patch-merge-key"])) - then let - mergeKey = property."x-kubernetes-patch-merge-key"; - in { - type = requiredOrNot (coerceAttrsOfSubmodulesToListByKey (refDefinition property.items) mergeKey []); - apply = attrsToList; - } + # 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 "x-kubernetes-patch-merge-key" property) && (!(hasAttr "x-kubernetes-list-map-keys" property) || (property."x-kubernetes-list-map-keys" == [ property."x-kubernetes-patch-merge-key" ])) + then + let + mergeKey = property."x-kubernetes-patch-merge-key"; + in + { + type = requiredOrNot (coerceAttrsOfSubmodulesToListByKey (refDefinition property.items) mergeKey [ ]); + apply = attrsToList; + } # in other case it's a simple list 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. + # 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 - 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 [] - )); - apply = attrsToList; - } + 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 [ ] + )); + apply = attrsToList; + } else { type = if (refDefinition property.items) == _name @@ -195,7 +186,7 @@ with lib; let } else if property.type == "object" && hasAttr "additionalProperties" property then - # if it is a reference to simple type + # if it is a reference to simple type if ( hasAttr "$ref" property.additionalProperties @@ -221,63 +212,60 @@ with lib; let type = requiredOrNot (mapType property); }; in - mkOption ({ - description = property.description or ""; - } - // optionProperties) - ) - definition.properties; - config = let - optionalProps = - filterAttrs + mkOption ({ + description = property.description or ""; + } + // optionProperties) + ) + definition.properties; + config = + let + optionalProps = + filterAttrs ( propName: _property: - !(elem propName (definition.required or [])) + !(elem propName (definition.required or [ ])) ) definition.properties; - in - mapAttrs (_name: _property: mkOverride 1002 null) optionalProps; - } - ) - swagger.definitions; + in + mapAttrs (_name: _property: mkOverride 1002 null) optionalProps; + } + ) + swagger.definitions; - mapCharPairs = f: s1: s2: - concatStrings (imap0 - ( - i: c1: - f i c1 ( - if i >= stringLength s2 - then "" - else elemAt (stringToCharacters s2) i - ) + mapCharPairs = f: s1: s2: concatStrings (imap0 + (i: c1: + f i c1 ( + if i >= stringLength s2 + then "" + else elemAt (stringToCharacters s2) i ) - (stringToCharacters s1)); + ) + (stringToCharacters s1)); - getAttrName = resource: kind: - mapCharPairs - ( - i: c1: c2: - if hasPrefix "API" kind && i == 0 - then "A" - else if i == 0 - then c1 - else if c2 == "" || (toLower c2) != c1 - then c1 - else c2 + getAttrName = resource: kind: mapCharPairs + (i: c1: c2: + if hasPrefix "API" kind && i == 0 + then "A" + else if i == 0 + then c1 + else if c2 == "" || (toLower c2) != c1 + then c1 + else c2 ) resource kind; - genResourceTypes = swagger: - mapAttrs' - (name: path: let - ref = refType (head path.post.parameters).schema; - group' = path.post."x-kubernetes-group-version-kind".group; - version' = path.post."x-kubernetes-group-version-kind".version; - kind' = path.post."x-kubernetes-group-version-kind".kind; - name' = last (splitString "/" name); - attrName = getAttrName name' kind'; - in + genResourceTypes = swagger: mapAttrs' + (name: path: + let + ref = refType (head path.post.parameters).schema; + group' = path.post."x-kubernetes-group-version-kind".group; + version' = path.post."x-kubernetes-group-version-kind".version; + kind' = path.post."x-kubernetes-group-version-kind".kind; + name' = last (splitString "/" name); + attrName = getAttrName name' kind'; + in nameValuePair ref { inherit ref attrName; @@ -309,37 +297,34 @@ with lib; let }) resourceTypes); - resourcesTypesByKindSortByVersion = - mapAttrs - ( - _kind: resourceTypes: - reverseList (sort - ( - r1: r2: - compareVersions r1.version r2.version > 0 - ) - resourceTypes) + resourcesTypesByKindSortByVersion = mapAttrs + (_kind: resourceTypes: + reverseList (sort + ( + r1: r2: + compareVersions r1.version r2.version > 0 + ) + resourceTypes) ) resourceTypesByKind; - latestResourceTypesByKind = - mapAttrs (_kind: last) resourcesTypesByKindSortByVersion; + latestResourceTypesByKind = mapAttrs (_kind: last) resourcesTypesByKindSortByVersion; genResourceOptions = resource: with gen; let submoduleForDefinition' = definition: submoduleForDefinition - definition.ref - definition.name - definition.kind - definition.group - definition.version; + definition.ref + definition.name + definition.kind + definition.group + definition.version; in - mkOption { - inherit (resource) description; - type = types.attrsOf (submoduleForDefinition' resource); - default = {}; - }; + mkOption { + inherit (resource) description; + type = types.attrsOf (submoduleForDefinition' resource); + default = { }; + }; generated = '' # This file was generated with kubenix k8s generator, do not edit @@ -530,14 +515,14 @@ with lib; let } ''; in - pkgs.runCommand "k8s-${name}-gen.nix" - { - buildInputs = [pkgs.nixpkgs-fmt]; - } '' - cat << 'GENERATED' > ./raw - ${generated} - GENERATED +pkgs.runCommand "k8s-${name}-gen.nix" +{ + buildInputs = [ pkgs.nixpkgs-fmt ]; +} '' + cat << 'GENERATED' > ./raw + ${generated} + GENERATED - nixpkgs-fmt ./raw - cp ./raw $out - '' + nixpkgs-fmt ./raw + cp ./raw $out +'' diff --git a/pkgs/kubenix.nix b/pkgs/kubenix.nix index b0ba479..8cf93d5 100644 --- a/pkgs/kubenix.nix +++ b/pkgs/kubenix.nix @@ -1,99 +1,95 @@ -{ - kubectl, - vals, - colordiff, - evalModules, - runCommand, - writeShellScript, - module ? {}, - specialArgs ? {}, -}: let - kubernetes = - (evalModules { - inherit module specialArgs; - }) - .config - .kubernetes - or {}; +{ kubectl +, vals +, colordiff +, evalModules +, runCommand +, writeShellScript +, module ? { } +, specialArgs ? { } +}: +let + kubernetes = (evalModules { + inherit module specialArgs; + }).config.kubernetes or { }; in - runCommand "kubenix" - { - kubeconfig = kubernetes.kubeconfig or ""; - result = kubernetes.result or ""; +runCommand "kubenix" +{ + kubeconfig = kubernetes.kubeconfig or ""; + result = kubernetes.result or ""; - # kubectl does some parsing which removes the -I flag so - # as workaround, we write to a script and call that - # https://github.com/kubernetes/kubernetes/pull/108199#issuecomment-1058405404 - diff = writeShellScript "kubenix-diff" '' - ${colordiff}/bin/colordiff --nobanner -N -u -I ' kubenix/hash: ' -I ' generation: ' $@ - ''; - } '' - set -euo pipefail - mkdir -p $out/bin + # kubectl does some parsing which removes the -I flag so + # as workaround, we write to a script and call that + # https://github.com/kubernetes/kubernetes/pull/108199#issuecomment-1058405404 + diff = writeShellScript "kubenix-diff" '' + ${colordiff}/bin/colordiff --nobanner -N -u -I ' kubenix/hash: ' -I ' generation: ' $@ + ''; +} '' + set -euo pipefail + mkdir -p $out/bin - # write the manifests for use with `nix build` - ln -s $result $out/manifest.json + # write the manifests for use with `nix build` + ln -s $result $out/manifest.json - # create a script for `nix run` - cat < $out/bin/kubenix - set -uo pipefail + # create a script for `nix run` + cat < $out/bin/kubenix + set -uo pipefail - export KUBECONFIG=$kubeconfig - export KUBECTL_EXTERNAL_DIFF=$diff + export KUBECONFIG=$kubeconfig + export KUBECTL_EXTERNAL_DIFF=$diff - function _help() { - echo " - kubenix - Kubernetes management with Nix + function _help() { + echo " + kubenix - Kubernetes management with Nix - commands: - "" - run diff, prompt for confirmation, then apply - apply - create resources in target cluster - diff - show a diff between configured and live resources - render - print resource manifests to stdout + commands: + "" - run diff, prompt for confirmation, then apply + apply - create resources in target cluster + diff - show a diff between configured and live resources + render - print resource manifests to stdout - options: - -h --help - show this menu - " - } + options: + -h --help - show this menu + " + } - function _kubectl() { - ${vals}/bin/vals eval -fail-on-missing-key-in-map < $result | ${kubectl}/bin/kubectl \$@ - } + function _kubectl() { + ${vals}/bin/vals eval -fail-on-missing-key-in-map < $result | ${kubectl}/bin/kubectl \$@ + } - # if no args given, add empty string - [ \$# -eq 0 ] && set -- "" + # if no args given, add empty string + [ \$# -eq 0 ] && set -- "" - # parse arguments - while test \$# -gt 0; do - case "\$1" in + # parse arguments + while test \$# -gt 0; do + case "\$1" in - -h|--help) - _help - exit 0;; + -h|--help) + _help + exit 0;; - "") - _kubectl diff -f - --prune - if [[ "\$?" -eq 1 ]]; then - read -p 'apply? [y/N]: ' response - [[ \$response == "y" ]] && _kubectl apply -f - --prune --all - fi - shift;; + "") + _kubectl diff -f - --prune + if [[ "\$?" -eq 1 ]]; then + read -p 'apply? [y/N]: ' response + [[ \$response == "y" ]] && _kubectl apply -f - --prune --all + fi + shift;; - render) - ${vals}/bin/vals eval < $result - shift;; + render) + ${vals}/bin/vals eval < $result + shift;; - apply|diff) - _kubectl \$@ -f - --prune - shift;; + apply|diff) + _kubectl \$@ -f - --prune + shift;; - *) - _kubectl \$@ - shift;; + *) + _kubectl \$@ + shift;; - esac - done + esac + done - EOF - chmod +x $out/bin/kubenix - '' + EOF + chmod +x $out/bin/kubenix +'' diff --git a/tests/default.nix b/tests/default.nix index 30ef640..1f01019 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -1,20 +1,15 @@ -{ - system ? builtins.currentSystem, - evalModules ? (import ../. {}).evalModules.${system}, -}: { - k8sVersion ? "1.23", - registry ? throw "Registry url not defined", - doThrowError ? true, # whether any testing error should throw an error - enabledTests ? null, -}: let +{ system ? builtins.currentSystem, evalModules ? (import ../. { }).evalModules.${system} }: +{ k8sVersion ? "1.23" +, registry ? throw "Registry url not defined" +, doThrowError ? true + # whether any testing error should throw an error +, enabledTests ? null +}: +let inherit ((evalModules { - module = { - kubenix, - pkgs, - ... - }: { - imports = [kubenix.modules.testing]; + module = { kubenix, pkgs, ... }: { + imports = [ kubenix.modules.testing ]; testing = { inherit doThrowError enabledTests; @@ -38,21 +33,19 @@ ./submodules/passthru.nix ]; - args = {images = pkgs.callPackage ./images.nix {};}; + args = { images = pkgs.callPackage ./images.nix { }; }; docker.registryUrl = registry; - common = [ - { - features = ["k8s"]; - options = { - kubernetes.version = k8sVersion; - }; - } - ]; + common = [{ + features = [ "k8s" ]; + options = { + kubernetes.version = k8sVersion; + }; + }]; }; }; })) config ; in - config.testing // {recurseForDerivations = true;} +config.testing // { recurseForDerivations = true; } diff --git a/tests/helm/simple.nix b/tests/helm/simple.nix index 1bba027..2efabb1 100644 --- a/tests/helm/simple.nix +++ b/tests/helm/simple.nix @@ -1,11 +1,4 @@ -{ - config, - lib, - pkgs, - kubenix, - helm, - ... -}: +{ config, lib, pkgs, kubenix, helm, ... }: with lib; with kubenix.lib; with pkgs.dockerTools; let @@ -35,8 +28,9 @@ with pkgs.dockerTools; let finalImageName = "docker.io/bitnami/bitnami-shell"; finalImageTag = "10"; }; -in { - imports = [kubenix.modules.test kubenix.modules.helm kubenix.modules.k8s kubenix.modules.docker]; +in +{ + imports = [ kubenix.modules.test kubenix.modules.helm kubenix.modules.k8s kubenix.modules.docker ]; docker.images = { postgresql.image = postgresql; diff --git a/tests/images.nix b/tests/images.nix index b901b3c..1c39a1b 100644 --- a/tests/images.nix +++ b/tests/images.nix @@ -1,44 +1,40 @@ -{ - pkgs, - dockerTools, - lib, - ... -}: +{ pkgs, dockerTools, lib, ... }: with lib; { curl = dockerTools.buildLayeredImage { name = "curl"; tag = "latest"; - config.Cmd = ["${pkgs.bash}" "-c" "sleep infinity"]; - contents = [pkgs.bash pkgs.curl pkgs.cacert]; + config.Cmd = [ "${pkgs.bash}" "-c" "sleep infinity" ]; + contents = [ pkgs.bash pkgs.curl pkgs.cacert ]; }; - nginx = let - nginxPort = "80"; - nginxConf = pkgs.writeText "nginx.conf" '' - user nginx nginx; - daemon off; - error_log /dev/stdout info; - pid /dev/null; - events {} - http { - access_log /dev/stdout; - server { - listen ${nginxPort}; - index index.html; - location / { - root ${nginxWebRoot}; + nginx = + let + nginxPort = "80"; + nginxConf = pkgs.writeText "nginx.conf" '' + user nginx nginx; + daemon off; + error_log /dev/stdout info; + pid /dev/null; + events {} + http { + access_log /dev/stdout; + server { + listen ${nginxPort}; + index index.html; + location / { + root ${nginxWebRoot}; + } } } - } - ''; - nginxWebRoot = pkgs.writeTextDir "index.html" '' -

Hello from NGINX

- ''; - in + ''; + nginxWebRoot = pkgs.writeTextDir "index.html" '' +

Hello from NGINX

+ ''; + in dockerTools.buildLayeredImage { name = "xtruder/nginx"; tag = "latest"; - contents = [pkgs.nginx]; + contents = [ pkgs.nginx ]; extraCommands = '' mkdir -p etc chmod u+w etc @@ -50,9 +46,9 @@ with lib; { echo "nginx:x:1000:nginx" > etc/group ''; config = { - Cmd = ["nginx" "-c" nginxConf]; + Cmd = [ "nginx" "-c" nginxConf ]; ExposedPorts = { - "${nginxPort}/tcp" = {}; + "${nginxPort}/tcp" = { }; }; }; }; diff --git a/tests/istio/bookinfo.nix b/tests/istio/bookinfo.nix index 36b4b7f..76554eb 100644 --- a/tests/istio/bookinfo.nix +++ b/tests/istio/bookinfo.nix @@ -1,5 +1,5 @@ -{kubenix, ...}: { - imports = with kubenix.modules; [test k8s istio]; +{ kubenix, ... }: { + imports = with kubenix.modules; [ test k8s istio ]; test = { name = "istio-bookinfo"; @@ -17,7 +17,7 @@ name = "http"; protocol = "HTTP"; }; - hosts = ["*"]; + hosts = [ "*" ]; } ]; }; @@ -25,8 +25,8 @@ VirtualService.bookinfo = { spec = { - hosts = ["*"]; - gateways = ["bookinfo-gateway"]; + hosts = [ "*" ]; + gateways = [ "bookinfo-gateway" ]; http = [ { match = [ diff --git a/tests/k8s/crd.nix b/tests/k8s/crd.nix index 11e238a..8b3f0e7 100644 --- a/tests/k8s/crd.nix +++ b/tests/k8s/crd.nix @@ -1,24 +1,18 @@ -{ - config, - lib, - kubenix, - ... -}: +{ config, lib, kubenix, ... }: with lib; let latestCrontab = config.kubernetes.api.resources.cronTabs.latest; -in { - imports = with kubenix.modules; [test k8s]; +in +{ + imports = with kubenix.modules; [ test k8s ]; test = { name = "k8s-crd"; description = "Simple test tesing CRD"; enable = builtins.compareVersions config.kubernetes.version "1.8" >= 0; - assertions = [ - { - message = "Custom resource should have correct version set"; - assertion = latestCrontab.apiVersion == "stable.example.com/v2"; - } - ]; + assertions = [{ + message = "Custom resource should have correct version set"; + assertion = latestCrontab.apiVersion == "stable.example.com/v2"; + }]; script = '' @pytest.mark.applymanifest('${config.kubernetes.resultYAML}') def test_testing_module(kube): diff --git a/tests/k8s/defaults.nix b/tests/k8s/defaults.nix index 2cb8b1c..612b717 100644 --- a/tests/k8s/defaults.nix +++ b/tests/k8s/defaults.nix @@ -1,14 +1,10 @@ -{ - config, - lib, - kubenix, - ... -}: +{ config, lib, kubenix, ... }: with lib; let inherit (config.kubernetes.api.resources.pods) pod1; inherit (config.kubernetes.api.resources.pods) pod2; -in { - imports = with kubenix.modules; [test k8s]; +in +{ + imports = with kubenix.modules; [ test k8s ]; test = { name = "k8s-defaults"; @@ -29,7 +25,7 @@ in { ]; }; - kubernetes.resources.pods.pod1 = {}; + kubernetes.resources.pods.pod1 = { }; kubernetes.resources.pods.pod2 = { metadata.labels.custom-label = "value"; @@ -48,7 +44,7 @@ in { } { resource = "pods"; - default = {config, ...}: { + default = { config, ... }: { config.metadata.annotations = mkIf (config.metadata.labels ? "custom-label") { conditional-annotation = "value"; }; diff --git a/tests/k8s/deployment.nix b/tests/k8s/deployment.nix index 768c242..6e9bb76 100644 --- a/tests/k8s/deployment.nix +++ b/tests/k8s/deployment.nix @@ -1,11 +1,4 @@ -{ - config, - lib, - kubenix, - images, - test, - ... -}: +{ config, lib, kubenix, images, test, ... }: with lib; let cfg = config.kubernetes.api.resources.deployments.nginx; image = images.nginx; @@ -17,17 +10,16 @@ with lib; let inherit (config.kubernetes) namespace; name = "curl"; }; - spec.containers = [ - { - name = "curl"; - image = config.docker.images.curl.path; - args = ["curl" "--retry" "20" "--retry-connrefused" "http://nginx"]; - } - ]; + spec.containers = [{ + name = "curl"; + image = config.docker.images.curl.path; + args = [ "curl" "--retry" "20" "--retry-connrefused" "http://nginx" ]; + }]; spec.restartPolicy = "Never"; }); -in { - imports = [kubenix.modules.test kubenix.modules.k8s kubenix.modules.docker]; +in +{ + imports = [ kubenix.modules.test kubenix.modules.k8s kubenix.modules.docker ]; test = { name = "k8s-deployment"; diff --git a/tests/k8s/imports.nix b/tests/k8s/imports.nix index 92f35c3..89d8588 100644 --- a/tests/k8s/imports.nix +++ b/tests/k8s/imports.nix @@ -1,14 +1,10 @@ -{ - config, - lib, - kubenix, - ... -}: +{ config, lib, kubenix, ... }: with lib; let pod = config.kubernetes.api.resources.core.v1.Pod.test; deployment = config.kubernetes.api.resources.apps.v1.Deployment.nginx-deployment; -in { - imports = with kubenix.modules; [test k8s]; +in +{ + imports = with kubenix.modules; [ test k8s ]; test = { name = "k8s-imports"; diff --git a/tests/k8s/order.nix b/tests/k8s/order.nix index 552c03b..d1df5c7 100644 --- a/tests/k8s/order.nix +++ b/tests/k8s/order.nix @@ -1,11 +1,6 @@ -{ - config, - lib, - kubenix, - ... -}: +{ config, lib, kubenix, ... }: with lib; { - imports = with kubenix.modules; [test k8s]; + imports = with kubenix.modules; [ test k8s ]; test = { name = "k8s-order"; @@ -39,7 +34,7 @@ with lib; { plural = "crontabs"; singular = "crontab"; kind = "CronTab"; - shortNames = ["ct"]; + shortNames = [ "ct" ]; }; }; }; @@ -62,7 +57,7 @@ with lib; { } ]; - kubernetes.resources.namespaces.test = {}; + kubernetes.resources.namespaces.test = { }; kubernetes.resources."stable.example.com"."v1".CronTab.crontab.spec.schedule = "* * * * *"; } diff --git a/tests/k8s/simple.nix b/tests/k8s/simple.nix index 4359e66..f51fe3b 100644 --- a/tests/k8s/simple.nix +++ b/tests/k8s/simple.nix @@ -1,11 +1,9 @@ -{ - config, - kubenix, - ... -}: let +{ config, kubenix, ... }: +let cfg = config.kubernetes.api.resources.pods.nginx; -in { - imports = [kubenix.modules.test kubenix.modules.k8s]; +in +{ + imports = [ kubenix.modules.test kubenix.modules.k8s ]; test = { name = "k8s-simple"; @@ -22,5 +20,5 @@ in { ]; }; - kubernetes.resources.pods.nginx = {}; + kubernetes.resources.pods.nginx = { }; } diff --git a/tests/k8s/submodule.nix b/tests/k8s/submodule.nix index 682903a..44b3cb4 100644 --- a/tests/k8s/submodule.nix +++ b/tests/k8s/submodule.nix @@ -1,13 +1,6 @@ -{ - name, - config, - lib, - kubenix, - images, - ... -}: +{ name, config, lib, kubenix, images, ... }: with lib; { - imports = with kubenix.modules; [test submodules k8s docker]; + imports = with kubenix.modules; [ test submodules k8s docker ]; test = { name = "k8s-submodule"; @@ -26,41 +19,33 @@ with lib; { kubernetes.namespace = "test-namespace"; - submodules.imports = [ - { - module = { - name, - config, - ... - }: { - imports = with kubenix.modules; [submodule k8s docker]; + submodules.imports = [{ + module = { name, config, ... }: { + imports = with kubenix.modules; [ submodule k8s docker ]; - config = { - submodule = { - name = "test-submodule"; - passthru = { - kubernetes.objects = config.kubernetes.objects; - docker.images = config.docker.images; - }; + config = { + submodule = { + name = "test-submodule"; + passthru = { + kubernetes.objects = config.kubernetes.objects; + docker.images = config.docker.images; }; - - kubernetes.resources.pods.nginx = { - metadata.name = name; - spec.containers.nginx.image = config.docker.images.nginx.path; - }; - - docker.images.nginx.image = images.nginx; }; - }; - } - ]; - kubernetes.api.defaults = [ - { - propagate = true; - default.metadata.labels.my-label = "my-value"; - } - ]; + kubernetes.resources.pods.nginx = { + metadata.name = name; + spec.containers.nginx.image = config.docker.images.nginx.path; + }; + + docker.images.nginx.image = images.nginx; + }; + }; + }]; + + kubernetes.api.defaults = [{ + propagate = true; + default.metadata.labels.my-label = "my-value"; + }]; submodules.instances.passthru = { submodule = "test-submodule"; diff --git a/tests/submodules/defaults.nix b/tests/submodules/defaults.nix index 85dca3b..a2502f7 100644 --- a/tests/submodules/defaults.nix +++ b/tests/submodules/defaults.nix @@ -1,10 +1,4 @@ -{ - name, - config, - lib, - kubenix, - ... -}: +{ name, config, lib, kubenix, ... }: with lib; let inherit (config.submodules.instances) instance1; inherit (config.submodules.instances) instance2; @@ -13,8 +7,8 @@ with lib; let inherit (config.submodules.instances) instance5; inherit (config.submodules.instances) versioned-submodule; - submodule = {...}: { - imports = [kubenix.modules.submodule]; + submodule = { ... }: { + imports = [ kubenix.modules.submodule ]; options.submodule.args = { value = mkOption { @@ -28,8 +22,9 @@ with lib; let }; }; }; -in { - imports = with kubenix.modules; [test submodules]; +in +{ + imports = with kubenix.modules; [ test submodules ]; test = { name = "submodules-defaults"; @@ -80,7 +75,7 @@ in { { submodule = { name = "submodule1"; - tags = ["tag1"]; + tags = [ "tag1" ]; }; } ]; @@ -91,7 +86,7 @@ in { { submodule = { name = "submodule2"; - tags = ["tag2"]; + tags = [ "tag2" ]; }; } ]; @@ -102,7 +97,7 @@ in { { submodule = { name = "submodule3"; - tags = ["tag2"]; + tags = [ "tag2" ]; }; } ]; @@ -146,11 +141,11 @@ in { default.submodule.args.defaultValue = mkDefault "value"; } { - tags = ["tag1"]; + tags = [ "tag1" ]; default.submodule.args.value = mkDefault "value1"; } { - tags = ["tag2"]; + tags = [ "tag2" ]; default.submodule.args.value = mkDefault "value2"; } { @@ -158,7 +153,7 @@ in { default.submodule.args.value = mkDefault "value4"; } { - default = {config, ...}: { + default = { config, ... }: { submodule.args.defaultValue = mkIf (config.submodule.args.value == "custom-value") "my-custom-value"; }; } diff --git a/tests/submodules/exports.nix b/tests/submodules/exports.nix index 83aaf0e..f097160 100644 --- a/tests/submodules/exports.nix +++ b/tests/submodules/exports.nix @@ -1,14 +1,7 @@ -{ - name, - config, - lib, - kubenix, - subm-lib, - ... -}: +{ name, config, lib, kubenix, subm-lib, ... }: with lib; let submodule = { - imports = [kubenix.modules.submodule]; + imports = [ kubenix.modules.submodule ]; config.submodule = { name = "subm"; @@ -17,8 +10,9 @@ with lib; let }; }; }; -in { - imports = with kubenix.modules; [test submodules]; +in +{ + imports = with kubenix.modules; [ test submodules ]; test = { name = "submodules-exports"; @@ -33,7 +27,7 @@ in { submodules.imports = [ { - modules = [submodule]; + modules = [ submodule ]; exportAs = "subm-lib"; } ]; diff --git a/tests/submodules/passthru.nix b/tests/submodules/passthru.nix index 93c3f21..4cec5f2 100644 --- a/tests/submodules/passthru.nix +++ b/tests/submodules/passthru.nix @@ -1,27 +1,22 @@ -{ - name, - config, - lib, - kubenix, - ... -}: +{ name, config, lib, kubenix, ... }: with lib; let - submodule = {name, ...}: { - imports = [kubenix.modules.submodule]; + submodule = { name, ... }: { + imports = [ kubenix.modules.submodule ]; config.submodule = { name = "subm"; passthru.global.${name} = "true"; }; }; -in { - imports = with kubenix.modules; [test submodules]; +in +{ + imports = with kubenix.modules; [ test submodules ]; options = { global = mkOption { description = "Global value"; type = types.attrs; - default = {}; + default = { }; }; }; @@ -45,11 +40,9 @@ in { ]; }; - submodules.imports = [ - { - modules = [submodule]; - } - ]; + submodules.imports = [{ + modules = [ submodule ]; + }]; submodules.instances.inst1 = { submodule = "subm"; diff --git a/tests/submodules/simple.nix b/tests/submodules/simple.nix index a109abf..323dfae 100644 --- a/tests/submodules/simple.nix +++ b/tests/submodules/simple.nix @@ -1,15 +1,10 @@ -{ - name, - config, - lib, - kubenix, - ... -}: +{ name, config, lib, kubenix, ... }: with lib; let cfg = config.submodules.instances.instance; inherit (cfg.config.submodule) args; -in { - imports = with kubenix.modules; [test submodules]; +in +{ + imports = with kubenix.modules; [ test submodules ]; test = { name = "submodules-simple"; @@ -45,8 +40,8 @@ in { submodules.propagate.enable = true; submodules.imports = [ { - module = {submodule, ...}: { - imports = [kubenix.modules.submodule]; + module = { submodule, ... }: { + imports = [ kubenix.modules.submodule ]; options.submodule.args = { name = mkOption { @@ -62,7 +57,7 @@ in { config = { submodule.name = "submodule"; - submodule.tags = ["tag"]; + submodule.tags = [ "tag" ]; }; }; } diff --git a/tests/submodules/versioning.nix b/tests/submodules/versioning.nix index 450ae42..aa6e6df 100644 --- a/tests/submodules/versioning.nix +++ b/tests/submodules/versioning.nix @@ -1,17 +1,11 @@ -{ - name, - config, - lib, - kubenix, - ... -}: +{ name, config, lib, kubenix, ... }: with lib; let inst-exact = config.submodules.instances.inst-exact.config; inst-regex = config.submodules.instances.inst-regex.config; inst-latest = config.submodules.instances.inst-latest.config; submodule = { - imports = [kubenix.modules.submodule]; + imports = [ kubenix.modules.submodule ]; options.version = mkOption { type = types.str; @@ -20,8 +14,9 @@ with lib; let config.submodule.name = "subm"; }; -in { - imports = with kubenix.modules; [test submodules]; +in +{ + imports = with kubenix.modules; [ test submodules ]; test = { name = "submodules-versioning"; diff --git a/versions.nix b/versions.nix index ae304aa..301dd60 100644 --- a/versions.nix +++ b/versions.nix @@ -12,19 +12,17 @@ let "1.26.5" = "sha256:1dyqvggyvqw3z9sml2x06v1l9kynqcs8bkfrkx8jy81gkvg7qxdi"; "1.27.2" = "sha256:1yqcds6lvpnvc5dsv9pnvp5qb3kc5y6cdgx827szljdlwf51wd15"; }; -in { +in +{ inherit full; # sorted list of major.minor version numbers # NOTE: avoiding pulling in lib here (not for any good reason) - versions = - map (v: let - arr = builtins.splitVersion v; - in ( - builtins.concatStringsSep "." - [ - (builtins.elemAt arr 0) - (builtins.elemAt arr 1) + versions = with builtins; map + (v: ( + concatStringsSep "." [ + (elemAt (splitVersion v) 0) + (elemAt (splitVersion v) 1) ] )) - (builtins.attrNames full); + (attrNames full); }