Skip to content

Commit d2bafff

Browse files
authored
chore: Update to stackable-operator 0.95.0 (#631)
1 parent b40e8fc commit d2bafff

File tree

14 files changed

+1200
-594
lines changed

14 files changed

+1200
-594
lines changed

Cargo.lock

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

Cargo.nix

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

Cargo.toml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ edition = "2021"
1111
repository = "https://github.com/stackabletech/secret-operator"
1212

1313
[workspace.dependencies]
14-
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", features = ["time", "telemetry"], tag = "stackable-operator-0.94.0" }
14+
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", features = ["time", "telemetry"], tag = "stackable-operator-0.95.0" }
1515
krb5 = { git = "https://github.com/stackabletech/krb5-rs.git", tag = "v0.1.0" }
1616

1717
anyhow = "1.0"
@@ -28,8 +28,8 @@ libc = "0.2"
2828
native-tls = "0.2"
2929
openssl = "0.10"
3030
pin-project = "1.1"
31-
prost = "0.13"
32-
prost-types = "0.13"
31+
prost = "0.14"
32+
prost-types = "0.14"
3333
rand = "0.9"
3434
serde = { version = "1.0", features = ["derive"] }
3535
serde_json = "1.0"
@@ -42,9 +42,10 @@ tempfile = "3.12"
4242
time = { version = "0.3", features = ["parsing"] }
4343
tokio = { version = "1.40", features = ["full"] }
4444
tokio-stream = { version = "0.1", features = ["net"] }
45-
tonic = "0.13"
46-
tonic-build = "0.13"
47-
tonic-reflection = "0.13"
45+
tonic = "0.14"
46+
tonic-prost = "0.14"
47+
tonic-prost-build = "0.14"
48+
tonic-reflection = "0.14"
4849
tracing = "0.1"
4950
tracing-subscriber = "0.3"
5051
walkdir = "2.5.0"

crate-hashes.json

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

deploy/helm/secret-operator/templates/daemonset.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,36 @@ spec:
3434
resources:
3535
{{ .Values.node.driver.resources | toYaml | nindent 12 }}
3636
env:
37+
# The following env vars are passed as clap (think CLI) arguments to the operator.
38+
# They are picked up by clap using the structs defied in the operator.
39+
# (which is turn pulls in https://github.com/stackabletech/operator-rs/blob/main/crates/stackable-operator/src/cli.rs)
40+
# You can read there about the expected values and purposes.
41+
3742
- name: CSI_ENDPOINT
3843
value: /csi/csi.sock
3944
- name: PRIVILEGED
4045
value: {{ .Values.securityContext.privileged | quote }}
4146

47+
# Sometimes products need to know the operator image, e.g. the opa-bundle-builder OPA
48+
# sidecar uses the operator image.
49+
- name: OPERATOR_IMAGE
50+
# Tilt can use annotations as image paths, but not env variables
51+
valueFrom:
52+
fieldRef:
53+
fieldPath: metadata.annotations['internal.stackable.tech/image']
54+
55+
# Namespace the operator Pod is running in, e.g. used to construct the conversion
56+
# webhook endpoint.
57+
- name: OPERATOR_NAMESPACE
58+
valueFrom:
59+
fieldRef:
60+
fieldPath: metadata.namespace
61+
62+
# The name of the Kubernetes Service that point to the operator Pod, e.g. used to
63+
# construct the conversion webhook endpoint.
64+
- name: OPERATOR_SERVICE_NAME
65+
value: {{ include "operator.fullname" . }}
66+
4267
# Operators need to know the node name they are running on, to e.g. discover the
4368
# Kubernetes domain name from the kubelet API.
4469
- name: KUBERNETES_NODE_NAME

rust/olm-deployer/src/main.rs

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ use stackable_operator::{
3131
discovery::{ApiResource, Discovery, Scope},
3232
},
3333
telemetry::{Tracing, tracing::TelemetryOptions},
34-
utils::cluster_info::KubernetesClusterInfoOpts,
34+
utils::cluster_info::KubernetesClusterInfoOptions,
3535
};
3636

3737
pub const APP_NAME: &str = "stkbl-secret-olm-deployer";
@@ -70,10 +70,10 @@ struct OlmDeployerRun {
7070
dir: std::path::PathBuf,
7171

7272
#[command(flatten)]
73-
pub telemetry_arguments: TelemetryOptions,
73+
pub telemetry: TelemetryOptions,
7474

7575
#[command(flatten)]
76-
pub cluster_info_opts: KubernetesClusterInfoOpts,
76+
pub cluster_info: KubernetesClusterInfoOptions,
7777
}
7878

7979
#[tokio::main]
@@ -84,16 +84,15 @@ async fn main() -> Result<()> {
8484
csv,
8585
namespace,
8686
dir,
87-
telemetry_arguments,
88-
cluster_info_opts,
87+
telemetry,
88+
cluster_info,
8989
}) = opts.cmd
9090
{
9191
// NOTE (@NickLarsenNZ): Before stackable-telemetry was used:
9292
// - The console log level was set by `STKBL_SECRET_OLM_DEPLOYER_LOG`, and is now `CONSOLE_LOG` (when using Tracing::pre_configured).
9393
// - The file log level was set by `STKBL_SECRET_OLM_DEPLOYER_LOG`, and is now set via `FILE_LOG` (when using Tracing::pre_configured).
9494
// - The file log directory was set by `STKBL_SECRET_OLM_DEPLOYER_LOG_DIRECTORY`, and is now set by `ROLLING_LOGS_DIR` (or via `--rolling-logs <DIRECTORY>`).
95-
let _tracing_guard =
96-
Tracing::pre_configured(built_info::PKG_NAME, telemetry_arguments).init()?;
95+
let _tracing_guard = Tracing::pre_configured(built_info::PKG_NAME, telemetry).init()?;
9796

9897
tracing::info!(
9998
built_info.pkg_version = built_info::PKG_VERSION,
@@ -105,8 +104,7 @@ async fn main() -> Result<()> {
105104
description = built_info::PKG_DESCRIPTION
106105
);
107106

108-
let client =
109-
client::initialize_operator(Some(APP_NAME.to_string()), &cluster_info_opts).await?;
107+
let client = client::initialize_operator(Some(APP_NAME.to_string()), &cluster_info).await?;
110108

111109
let deployment = get_deployment(&csv, &namespace, &client).await?;
112110
let cluster_role = get_cluster_role(&csv, &client).await?;

rust/operator-binary/Cargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,9 @@ tempfile.workspace = true
3535
time.workspace = true
3636
tokio-stream.workspace = true
3737
tokio.workspace = true
38-
tonic-reflection.workspace = true
3938
tonic.workspace = true
39+
tonic-prost.workspace = true
40+
tonic-reflection.workspace = true
4041
tracing.workspace = true
4142
uuid.workspace = true
4243
yasna.workspace = true
@@ -48,6 +49,6 @@ serde_yaml.workspace = true
4849

4950
[build-dependencies]
5051
built.workspace = true
51-
tonic-build.workspace = true
52+
tonic-prost-build.workspace = true
5253

5354
[features]

rust/operator-binary/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use std::path::PathBuf;
44

55
fn main() {
66
let out_dir = PathBuf::from(std::env::var("OUT_DIR").expect("OUT_DIR is required"));
7-
tonic_build::configure()
7+
tonic_prost_build::configure()
88
.file_descriptor_set_path(out_dir.join("file_descriptor_set.bin"))
99
.compile_protos(&["vendor/csi/csi.proto"], &["vendor/csi"])
1010
.unwrap();

rust/operator-binary/src/backend/cert_manager.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use snafu::{OptionExt, ResultExt, Snafu};
99
use stackable_operator::{
1010
k8s_openapi::{ByteString, api::core::v1::Secret},
1111
kube::{api::ObjectMeta, runtime::reflector::ObjectRef},
12-
time::Duration,
12+
shared::time::Duration,
1313
};
1414

1515
use super::{

rust/operator-binary/src/backend/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use stackable_operator::{
2323
crd::listener,
2424
k8s_openapi::chrono::{DateTime, FixedOffset},
2525
kube::api::DynamicObject,
26-
time::Duration,
26+
shared::time::Duration,
2727
};
2828
pub use tls::TlsGenerate;
2929

0 commit comments

Comments
 (0)