Skip to content

Commit a7450c5

Browse files
committed
Formatting
1 parent cfab372 commit a7450c5

File tree

2 files changed

+41
-35
lines changed

2 files changed

+41
-35
lines changed

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

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

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-
});
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+
);
9598
}
9699
}

rust/operator-binary/src/main.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,13 @@ async fn main() -> anyhow::Result<()> {
9090
&cluster_info_opts,
9191
)
9292
.await?;
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-
}));
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+
));
97100

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

0 commit comments

Comments
 (0)