Adjusted secret name to prevent conflicts
This commit is contained in:
parent
280ac723b5
commit
39a57e35ac
|
@ -44,6 +44,7 @@ async fn reconcile(obj: Arc<ServiceUser>, ctx: Arc<Data>) -> Result<Action> {
|
||||||
.name
|
.name
|
||||||
.clone()
|
.clone()
|
||||||
.ok_or(Error::MissingObjectKey(".metadata.name"))?;
|
.ok_or(Error::MissingObjectKey(".metadata.name"))?;
|
||||||
|
let secret_name = format!("{name}-lldap-credentials");
|
||||||
let namespace = obj
|
let namespace = obj
|
||||||
.metadata
|
.metadata
|
||||||
.namespace
|
.namespace
|
||||||
|
@ -59,11 +60,11 @@ async fn reconcile(obj: Arc<ServiceUser>, ctx: Arc<Data>) -> Result<Action> {
|
||||||
// TODO: Potentially issue: someone modifies the secret and removes the pass
|
// TODO: Potentially issue: someone modifies the secret and removes the pass
|
||||||
let mut created = false;
|
let mut created = false;
|
||||||
let mut secret = secrets
|
let mut secret = secrets
|
||||||
.entry(&name)
|
.entry(&secret_name)
|
||||||
.await
|
.await
|
||||||
.map_err(Error::Kube)?
|
.map_err(Error::Kube)?
|
||||||
.or_insert(|| {
|
.or_insert(|| {
|
||||||
debug!(name, "Generating new secret");
|
debug!(name, secret_name, "Generating new secret");
|
||||||
|
|
||||||
let mut contents = BTreeMap::new();
|
let mut contents = BTreeMap::new();
|
||||||
contents.insert("username".into(), name.clone());
|
contents.insert("username".into(), name.clone());
|
||||||
|
|
Loading…
Reference in New Issue
Block a user