Skip to content

Commit 7fb3b4f

Browse files
authored
Merge pull request #434 from SYLVIANNORUKA/issue#356
feat :Add 'stellar-network' label to all child resources
2 parents 9c06435 + de6ef84 commit 7fb3b4f

3 files changed

Lines changed: 7 additions & 17 deletions

File tree

src/controller/resources.rs

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -533,20 +533,13 @@ pub async fn ensure_canary_deployment(
533533
deployment.metadata.name = Some(name.clone());
534534

535535
if let Some(spec) = &mut deployment.spec {
536-
let mut labels = spec
537-
.template
538-
.metadata
539-
.as_ref()
540-
.and_then(|m| m.labels.clone())
541-
.unwrap_or_default();
536+
let mut labels = standard_labels(&canary_node);
542537
labels.insert("stellar.org/rollout-type".to_string(), "canary".to_string());
543538
spec.template.metadata.as_mut().unwrap().labels = Some(labels.clone());
544539
spec.selector.match_labels = Some(labels.clone());
545540

546541
let meta = &mut deployment.metadata;
547-
let mut meta_labels = meta.labels.clone().unwrap_or_default();
548-
meta_labels.insert("stellar.org/rollout-type".to_string(), "canary".to_string());
549-
meta.labels = Some(meta_labels);
542+
meta.labels = Some(labels);
550543
}
551544

552545
let patch = Patch::Apply(&deployment);
@@ -774,13 +767,11 @@ pub async fn ensure_canary_service(
774767
service.metadata.name = Some(name.clone());
775768

776769
if let Some(spec) = &mut service.spec {
777-
let mut selector = spec.selector.clone().unwrap_or_default();
778-
selector.insert("stellar.org/rollout-type".to_string(), "canary".to_string());
779-
spec.selector = Some(selector);
770+
let mut labels = standard_labels(node);
771+
labels.insert("stellar.org/rollout-type".to_string(), "canary".to_string());
772+
spec.selector = Some(labels.clone());
780773

781774
let meta = &mut service.metadata;
782-
let mut labels = meta.labels.clone().unwrap_or_default();
783-
labels.insert("stellar.org/rollout-type".to_string(), "canary".to_string());
784775
meta.labels = Some(labels);
785776
}
786777

src/rest_api/handlers.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ pub async fn get_search_index() -> axum::response::Response {
2929
.unwrap()
3030
}
3131

32-
/// Health endpoint
33-
#[instrument]
32+
/// Health check endpoint
3433
pub async fn health() -> Json<HealthResponse> {
3534
Json(HealthResponse {
3635
status: "healthy".to_string(),

src/sidecar.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use anyhow::{Context, Result};
2-
use futures::io::AsyncBufReadExt;
2+
use chrono::Utc;
33
use futures::StreamExt;
44
use k8s_openapi::api::core::v1::{Event, ObjectReference, Pod};
55
use kube::{

0 commit comments

Comments
 (0)