Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add option to customize NATS leaf node image #42

Merged
merged 1 commit into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/types/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "wasmcloud-operator-types"
version = "0.1.4"
version = "0.1.5"
edition = "2021"

[dependencies]
Expand Down
4 changes: 4 additions & 0 deletions crates/types/src/v1alpha1/wasmcloud_host_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ pub struct WasmCloudHostConfigSpec {
/// If not provided, the default image for the version will be used.
/// Also if provided, the version field will be ignored.
pub image: Option<String>,
/// The image to use for the NATS leaf that is deployed alongside the wasmCloud host.
/// If not provided, the default upstream image will be used.
/// If provided, it should be fully qualified by including the image tag.
pub nats_leaf_image: Option<String>,
/// The name of a secret containing the primary cluster issuer key along with an optional set
/// of NATS credentials.
pub secret_name: String,
Expand Down
7 changes: 6 additions & 1 deletion src/controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -410,10 +410,15 @@ fn pod_template(config: &WasmCloudHostConfig, _ctx: Arc<Context>) -> PodTemplate
None => format!("ghcr.io/wasmcloud/wasmcloud:{}", config.spec.version),
};

let leaf_image = match &config.spec.nats_leaf_image {
Some(img) => img.clone(),
None => "nats:2.10-alpine".to_string(),
};

let containers = vec![
Container {
name: "nats-leaf".to_string(),
image: Some("nats:2.10-alpine".to_string()),
image: Some(leaf_image),
args: Some(vec![
"-js".to_string(),
"--config".to_string(),
Expand Down
Loading