Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ concurrency:
env:
CARGO_TERM_COLOR: always
# Pinned toolchain for linting
ACTIONS_LINTS_TOOLCHAIN: 1.85.0
ACTIONS_LINTS_TOOLCHAIN: 1.92.0

jobs:
linting:
Expand Down
99 changes: 37 additions & 62 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ resolver = "3"

[workspace.package]
edition = "2024"
rust-version = "1.85"
rust-version = "1.92"

[workspace.dependencies]
anyhow = "1.0.100"
Expand All @@ -19,8 +19,8 @@ compute-pcrs-lib = { git = "https://github.com/trusted-execution-clusters/comput
env_logger = "0.11.8"
http = "1.4.0"
ignition-config = "0.5.0"
k8s-openapi = { version = "0.26.1", features = ["v1_33", "schemars"] }
kube = { version = "2.0.1", default-features = false, features = ["derive", "runtime", "openssl-tls"] }
k8s-openapi = { version = "0.27.0", features = ["v1_33", "schemars"] }
kube = { version = "3.0.0", default-features = false, features = ["derive", "runtime", "openssl-tls"] }
log = "0.4.29"
serde = { version = "1.0.228", features = ["derive"] }
serde_json = "1.0.148"
Expand Down
15 changes: 7 additions & 8 deletions attestation-key-register/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ async fn handle_registration(
client: Client,
addr: Option<SocketAddr>,
) -> Result<impl warp::Reply, Infallible> {
info!("Received registration request: {:?}", registration);
info!("Received registration request: {registration:?}");

let api: Api<AttestationKey> = Api::default_namespaced(client);

Expand All @@ -50,8 +50,7 @@ async fn handle_registration(
if key.spec.public_key == registration.public_key {
let existing_name = key.metadata.name.unwrap_or_default();
error!(
"Duplicate public key detected: already exists in AttestationKey '{}'",
existing_name
"Duplicate public key detected: already exists in AttestationKey '{existing_name}'"
);
return Ok(reply::with_status(
reply::json(&serde_json::json!({
Expand All @@ -64,11 +63,11 @@ async fn handle_registration(
}
}
Err(e) => {
error!("Failed to list AttestationKeys: {}", e);
error!("Failed to list AttestationKeys: {e}");
return Ok(reply::with_status(
reply::json(&serde_json::json!({
"status": "error",
"message": format!("Failed to check for existing keys: {}", e),
"message": format!("Failed to check for existing keys: {e}"),
})),
StatusCode::INTERNAL_SERVER_ERROR,
));
Expand Down Expand Up @@ -106,11 +105,11 @@ async fn handle_registration(
))
}
Err(e) => {
error!("Failed to create AttestationKey: {}", e);
error!("Failed to create AttestationKey: {e}");
Ok(reply::with_status(
reply::json(&serde_json::json!({
"status": "error",
"message": format!("Failed to create AttestationKey: {}", e),
"message": format!("Failed to create AttestationKey: {e}"),
})),
StatusCode::INTERNAL_SERVER_ERROR,
))
Expand Down Expand Up @@ -145,7 +144,7 @@ async fn main() -> anyhow::Result<()> {
.and_then(handle_registration);

let addr = SocketAddr::from(([0, 0, 0, 0], args.port));
info!("Listening on {}", addr);
info!("Listening on {addr}");

warp::serve(register).run(addr).await;

Expand Down
4 changes: 2 additions & 2 deletions compute-pcrs/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use anyhow::{Context, Result};
use clap::Parser;
use compute_pcrs_lib::*;
use k8s_openapi::{api::core::v1::ConfigMap, chrono::Utc};
use k8s_openapi::{api::core::v1::ConfigMap, jiff::Timestamp};
use kube::{Api, Client};

use trusted_cluster_operator_lib::{conditions::INSTALLED_REASON, reference_values::*, *};
Expand Down Expand Up @@ -57,7 +57,7 @@ async fn main() -> Result<()> {
let mut image_pcrs: ImagePcrs = serde_json::from_str(image_pcrs_str)?;

let image_pcr = ImagePcr {
first_seen: Utc::now(),
first_seen: Timestamp::now(),
reference: args.image,
pcrs,
};
Expand Down
4 changes: 2 additions & 2 deletions lib/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ pub mod reference_values;
mod kopium;
#[allow(clippy::all)]
mod vendor_kopium;
use k8s_openapi::jiff::Timestamp;
pub use kopium::approvedimages::*;
pub use kopium::attestationkeys::*;
pub use kopium::machines::*;
Expand All @@ -17,7 +18,6 @@ pub use vendor_kopium::virtualmachines;

use conditions::*;
use k8s_openapi::apimachinery::pkg::apis::meta::v1::{Condition, Time};
use k8s_openapi::chrono::Utc;

#[macro_export]
macro_rules! update_status {
Expand Down Expand Up @@ -50,7 +50,7 @@ pub fn committed_condition(reason: &str, generation: Option<i64>) -> Condition {
_ => "",
}
.to_string(),
last_transition_time: Time(Utc::now()),
last_transition_time: Time(Timestamp::now()),
observed_generation: generation,
}
}
Loading