mirror of
https://github.com/TECHNOFAB11/kubenix.git
synced 2025-12-12 08:00:06 +01:00
fix(lib/k8s): fix mkSecretOption
This commit is contained in:
parent
33d797dae8
commit
ccb1b8e538
1 changed files with 7 additions and 5 deletions
12
lib/k8s.nix
12
lib/k8s.nix
|
|
@ -3,25 +3,27 @@
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
rec {
|
rec {
|
||||||
mkSecretOption = {description ? "", default ? null}: mkOption {
|
mkSecretOption = {description ? "", default ? {}}: mkOption ({
|
||||||
inherit description;
|
inherit description;
|
||||||
type = types.nullOr (types.submodule {
|
type = types.nullOr (types.submodule {
|
||||||
options = {
|
options = {
|
||||||
name = mkOption {
|
name = mkOption {
|
||||||
description = "Name of the secret where secret is stored";
|
description = "Name of the secret where secret is stored";
|
||||||
type = types.str;
|
type = types.str;
|
||||||
|
default = default.name or null;
|
||||||
};
|
};
|
||||||
|
|
||||||
key = mkOption {
|
key = mkOption {
|
||||||
description = "Name of the key where secret is stored";
|
description = "Name of the key where secret is stored";
|
||||||
type = types.str;
|
type = types.str;
|
||||||
|
default = default.key or null;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkDefault (if default == null then {} else default);
|
|
||||||
});
|
});
|
||||||
default = default;
|
default = {};
|
||||||
};
|
} // (optionalAttrs (default == null) {
|
||||||
|
default = null;
|
||||||
|
}));
|
||||||
|
|
||||||
secretToEnv = value: {
|
secretToEnv = value: {
|
||||||
valueFrom.secretKeyRef = {
|
valueFrom.secretKeyRef = {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue