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

add NAMESPACE env var to appServices #1035

Merged
merged 1 commit into from
Nov 5, 2024
Merged
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
11 changes: 11 additions & 0 deletions tembo-operator/src/app_service/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,7 @@ fn generate_deployment(

let has_instance_id = env_vars.iter().any(|env| env.name == "TEMBO_INSTANCE_ID");
let has_org_id = env_vars.iter().any(|env| env.name == "TEMBO_ORG_ID");
let has_namespace = env_vars.iter().any(|env| env.name == "NAMESPACE");

// Check for tembo.io/instance_id and tembo.io/organization_id annotations
if has_instance_id.not() {
Expand All @@ -460,6 +461,16 @@ fn generate_deployment(
tracing::info!("Not applying TEMBO_ORG_ID to env since it's already present");
}

if has_namespace.not() {
env_vars.push(EnvVar {
name: "NAMESPACE".to_string(),
value: Some(namespace.to_string()),
..EnvVar::default()
});
} else {
tracing::info!("Not applying NAMESPACE to env since it's already present");
}

// Add the pre-loaded forwarded environment variables
env_vars.extend(FORWARDED_ENV_VARS.iter().cloned());

Expand Down
Loading