Skip to content

Commit

Permalink
fix: scheduler compiles keda even if it's disabled
Browse files Browse the repository at this point in the history
which will require `protoc` installed which affects
user experience.

with this patch `protoc` will be required only if
`keda-scaler` feature is enabled.
  • Loading branch information
milenkovicm committed Jan 21, 2025
1 parent 8539c49 commit 8e1b512
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ballista/scheduler/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,18 @@
fn main() -> Result<(), String> {
#[cfg(feature = "build-binary")]
println!("cargo:rerun-if-changed=scheduler_config_spec.toml");

#[cfg(feature = "build-binary")]
configure_me_codegen::build_script_auto()
.map_err(|e| format!("configure_me code generation failed: {e}"))?;

#[cfg(feature = "keda-scaler")]
println!("cargo:rerun-if-changed=proto/keda.proto");

#[cfg(feature = "keda-scaler")]
tonic_build::configure()
.compile_protos(&["proto/keda.proto"], &["proto"])
.map_err(|e| format!("protobuf compilation failed: {e}"))
.map_err(|e| format!("protobuf compilation failed: {e}"))?;

Ok(())
}

0 comments on commit 8e1b512

Please sign in to comment.