Skip to content

Commit 402181a

Browse files
committed
main merge
2 parents b2f3fa0 + b895e63 commit 402181a

File tree

3 files changed

+19
-16
lines changed

3 files changed

+19
-16
lines changed

CHANGELOG.md

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,26 @@ All notable changes to this project will be documented in this file.
44

55
## [Unreleased]
66

7-
### Changed
8-
9-
- Build against Kubernetes 1.23 ([#330]).
10-
117
### Added
8+
9+
- BREAKING: Added CLI `watch_namespace` parameter to ProductOperatorRun in
10+
preparation for operators watching a single namespace ([#332]).
1211
- More builder functionality ([#331])
1312
- builder for `SecurityContext` objects
1413
- add `EnvVar`s from field refs
1514
- set `serviceServiceAccountName` in pod templates
1615

16+
17+
### Changed
18+
19+
- Build against Kubernetes 1.23 ([#330]).
20+
1721
[#330]: https://github.com/stackabletech/operator-rs/pull/330
1822
[#331]: https://github.com/stackabletech/operator-rs/pull/331
23+
[#332]: https://github.com/stackabletech/operator-rs/pull/332
1924

2025
## [0.12.0] - 2022-02-18
2126

22-
2327
### Changed
2428
- Reported K8s events are now limited to 1024 bytes ([#327]).
2529

@@ -32,7 +36,6 @@ All notable changes to this project will be documented in this file.
3236

3337
## [0.11.0] - 2022-02-17
3438

35-
3639
### Added
3740
- Infrastructure for logging errors as K8s events ([#322]).
3841

@@ -50,7 +53,6 @@ All notable changes to this project will be documented in this file.
5053

5154
## [0.10.0] - 2022-02-04
5255

53-
5456
### Added
5557
- Unified `ClusterRef` type for referring to cluster objects ([#307]).
5658

@@ -67,7 +69,6 @@ All notable changes to this project will be documented in this file.
6769

6870
## [0.9.0] - 2022-01-27
6971

70-
7172
### Changed
7273
- Fixed `Client::apply_patch_status` always failing ([#300]).
7374

@@ -89,7 +90,6 @@ All notable changes to this project will be documented in this file.
8990

9091
## [0.7.0] - 2021-12-22
9192

92-
9393
### Changed
9494
- BREAKING: Introduced proper (Result) error handling for `transform_all_roles_to_config` ([#282]).
9595
- BREAKING: `Configuration::compute_*` are now invoked even when `config` field is not provided on `Role`/`RoleGroup` ([#282]).
@@ -203,7 +203,6 @@ All notable changes to this project will be documented in this file.
203203

204204
## [0.2.2] - 2021-09-21
205205

206-
207206
### Changed
208207

209208
- `kube-rs`: `0.59``0.60` ([#217]).
@@ -221,7 +220,6 @@ All notable changes to this project will be documented in this file.
221220

222221
## [0.2.0] - 2021-09-17
223222

224-
225223
### Added
226224
- Extracted the versioning support for up and downgrades from operators ([#211]).
227225
- Added traits to access generic operator versions ([#211]).

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
[package]
2-
authors = ["Lars Francke <lars.francke@stackable.de>"]
2+
authors = ["Stackable GmbH <info@stackable.de>"]
33
description = "Stackable Operator Framework"
4-
edition = "2018"
4+
edition = "2021"
55
license = "Apache-2.0"
66
name = "stackable-operator"
77
version = "0.12.0"
88
repository = "https://github.com/stackabletech/operator-rs"
99

1010
[dependencies]
1111
chrono = { version = "0.4.19", default-features = false }
12-
clap = { version = "3.0.13", features = ["derive", "cargo"] }
12+
clap = { version = "3.0.13", features = ["derive", "cargo", "env"] }
1313
const_format = "0.2.22"
1414
either = "1.6.1"
1515
futures = "0.3.19"

src/cli.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
//! cli::Command::Crd => {
9595
//! // Print CRD objects
9696
//! }
97-
//! cli::Command::Run(cli::ProductOperatorRun { product_config }) => {
97+
//! cli::Command::Run(cli::ProductOperatorRun { product_config, watch_namespace }) => {
9898
//! let product_config = product_config.load(&[
9999
//! "deploy/config-spec/properties.yaml",
100100
//! "/etc/stackable/spark-operator/config-spec/properties.yaml",
@@ -155,11 +155,12 @@ pub enum Command<Run: Args = ProductOperatorRun> {
155155
/// common: ProductOperatorRun,
156156
/// }
157157
/// use clap::Parser;
158-
/// let opts = Command::<Run>::parse_from(["foobar-operator", "run", "--name", "foo", "--product-config", "bar"]);
158+
/// let opts = Command::<Run>::parse_from(["foobar-operator", "run", "--name", "foo", "--product-config", "bar", "--watch-namespace", "foobar"]);
159159
/// assert_eq!(opts, Command::Run(Run {
160160
/// name: "foo".to_string(),
161161
/// common: ProductOperatorRun {
162162
/// product_config: ProductConfigPath::from("bar".as_ref()),
163+
/// watch_namespace: Some("foobar".to_string())
163164
/// },
164165
/// }));
165166
/// ```
@@ -188,9 +189,13 @@ pub struct ProductOperatorRun {
188189
short = 'p',
189190
value_name = "FILE",
190191
default_value = "",
192+
env,
191193
parse(from_os_str)
192194
)]
193195
pub product_config: ProductConfigPath,
196+
/// Provides a specific namespace to watch (instead of watching all namespaces)
197+
#[clap(long, env)]
198+
pub watch_namespace: Option<String>,
194199
}
195200

196201
/// A path to a [`ProductConfigManager`] spec file

0 commit comments

Comments
 (0)