Skip to content
Merged
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/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:

env:
DOCKER_BUILDKIT: "1"
K8S_OPENAPI_ENABLED_VERSION: "1.30"
K8S_OPENAPI_ENABLED_VERSION: "1.31"

jobs:
lint:
Expand Down
10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "k8s-controller"
version = "0.4.1"
version = "0.5.0"
edition = "2021"
rust-version = "1.83.0"

Expand All @@ -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"
6 changes: 1 addition & 5 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" },
]
Expand All @@ -35,7 +32,6 @@ name = "rustls"
version = 2
allow = [
"Apache-2.0",
"BSD-3-Clause",
"MIT",
"Unicode-3.0",
"Zlib",
Expand Down
6 changes: 3 additions & 3 deletions src/controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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)),
))
}

Expand Down
Loading