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.32"
K8S_OPENAPI_ENABLED_VERSION: "1.34"

jobs:
lint:
Expand Down
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# Changelog

## [0.12.0] - 2026-07-22

### Added

* `LeaderElection`, providing lease-based leader election so that multiple
replicas of a controller can run with only one reconciling at a time.
`LeaderElection::with_lease` runs an arbitrary future (for instance, one
or several `Controller::run` futures) while holding the lease.
`LeaderElection::release` allows handing leadership over immediately
during graceful shutdown.

### Changed

* `k8s-openapi` is now a regular dependency, with no version feature
enabled; the final binary crate is responsible for enabling one.
* Update the k8s-openapi version feature used in CI and tests to `v1_34`.

## [0.3.2] - 2024-07-23

### Changed
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

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

8 changes: 6 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "k8s-controller"
version = "0.11.0"
version = "0.12.0"
edition = "2024"
rust-version = "1.89.0"

Expand All @@ -13,16 +13,20 @@ include = ["src/**/*", "LICENSE", "README.md", "CHANGELOG.md"]
[dependencies]
async-trait = "0.1"
futures = "0.3"
# no version feature is enabled here; the final binary crate is responsible
# for enabling one, as described in the k8s-openapi docs
k8s-openapi = { version = "0.27.0", default-features = false }
kube = { version = "3.0.0", default-features = false, features = ["client"] }
kube-runtime = "3.0.0"
rand = "0.9.2"
serde = "1"
serde_json = "1"
thiserror = "2.0.17"
tokio = { version = "1", features = ["time"] }
tracing = "0.1"

[dev-dependencies]
k8s-openapi = { version = "0.27.0", default-features = false, features = ["v1_32"] }
k8s-openapi = { version = "0.27.0", default-features = false, features = ["v1_34"] }
tokio = "1"

[package.metadata.docs.rs]
Expand Down
4 changes: 4 additions & 0 deletions src/controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,10 @@ where
/// method called when a resource is created or updated, and its
/// [`cleanup`](Context::cleanup) method called when a resource is about
/// to be deleted.
///
/// To run multiple replicas of a controller with only one reconciling
/// at a time, pass this method's future to
/// [`LeaderElection::with_lease`](crate::LeaderElection::with_lease).
pub async fn run(self) {
let Self {
client,
Expand Down
Loading
Loading