feat(k8s): allow to define customTypes from CRDs

This commit is contained in:
Jaka Hudoklin 2019-10-20 13:36:10 +02:00
parent baea3cc3b3
commit 086780088c
No known key found for this signature in database
GPG key ID: D1F18234B07BD6E2
4 changed files with 144 additions and 59 deletions

View file

@ -164,7 +164,7 @@ in {
config = {
kubernetes.api.defaults = mapAttrsToList (attrName: default: let
type = head (filter (type: type.attrName == attrName) config.kubernetes.api.types);
type = head (mapAttrsToList (_: v: v) (filterAttrs (_: type: type.attrName == attrName) config.kubernetes.api.types));
in {
default = { imports = default; };
} // (if (attrName == "all") then {} else {
@ -184,6 +184,9 @@ in {
# custom resources are now included in normal resources, so just make an alias
kubernetes.customResources = mkAliasDefinitions options.kubernetes.resources;
# create custom types from CRDs was old behavior
kubernetes.createCustomTypesFromCRDs = true;
kubernetes.defaultModuleConfiguration.all = {
_file = head options.kubernetes.defaultModuleConfiguration.files;
config.kubernetes.version = mkDefault config.kubernetes.version;