diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index d0b104f..3dbad8a 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -4,7 +4,7 @@ on: env: DOCKER_BUILDKIT: "1" - K8S_OPENAPI_ENABLED_VERSION: "1.30" + K8S_OPENAPI_ENABLED_VERSION: "1.31" jobs: lint: diff --git a/Cargo.toml b/Cargo.toml index 9a0db78..fe062f9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "k8s-controller" -version = "0.4.1" +version = "0.5.0" edition = "2021" rust-version = "1.83.0" @@ -13,12 +13,12 @@ include = ["src/**/*", "LICENSE", "README.md", "CHANGELOG.md"] [dependencies] async-trait = "0.1" futures = "0.3" -kube = { version = "0.98.0", default-features = false, features = ["client"] } -kube-runtime = "0.98.0" -rand = "0.8" +kube = { version = "1.1.0", default-features = false, features = ["client"] } +kube-runtime = "1.1.0" +rand = "0.9.0" serde = "1" tracing = "0.1" [dev-dependencies] -k8s-openapi = { version = "0.24", default-features = false, features = ["v1_30"] } +k8s-openapi = { version = "0.25.0", default-features = false, features = ["v1_31"] } tokio = "1" diff --git a/deny.toml b/deny.toml index ad00ce2..6b57836 100644 --- a/deny.toml +++ b/deny.toml @@ -9,15 +9,12 @@ targets = [ [advisories] version = 2 ignore = [ - # Dependency of kube, and has no known version without it. - # This is just saying the "instant" crate is unmaintained, but nothing is - # actively dangerous yet. - "RUSTSEC-2024-0384", ] [bans] multiple-versions = "deny" skip = [ + { name = "getrandom", version = "0.2.15" }, { name = "thiserror", version = "1.0.69" }, { name = "thiserror-impl", version = "1.0.69" }, ] @@ -35,7 +32,6 @@ name = "rustls" version = 2 allow = [ "Apache-2.0", - "BSD-3-Clause", "MIT", "Unicode-3.0", "Zlib", diff --git a/src/controller.rs b/src/controller.rs index 2fc29f6..3740f78 100644 --- a/src/controller.rs +++ b/src/controller.rs @@ -11,7 +11,7 @@ use kube::{Client, Resource, ResourceExt}; use kube_runtime::controller::Action; use kube_runtime::finalizer::{finalizer, Event}; use kube_runtime::watcher; -use rand::{thread_rng, Rng}; +use rand::{rng, Rng}; use tracing::{event, Level}; /// The [`Controller`] watches a set of resources, calling methods on the @@ -251,7 +251,7 @@ pub trait Context { // use a better name for the parameter name in the docs let _resource = resource; - Action::requeue(Duration::from_secs(thread_rng().gen_range(2400..3600))) + Action::requeue(Duration::from_secs(rng().random_range(2400..3600))) } /// This method is called when a call to [`apply`](Self::apply) or @@ -273,7 +273,7 @@ pub trait Context { let seconds = 2u64.pow(consecutive_errors.min(7) + 1); Action::requeue(Duration::from_millis( - thread_rng().gen_range((seconds * 500)..(seconds * 1000)), + rng().random_range((seconds * 500)..(seconds * 1000)), )) }