Skip to content

Commit d90e460

Browse files
authored
feat: Add support for configuring wasmCloud Secrets (#82)
Signed-off-by: Joonas Bergius <joonas@cosmonic.com>
1 parent 5988e64 commit d90e460

File tree

8 files changed

+800
-475
lines changed

8 files changed

+800
-475
lines changed

Cargo.lock

Lines changed: 202 additions & 23 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
@@ -1,6 +1,6 @@
11
[package]
22
name = "wasmcloud-operator"
3-
version = "0.3.1"
3+
version = "0.4.0"
44
edition = "2021"
55

66
[[bin]]
@@ -94,9 +94,9 @@ tracing-opentelemetry = "0.22"
9494
tracing-subscriber = { version = "0.3", features = ["env-filter", "json"] }
9595
utoipa = { version = "4.1", features = ["axum_extras"] }
9696
uuid = { version = "1", features = ["v5"] }
97-
wadm = "0.12.2"
98-
wadm-client = "0.1.2"
99-
wadm-types = "0.1.0"
97+
wadm = "0.13.0"
98+
wadm-client = "0.2.0"
99+
wadm-types = "0.2.0"
100100
wasmcloud-operator-types = { version = "*", path = "./crates/types" }
101101

102102
[workspace]

crates/types/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "wasmcloud-operator-types"
3-
version = "0.1.6"
3+
version = "0.1.7"
44
edition = "2021"
55

66
[dependencies]

crates/types/src/v1alpha1/wasmcloud_host_config.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ pub struct WasmCloudHostConfigSpec {
8080
pub observability: Option<ObservabilityConfiguration>,
8181
/// Certificates: Authorities, client certificates
8282
pub certificates: Option<WasmCloudHostCertificates>,
83+
/// wasmCloud secrets topic prefix, must not be empty if set.
84+
pub secrets_topic_prefix: Option<String>,
8385
}
8486

8587
#[derive(Serialize, Deserialize, Clone, Debug, JsonSchema)]

examples/full-config/wasmcloud-annotated.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ spec:
6868
traces:
6969
enable: false
7070
endpoint: "traces-specific-otel-collector.svc"
71+
# Optional: Subject prefix that will be used by the host to query for wasmCloud Secrets.
72+
# See https://wasmcloud.com/docs/concepts/secrets for more context
73+
secretsTopicPrefix: "wasmcloud.secrets"
7174
# Optional: Additional options to control how the underlying wasmCloud hosts are scheduled in Kubernetes.
7275
# This includes setting resource requirements for the nats and wasmCloud host
7376
# containers along with any additional pot template settings.

src/controller.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,14 @@ async fn pod_template(config: &WasmCloudHostConfig, ctx: Arc<Context>) -> Result
373373
}
374374
}
375375

376+
if let Some(secrets_prefix) = &config.spec.secrets_topic_prefix {
377+
wasmcloud_env.push(EnvVar {
378+
name: "WASMCLOUD_SECRETS_TOPIC".to_string(),
379+
value: Some(secrets_prefix.clone()),
380+
..Default::default()
381+
})
382+
}
383+
376384
let mut wasmcloud_args = configure_observability(&config.spec);
377385

378386
let mut nats_resources: Option<k8s_openapi::api::core::v1::ResourceRequirements> = None;

0 commit comments

Comments
 (0)