feat(k8s): sort resources, put CustomResourceDefinition first

This commit is contained in:
Jaka Hudoklin 2019-02-20 09:28:12 +01:00
parent 2f7c0385ae
commit dd9b3c3a5b
No known key found for this signature in database
GPG key ID: 6A08896BFD32BD95

View file

@ -176,7 +176,9 @@ in {
options.kubernetes.objects = mkOption {
description = "Attribute set of kubernetes objects";
type = types.listOf types.attrs;
apply = unique;
apply = items: sort (r1: r2:
if r1.kind == "CustomResourceDefinition" || r2.kind == "CustomResourceDefinition" then true else false
) (moduleToAttrs (unique items));
default = [];
};