feat(lib): make explicit secretToEnv function that converts mkSecretOption to env

This commit is contained in:
Jaka Hudoklin 2017-12-29 10:20:19 +01:00
parent 699511bf54
commit 642a31b0d0
3 changed files with 10 additions and 12 deletions

View file

@ -15,10 +15,7 @@ with lib;
password = mkSecretOption {
description = "Nginx simple auth credentials";
default = {
key = "test";
name = "test";
};
default = null;
};
};
@ -32,7 +29,8 @@ with lib;
containerPort = config.port;
};
spec.template.spec.containers.nginx.env.name = mkIf (config.password != null) config.password;
spec.template.spec.containers.nginx.env.name =
mkIf (config.password != null) (secretToEnv config.password);
}
];