feat(k8s): improve aliased resource naming

This commit is contained in:
Jaka Hudoklin 2019-09-27 18:28:24 +02:00
parent 3d149d6101
commit ec3f7ecb10
No known key found for this signature in database
GPG key ID: 11AA2A62319E4968
12 changed files with 808 additions and 790 deletions

View file

@ -322,6 +322,7 @@ in {
# import of yaml files
(map (i: let
# load yaml file
object = loadYAML i;
groupVersion = splitString "/" object.apiVersion;
name = object.metadata.name;
@ -331,7 +332,7 @@ in {
then "core" else head groupVersion;
kind = object.kind;
in {
${group}.${version}.${kind}.${name} = object;
resources.${group}.${version}.${kind}.${name} = object;
}) cfg.imports));
kubernetes.objects = mkMerge [
@ -341,13 +342,6 @@ in {
cfg.api.resources.${type.group}.${type.version}.${type.kind}
) cfg.api.types))
# latest resources
(flatten (map (type:
if type.name == null then []
else mapAttrsToList (name: resource: moduleToAttrs resource)
cfg.api.resources.${type.name}
) cfg.api.types))
# passthru of child kubernetes objects if passthru is enabled on submodule
# and submodule has k8s module loaded
(flatten (mapAttrsToList (_: submodule: