Add option for Helm --include-crds (#18)

This commit is contained in:
Felix Scheinost 2023-02-28 02:22:59 +01:00 committed by GitHub
parent b2feaf6b40
commit 919e4ec901
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 1 deletions

View file

@ -81,6 +81,20 @@ in {
default = true;
};
includeCRDs = mkOption {
description = ''
Whether to include CRDs.
Warning: Always including CRDs here is dangerous and can break CRs in your cluster as CRDs may be updated unintentionally.
An interactive `helm install` NEVER updates CRDs, only installs them when they are not existing.
See https://github.com/helm/community/blob/aa8e13054d91ee69857b13149a9652be09133a61/hips/hip-0011.md
Only set this to true if you know what you are doing and are manually checking the included CRDs for breaking changes whenever updating the Helm chart.
'';
type = types.bool;
default = false;
};
objects = mkOption {
description = "Generated kubernetes objects";
type = types.listOf types.attrs;
@ -95,7 +109,7 @@ in {
];
config.objects = importJSON (helm.chart2json {
inherit (config) chart name namespace values kubeVersion;
inherit (config) chart name namespace values kubeVersion includeCRDs;
});
}));
default = {};