Cleaned up events
All checks were successful
Build and deploy / Build container and manifests (push) Successful in 9m7s

This commit is contained in:
2025-04-14 00:57:21 +02:00
parent d21b53cf34
commit 9c37b2a2d1
4 changed files with 25 additions and 53 deletions

View File

@@ -39,7 +39,7 @@ impl Reconcile for Group {
lldap_client.create_group(&name).await?;
ctx.recorder.group_created(self.as_ref(), &name).await?;
ctx.recorder.group_created(self.as_ref()).await?;
} else {
trace!("Group already exists");
}
@@ -66,7 +66,7 @@ impl Reconcile for Group {
lldap_client.delete_group(group.id).await?;
ctx.recorder.group_deleted(self.as_ref(), &name).await?;
ctx.recorder.group_deleted(self.as_ref()).await?;
} else {
trace!(name, "Group does not exist")
}

View File

@@ -144,7 +144,7 @@ impl Reconcile for ServiceUser {
debug!(name, username, "Creating new user");
let user = lldap_client.create_user(&username).await?;
ctx.recorder.user_created(self.as_ref(), &username).await?;
ctx.recorder.user_created(self.as_ref()).await?;
Ok(user)
}
@@ -208,14 +208,11 @@ impl Reconcile for ServiceUser {
Err(lldap::Error::GraphQl(err))
if err.message == format!("Entity not found: `No such user: '{username}'`") =>
{
ctx.recorder
.user_not_found(self.as_ref(), &username)
.await?;
warn!(name, username, "User not found");
Ok(())
}
Ok(_) => {
ctx.recorder.user_deleted(self.as_ref(), &username).await?;
ctx.recorder.user_deleted(self.as_ref()).await?;
Ok(())
}
Err(err) => Err(err),

View File

@@ -11,11 +11,7 @@ use serde::{Deserialize, Serialize};
use serde_json::json;
use tracing::{debug, trace, warn};
use crate::{
context::ControllerEvents,
lldap,
resources::{Error, user_attribute},
};
use crate::{context::ControllerEvents, lldap, resources::Error};
use super::Reconcile;