helm: Same imroved error reporting as importyaml
This commit is contained in:
parent
67f221ef11
commit
f215aad2bc
1 changed files with 5 additions and 2 deletions
7
helm.nix
7
helm.nix
|
|
@ -51,6 +51,7 @@ in
|
|||
type = types.listOf settingsFormat.type;
|
||||
default = [ ];
|
||||
};
|
||||
# Do we really need this here? Doesn't Helm take care of this?
|
||||
overrideNamespace = lib.mkOption {
|
||||
description = "Override namespace for all namespaced resources";
|
||||
type = types.nullOr types.str;
|
||||
|
|
@ -128,8 +129,10 @@ in
|
|||
resource:
|
||||
let
|
||||
namespaced =
|
||||
globalConfig.kubernetes.namespacedMappings.${resource.kind} or throw
|
||||
"kind ${resource.kind} doesn't have a namespacedMapping";
|
||||
if lib.hasAttr resource.kind globalConfig.kubernetes.namespacedMappings then
|
||||
globalConfig.kubernetes.namespacedMappings.${resource.kind}
|
||||
else
|
||||
throw "kind ${resource.kind} doesn't have a namespacedMapping";
|
||||
in
|
||||
if namespaced then
|
||||
lib.recursiveUpdate resource { metadata.namespace = config.overrideNamespace; }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue