Small tweaks to bring in line with other Kubernetes tools
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
#![feature(let_chains)]
|
||||
pub mod context;
|
||||
pub mod lldap;
|
||||
pub mod resources;
|
||||
mod version;
|
||||
|
||||
pub use version::VERSION;
|
||||
|
||||
@@ -7,6 +7,7 @@ use kube::runtime::controller::{self, Action};
|
||||
use kube::runtime::reflector::ObjectRef;
|
||||
use kube::runtime::{Controller, watcher};
|
||||
use kube::{Api, Client as KubeClient, Resource};
|
||||
use lldap_controller::VERSION;
|
||||
use lldap_controller::context::Context;
|
||||
use lldap_controller::lldap::LldapConfig;
|
||||
use lldap_controller::resources::{
|
||||
@@ -47,7 +48,7 @@ async fn main() -> anyhow::Result<()> {
|
||||
Registry::default().with(logger).with(env_filter).init();
|
||||
}
|
||||
|
||||
info!("Starting controller");
|
||||
info!(version = VERSION, "Starting");
|
||||
|
||||
let client = KubeClient::try_default().await?;
|
||||
|
||||
|
||||
@@ -1,19 +1,18 @@
|
||||
use std::time::Duration;
|
||||
|
||||
use kube::{
|
||||
Api, CELSchema, CustomResource,
|
||||
api::{Patch, PatchParams},
|
||||
runtime::controller::Action,
|
||||
};
|
||||
use kube::api::{Patch, PatchParams};
|
||||
use kube::runtime::controller::Action;
|
||||
use kube::{Api, CELSchema, CustomResource};
|
||||
use queries::AttributeType;
|
||||
use schemars::JsonSchema;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use serde_json::json;
|
||||
use tracing::{debug, trace, warn};
|
||||
|
||||
use crate::{context::ControllerEvents, lldap, resources::Error};
|
||||
|
||||
use super::Reconcile;
|
||||
use crate::context::ControllerEvents;
|
||||
use crate::lldap;
|
||||
use crate::resources::Error;
|
||||
|
||||
#[derive(Deserialize, Serialize, Clone, Copy, Debug, JsonSchema)]
|
||||
pub enum Type {
|
||||
|
||||
11
src/version.rs
Normal file
11
src/version.rs
Normal file
@@ -0,0 +1,11 @@
|
||||
pub const VERSION: &str = get_version();
|
||||
|
||||
const fn get_version() -> &'static str {
|
||||
if let Some(version) = std::option_env!("RELEASE_VERSION")
|
||||
&& !version.is_empty()
|
||||
{
|
||||
version
|
||||
} else {
|
||||
git_version::git_version!(fallback = "unknown")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user