Skip to content

Commit fe94775

Browse files
committed
Formatting
1 parent a7450c5 commit fe94775

File tree

2 files changed

+35
-41
lines changed

2 files changed

+35
-41
lines changed

rust/operator-binary/src/crd/affinity.rs

Lines changed: 31 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -61,39 +61,36 @@ mod tests {
6161
.merged_config(&role, &role.rolegroup_ref(&hive, "default"))
6262
.unwrap();
6363

64-
assert_eq!(
65-
merged_config.affinity,
66-
StackableAffinity {
67-
pod_affinity: None,
68-
pod_anti_affinity: Some(PodAntiAffinity {
69-
preferred_during_scheduling_ignored_during_execution: Some(vec![
70-
WeightedPodAffinityTerm {
71-
pod_affinity_term: PodAffinityTerm {
72-
label_selector: Some(LabelSelector {
73-
match_labels: Some(BTreeMap::from([
74-
("app.kubernetes.io/name".to_string(), "hive".to_string(),),
75-
(
76-
"app.kubernetes.io/instance".to_string(),
77-
"simple-hive".to_string(),
78-
),
79-
(
80-
"app.kubernetes.io/component".to_string(),
81-
"metastore".to_string(),
82-
)
83-
])),
84-
..LabelSelector::default()
85-
}),
86-
topology_key: "kubernetes.io/hostname".to_string(),
87-
..PodAffinityTerm::default()
88-
},
89-
weight: 70
90-
}
91-
]),
92-
required_during_scheduling_ignored_during_execution: None,
93-
}),
94-
node_affinity: None,
95-
node_selector: None,
96-
}
97-
);
64+
assert_eq!(merged_config.affinity, StackableAffinity {
65+
pod_affinity: None,
66+
pod_anti_affinity: Some(PodAntiAffinity {
67+
preferred_during_scheduling_ignored_during_execution: Some(vec![
68+
WeightedPodAffinityTerm {
69+
pod_affinity_term: PodAffinityTerm {
70+
label_selector: Some(LabelSelector {
71+
match_labels: Some(BTreeMap::from([
72+
("app.kubernetes.io/name".to_string(), "hive".to_string(),),
73+
(
74+
"app.kubernetes.io/instance".to_string(),
75+
"simple-hive".to_string(),
76+
),
77+
(
78+
"app.kubernetes.io/component".to_string(),
79+
"metastore".to_string(),
80+
)
81+
])),
82+
..LabelSelector::default()
83+
}),
84+
topology_key: "kubernetes.io/hostname".to_string(),
85+
..PodAffinityTerm::default()
86+
},
87+
weight: 70
88+
}
89+
]),
90+
required_during_scheduling_ignored_during_execution: None,
91+
}),
92+
node_affinity: None,
93+
node_selector: None,
94+
});
9895
}
9996
}

rust/operator-binary/src/main.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,10 @@ async fn main() -> anyhow::Result<()> {
9090
&cluster_info_opts,
9191
)
9292
.await?;
93-
let event_recorder = Arc::new(Recorder::new(
94-
client.as_kube_client(),
95-
Reporter {
96-
controller: HIVE_FULL_CONTROLLER_NAME.to_string(),
97-
instance: None,
98-
},
99-
));
93+
let event_recorder = Arc::new(Recorder::new(client.as_kube_client(), Reporter {
94+
controller: HIVE_FULL_CONTROLLER_NAME.to_string(),
95+
instance: None,
96+
}));
10097

10198
let hive_controller = Controller::new(
10299
watch_namespace.get_api::<DeserializeGuard<v1alpha1::HiveCluster>>(&client),

0 commit comments

Comments
 (0)