Skip to content

Commit ce8b52b

Browse files
authored
fix: Derive Clone for ProbeBuilder and ProbeAction (#1082)
* fix: Derive Clone for ProbeBuilder * Also for ProbeAction * changelog * typo
1 parent 20659fe commit ce8b52b

File tree

4 files changed

+16
-3
lines changed

4 files changed

+16
-3
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/stackable-operator/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file.
44

55
## [Unreleased]
66

7+
## [0.95.1] - 2025-08-21
8+
9+
### Fixed
10+
11+
- Derive `Clone` for `ProbeBuilder` and `ProbeAction` ([#1082]).
12+
13+
[#1082]: https://github.com/stackabletech/operator-rs/pull/1082
14+
715
## [0.95.0] - 2025-08-21
816

917
### Added

crates/stackable-operator/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "stackable-operator"
33
description = "Stackable Operator Framework"
4-
version = "0.95.0"
4+
version = "0.95.1"
55
authors.workspace = true
66
license.workspace = true
77
edition.workspace = true

crates/stackable-operator/src/builder/pod/probe.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ pub enum Error {
5353
PeriodIsZero {},
5454
}
5555

56-
#[derive(Debug)]
56+
#[derive(Clone, Debug)]
5757
pub struct ProbeBuilder<Action, Period> {
5858
// Mandatory field
5959
action: Action,
@@ -73,6 +73,7 @@ pub struct ProbeBuilder<Action, Period> {
7373
/// type, see [container-probes] documentation.
7474
///
7575
/// [container-probes]: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes
76+
#[derive(Clone, Debug)]
7677
pub enum ProbeAction {
7778
Exec(ExecAction),
7879
Grpc(GRPCAction),
@@ -238,6 +239,10 @@ impl ProbeBuilder<ProbeAction, Duration> {
238239
Ok(self.with_failure_threshold(failure_threshold.ceil() as i32))
239240
}
240241

242+
/// Build the [`Probe`] using the specified contents.
243+
///
244+
/// Returns an [`Error::DurationTooLong`] error in case the involved [`Duration`]s are too
245+
/// long.
241246
pub fn build(self) -> Result<Probe, Error> {
242247
let mut probe = Probe {
243248
exec: None,

0 commit comments

Comments
 (0)