Skip to content

Commit dffd2fc

Browse files
committed
chore: bump stackable-operator 0.112.0, tokio 1.52, clap 4.6
1 parent df66fe0 commit dffd2fc

6 files changed

Lines changed: 70 additions & 74 deletions

File tree

Cargo.lock

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.nix

Lines changed: 29 additions & 29 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ edition = "2021"
1010
repository = "https://github.com/stackabletech/nifi-operator"
1111

1212
[workspace.dependencies]
13-
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "stackable-operator-0.111.1", features = ["webhook"] }
13+
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "stackable-operator-0.112.0", features = ["webhook"] }
1414

1515
anyhow = "1.0"
1616
built = { version = "0.8", features = ["chrono", "git2"] }
17-
clap = "4.5"
17+
clap = "4.6"
1818
const_format = "0.2"
1919
fnv = "1.0"
2020
futures = { version = "0.3", features = ["compat"] }
@@ -29,10 +29,10 @@ serde_json = "1.0"
2929
serde_yaml = "0.9"
3030
snafu = "0.9"
3131
strum = { version = "0.28", features = ["derive"] }
32-
tokio = { version = "1.40", features = ["full"] }
32+
tokio = { version = "1.52", features = ["full"] }
3333
tracing = "0.1"
3434
url = { version = "2.5.7" }
3535

3636
[patch."https://github.com/stackabletech/operator-rs.git"]
37-
stackable-operator = { git = "https://github.com/stackabletech//operator-rs.git", branch = "smooth-operator"}
37+
# stackable-operator = { git = "https://github.com/stackabletech//operator-rs.git", branch = "main"}
3838
# stackable-operator = { path = "../operator-rs/crates/stackable-operator" }

crate-hashes.json

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/operator-binary/src/controller/build/resource/service.rs

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
use stackable_operator::{
22
k8s_openapi::api::core::v1::{Service, ServicePort, ServiceSpec},
3-
kvp::{Annotations, Labels},
4-
v2::types::operator::RoleGroupName,
3+
kvp::Annotations,
4+
v2::{
5+
builder::service::{self, Scheme, Scraping},
6+
types::operator::RoleGroupName,
7+
},
58
};
69

710
use crate::controller::{
@@ -53,7 +56,7 @@ pub fn build_rolegroup_metrics_service(
5356
.to_string(),
5457
role_group_name,
5558
)
56-
.with_labels(prometheus_labels())
59+
.with_labels(service::prometheus_labels(&Scraping::Enabled))
5760
.with_annotations(prometheus_annotations(product_version))
5861
.build(),
5962
spec: Some(ServiceSpec {
@@ -100,30 +103,23 @@ pub fn metrics_service_port(product_version: &str) -> ServicePort {
100103
}
101104
}
102105

103-
/// Common labels for Prometheus
104-
fn prometheus_labels() -> Labels {
105-
Labels::try_from([("prometheus.io/scrape", "true")]).expect("should be a valid label")
106-
}
107-
108106
/// Common annotations for Prometheus
109107
///
110108
/// These annotations can be used in a ServiceMonitor.
111-
///
112-
/// see also <https://github.com/prometheus-community/helm-charts/blob/prometheus-27.32.0/charts/prometheus/values.yaml#L983-L1036>
113109
fn prometheus_annotations(product_version: &str) -> Annotations {
114-
let (path, port, scheme) = if product_version.starts_with("1.") {
115-
("/metrics", METRICS_PORT, "http")
110+
// NiFi 1.x exposes metrics via the JMX exporter over HTTP on a dedicated port; NiFi 2.x serves
111+
// them over HTTPS on the NiFi API port.
112+
let (scheme, path, port) = if product_version.starts_with("1.") {
113+
(Scheme::Http, "/metrics", METRICS_PORT)
116114
} else {
117-
("/nifi-api/flow/metrics/prometheus", HTTPS_PORT, "https")
115+
(
116+
Scheme::Https,
117+
"/nifi-api/flow/metrics/prometheus",
118+
HTTPS_PORT,
119+
)
118120
};
119121

120-
Annotations::try_from([
121-
("prometheus.io/path".to_owned(), path.to_owned()),
122-
("prometheus.io/port".to_owned(), port.to_string()),
123-
("prometheus.io/scheme".to_owned(), scheme.to_owned()),
124-
("prometheus.io/scrape".to_owned(), "true".to_owned()),
125-
])
126-
.expect("should be valid annotations")
122+
service::prometheus_annotations(&Scraping::Enabled, &scheme, path, &port)
127123
}
128124

129125
#[cfg(test)]

rust/operator-binary/src/controller/validate.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use stackable_operator::{
1414
product_logging::spec::Logging,
1515
role_utils::CommonConfiguration,
1616
v2::{
17-
builder::pod::container::{self, EnvVarName, EnvVarSet},
17+
builder::pod::container::{EnvVarName, EnvVarSet},
1818
controller_utils::{self, get_cluster_name, get_uid},
1919
product_logging::framework::{
2020
VectorContainerLogConfig, validate_logging_configuration_for_container,
@@ -76,7 +76,7 @@ pub enum Error {
7676

7777
#[snafu(display("environment variable name {name:?} is invalid"))]
7878
ParseEnvVarName {
79-
source: container::Error,
79+
source: stackable_operator::v2::macros::attributed_string_type::Error,
8080
name: String,
8181
},
8282

0 commit comments

Comments
 (0)