Skip to content

Commit 6149408

Browse files
committed
add debug!() when checking for cert rotation
1 parent 003a628 commit 6149408

4 files changed

Lines changed: 16 additions & 0 deletions

File tree

Cargo.lock

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ either = "1.13.0"
2929
futures = "0.3.30"
3030
futures-util = "0.3.30"
3131
http = "1.3.1"
32+
humantime = "2.1.0"
3233
indexmap = "2.5.0"
3334
indoc = "2.0.6"
3435
jiff = "0.2.18"

crates/stackable-webhook/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ arc-swap.workspace = true
1515
async-trait.workspace = true
1616
axum.workspace = true
1717
futures-util.workspace = true
18+
humantime.workspace = true
1819
hyper-util.workspace = true
1920
hyper.workspace = true
2021
k8s-openapi.workspace = true

crates/stackable-webhook/src/tls/cert_resolver.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,13 @@ impl CertificateResolver {
107107
let deadline = not_after
108108
.checked_sub(buffer)
109109
.unwrap_or(SystemTime::UNIX_EPOCH);
110+
111+
tracing::debug!(
112+
subject_alterative_dns_names = ?self.subject_alterative_dns_names,
113+
not_after = %humantime::format_rfc3339(not_after),
114+
deadline = %humantime::format_rfc3339(deadline),
115+
"checking if certificate needs rotation"
116+
);
110117
SystemTime::now() >= deadline
111118
}
112119

0 commit comments

Comments
 (0)