mirror of
https://github.com/TECHNOFAB11/kubenix.git
synced 2026-02-02 09:25:10 +01:00
helm: add noHooks option
This commit is contained in:
parent
9492528225
commit
67e1d98464
2 changed files with 15 additions and 1 deletions
|
|
@ -20,6 +20,8 @@ with lib;
|
||||||
kubeVersion ? null,
|
kubeVersion ? null,
|
||||||
# whether to include CRD
|
# whether to include CRD
|
||||||
includeCRDs ? false,
|
includeCRDs ? false,
|
||||||
|
# whether to include hooks
|
||||||
|
noHooks ? false,
|
||||||
}: let
|
}: let
|
||||||
valuesJsonFile = builtins.toFile "${name}-values.json" (builtins.toJSON values);
|
valuesJsonFile = builtins.toFile "${name}-values.json" (builtins.toJSON values);
|
||||||
in
|
in
|
||||||
|
|
@ -32,6 +34,7 @@ with lib;
|
||||||
${optionalString (namespace != null) "--namespace ${namespace}"} \
|
${optionalString (namespace != null) "--namespace ${namespace}"} \
|
||||||
${optionalString (values != {}) "-f ${valuesJsonFile}"} \
|
${optionalString (values != {}) "-f ${valuesJsonFile}"} \
|
||||||
${optionalString includeCRDs "--include-crds"} \
|
${optionalString includeCRDs "--include-crds"} \
|
||||||
|
${optionalString noHooks "--no-hooks"} \
|
||||||
${chart} >resources.yaml
|
${chart} >resources.yaml
|
||||||
|
|
||||||
# split multy yaml file into multiple files
|
# split multy yaml file into multiple files
|
||||||
|
|
|
||||||
|
|
@ -95,6 +95,17 @@ in {
|
||||||
default = false;
|
default = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
noHooks = mkOption {
|
||||||
|
description = ''
|
||||||
|
Wether to include Helm hooks.
|
||||||
|
|
||||||
|
Without this all hooks run immediately on apply since we are bypassing the Helm CLI.
|
||||||
|
However, some charts only have minor validation hooks (e.g., upgrade version skew validation) and are safe to ignore.
|
||||||
|
'';
|
||||||
|
type = types.bool;
|
||||||
|
default = false;
|
||||||
|
};
|
||||||
|
|
||||||
objects = mkOption {
|
objects = mkOption {
|
||||||
description = "Generated kubernetes objects";
|
description = "Generated kubernetes objects";
|
||||||
type = types.listOf types.attrs;
|
type = types.listOf types.attrs;
|
||||||
|
|
@ -109,7 +120,7 @@ in {
|
||||||
];
|
];
|
||||||
|
|
||||||
config.objects = importJSON (helm.chart2json {
|
config.objects = importJSON (helm.chart2json {
|
||||||
inherit (config) chart name namespace values kubeVersion includeCRDs;
|
inherit (config) chart name namespace values kubeVersion includeCRDs noHooks;
|
||||||
});
|
});
|
||||||
}));
|
}));
|
||||||
default = {};
|
default = {};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue