First part of actual controller

This commit is contained in:
2025-03-14 04:21:37 +01:00
parent d9cb4b4598
commit 280ac723b5
5 changed files with 536 additions and 114 deletions

View File

@@ -1,3 +1,4 @@
use chrono::{DateTime, Utc};
use kube::CustomResource;
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
@@ -13,9 +14,9 @@ use serde::{Deserialize, Serialize};
#[kube(
shortname = "lsu",
doc = "Custom resource for managing Service Users inside of LLDAP",
printcolumn = r#"{"name":"Exists", "type":"boolean", "description":"Does the service user exist in LLDAP", "jsonPath":".status.exists"}"#,
printcolumn = r#"{"name":"Manager", "type":"boolean", "description":"Can the service user manage passwords", "jsonPath":".spec.passwordManager"}"#,
printcolumn = r#"{"name":"Age", "type":"date", "jsonPath":".metadata.creationTimestamp"}"#
printcolumn = r#"{"name":"Age", "type":"date", "jsonPath":".metadata.creationTimestamp"}"#,
printcolumn = r#"{"name":"Secret", "type":"date", "description":"Secret creation timestamp", "jsonPath":".status.secret_created"}"#
)]
#[serde(rename_all = "camelCase")]
pub struct ServiceUserSpec {
@@ -27,7 +28,7 @@ pub struct ServiceUserSpec {
#[derive(Deserialize, Serialize, Clone, Default, Debug, JsonSchema)]
pub struct ServiceUserStatus {
pub exists: bool,
pub secret_created: Option<DateTime<Utc>>,
}
#[cfg(test)]