Clarified password env variable missing error
All checks were successful
kustomization/siranga/3850ce12 reconciliation succeeded
Build and deploy / Build container and manifests (push) Successful in 5m49s

This commit is contained in:
Dreaded_X 2025-04-22 10:47:18 +02:00
parent 5a7652f3a4
commit ac15ce1d38
Signed by: Dreaded_X
GPG Key ID: 5A0CBFE3C3377FAA

View File

@ -44,8 +44,9 @@ impl Ldap {
let password = std::env::var("LDAP_PASSWORD_FILE").map_or_else( let password = std::env::var("LDAP_PASSWORD_FILE").map_or_else(
|_| { |_| {
std::env::var("LDAP_PASSWORD") std::env::var("LDAP_PASSWORD").map_err(|_| {
.map_err(|_| LdapError::MissingEnvironmentVariable("LDAP_PASSWORD")) LdapError::MissingEnvironmentVariable("LDAP_PASSWORD or LDAP_PASSWORD_FILE")
})
}, },
|path| { |path| {
std::fs::read_to_string(path) std::fs::read_to_string(path)