mirror of
https://github.com/TECHNOFAB11/kubenix.git
synced 2025-12-12 08:00:06 +01:00
feat(k8s): deprecate createCustomTypesFromCRDs, only support in legacy
This commit is contained in:
parent
13e47144fd
commit
3534f5fc61
2 changed files with 9 additions and 19 deletions
|
|
@ -242,12 +242,6 @@ in {
|
||||||
type = types.attrsOf types.attrs;
|
type = types.attrsOf types.attrs;
|
||||||
};
|
};
|
||||||
|
|
||||||
createCustomTypesFromCRDs = mkOption {
|
|
||||||
description = "Whether to create customTypes from custom resource definitions";
|
|
||||||
type = types.bool;
|
|
||||||
default = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
customTypes = mkOption {
|
customTypes = mkOption {
|
||||||
description = "List of custom resource types to make API for";
|
description = "List of custom resource types to make API for";
|
||||||
type = coerceListOfSubmodulesToAttrs {
|
type = coerceListOfSubmodulesToAttrs {
|
||||||
|
|
@ -389,17 +383,6 @@ in {
|
||||||
cfg.api.resources.${type.group}.${type.version}.${type.kind}
|
cfg.api.resources.${type.group}.${type.version}.${type.kind}
|
||||||
) cfg.api.types);
|
) cfg.api.types);
|
||||||
|
|
||||||
# custom types created from customResourceDefinitions
|
|
||||||
kubernetes.customTypes = mkIf cfg.createCustomTypesFromCRDs (
|
|
||||||
mapAttrsToList (name: crd: {
|
|
||||||
group = crd.spec.group;
|
|
||||||
version = crd.spec.version;
|
|
||||||
kind = crd.spec.names.kind;
|
|
||||||
name = crd.spec.names.plural;
|
|
||||||
attrName = mkOptionDefault name;
|
|
||||||
}) (cfg.resources.customResourceDefinitions or {})
|
|
||||||
);
|
|
||||||
|
|
||||||
kubernetes.generated = k8s.mkHashedList {
|
kubernetes.generated = k8s.mkHashedList {
|
||||||
items = config.kubernetes.objects;
|
items = config.kubernetes.objects;
|
||||||
labels."kubenix/project-name" = config.kubenix.project;
|
labels."kubenix/project-name" = config.kubenix.project;
|
||||||
|
|
|
||||||
|
|
@ -190,8 +190,15 @@ in {
|
||||||
) config.kubernetes.modules
|
) config.kubernetes.modules
|
||||||
);
|
);
|
||||||
|
|
||||||
# create custom types from CRDs was old behavior
|
# custom types created from customResourceDefinitions
|
||||||
createCustomTypesFromCRDs = true;
|
customTypes =
|
||||||
|
mapAttrsToList (name: crd: {
|
||||||
|
group = crd.spec.group;
|
||||||
|
version = crd.spec.version;
|
||||||
|
kind = crd.spec.names.kind;
|
||||||
|
name = crd.spec.names.plural;
|
||||||
|
attrName = mkOptionDefault name;
|
||||||
|
}) (config.kubernetes.resources.customResourceDefinitions or {});
|
||||||
|
|
||||||
defaultModuleConfiguration.all = {
|
defaultModuleConfiguration.all = {
|
||||||
_file = head options.kubernetes.defaultModuleConfiguration.files;
|
_file = head options.kubernetes.defaultModuleConfiguration.files;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue