Skip to content

Commit

Permalink
Fix operator setup image selection (#1832)
Browse files Browse the repository at this point in the history
* Sadly it can't be compile time

* Lint

* 🤦

* 🤦 🤦
  • Loading branch information
DmitryDodzin authored Aug 22, 2023
1 parent 26e653e commit a301ff6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
1 change: 1 addition & 0 deletions changelog.d/+operator-setup.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix operator setup so `MIRRORD_OPERATOR_IMAGE` will function properly.
17 changes: 10 additions & 7 deletions mirrord/operator/src/setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -301,13 +301,16 @@ impl OperatorDeployment {

let container = Container {
name: OPERATOR_NAME.to_owned(),
image: match option_env!("MIRRORD_OPERATOR_IMAGE") {
Some(image) => Some(image.to_owned()),
None => Some(format!(
"ghcr.io/metalbear-co/operator:{}",
env!("CARGO_PKG_VERSION")
)),
},
image: Some(
std::env::var("MIRRORD_OPERATOR_IMAGE")
.ok()
.unwrap_or_else(|| {
format!(
"ghcr.io/metalbear-co/operator:{}",
env!("CARGO_PKG_VERSION")
)
}),
),
image_pull_policy: Some("IfNotPresent".to_owned()),
env: Some(envs),
ports: Some(vec![ContainerPort {
Expand Down

0 comments on commit a301ff6

Please sign in to comment.