Skip to content

Commit 6686815

Browse files
committed
fix: cargo fmt
1 parent caade66 commit 6686815

File tree

3 files changed

+44
-28
lines changed

3 files changed

+44
-28
lines changed

rustrial-k8s-object-syncer-apis/src/lib.rs

Lines changed: 41 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::collections::HashSet;
22

33
use k8s_openapi::chrono::{SecondsFormat, Utc};
4-
use kube::{api::ObjectMeta, CustomResource, ResourceExt};
4+
use kube::{CustomResource, ResourceExt, api::ObjectMeta};
55

66
use schemars::JsonSchema;
77
use serde::{Deserialize, Serialize};
@@ -434,33 +434,49 @@ mod tests {
434434
};
435435

436436
// Do not overwrite source (same name & namespace)
437-
assert!(all_namespaces
438-
.applies_to(&obj, "source_namespace")
439-
.is_none());
440-
assert!(source_namespace
441-
.applies_to(&obj, "source_namespace")
442-
.is_none());
437+
assert!(
438+
all_namespaces
439+
.applies_to(&obj, "source_namespace")
440+
.is_none()
441+
);
442+
assert!(
443+
source_namespace
444+
.applies_to(&obj, "source_namespace")
445+
.is_none()
446+
);
443447
// Apply if not source but same namespace
444-
assert!(all_namespaces_other_name
445-
.applies_to(&obj, "source_namespace")
446-
.is_some());
447-
assert!(source_namespace_other_name
448-
.applies_to(&obj, "source_namespace")
449-
.is_some());
448+
assert!(
449+
all_namespaces_other_name
450+
.applies_to(&obj, "source_namespace")
451+
.is_some()
452+
);
453+
assert!(
454+
source_namespace_other_name
455+
.applies_to(&obj, "source_namespace")
456+
.is_some()
457+
);
450458
// Apply if different namespace
451459
assert!(all_namespaces.applies_to(&obj, "other_namespace").is_some());
452-
assert!(other_namespace
453-
.applies_to(&obj, "other_namespace")
454-
.is_some());
455-
assert!(all_namespaces_other_name
456-
.applies_to(&obj, "other_namespace")
457-
.is_some());
460+
assert!(
461+
other_namespace
462+
.applies_to(&obj, "other_namespace")
463+
.is_some()
464+
);
465+
assert!(
466+
all_namespaces_other_name
467+
.applies_to(&obj, "other_namespace")
468+
.is_some()
469+
);
458470
// Refuse if destination namespace does not match
459-
assert!(source_namespace_other_name
460-
.applies_to(&obj, "other_namespace")
461-
.is_none());
462-
assert!(other_namespace
463-
.applies_to(&obj, "source_namespace")
464-
.is_none());
471+
assert!(
472+
source_namespace_other_name
473+
.applies_to(&obj, "other_namespace")
474+
.is_none()
475+
);
476+
assert!(
477+
other_namespace
478+
.applies_to(&obj, "source_namespace")
479+
.is_none()
480+
);
465481
}
466482
}

rustrial-k8s-object-syncer/src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
#[macro_use]
22
extern crate log;
33

4-
use anyhow::{anyhow, Context};
4+
use anyhow::{Context, anyhow};
55
use futures::TryStreamExt;
66
use k8s_openapi::api::core::v1::Namespace;
77
use kube::{Api, Client};
88
use kube_runtime::{
9+
WatchStreamExt,
910
reflector::{reflector, store::Writer},
1011
watcher::{self},
11-
WatchStreamExt,
1212
};
1313
use opentelemetry::global;
1414
use opentelemetry_sdk::metrics::SdkMeterProvider;

rustrial-k8s-object-syncer/src/prometheus_exporter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
use http_body_util::Full;
22
use hyper::{
3+
Request, Response,
34
body::{Bytes, Incoming},
45
header::CONTENT_TYPE,
56
server::conn::http1,
67
service::service_fn,
7-
Request, Response,
88
};
99
use hyper_util::rt::TokioIo;
1010
use prometheus::{Encoder, Registry, TextEncoder};

0 commit comments

Comments
 (0)