Skip to content

Commit 2ad77ff

Browse files
committed
remove sa dedup
1 parent 32e461c commit 2ad77ff

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

rust/operator-binary/src/hdfs_clusterrolebinding_nodes_controller.rs

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -72,19 +72,11 @@ pub async fn reconcile(
7272
}
7373
}
7474
})
75-
.flat_map(|(meta, sa_name)| {
76-
let mut result = vec![Subject {
77-
kind: "ServiceAccount".to_string(),
78-
name: sa_name,
79-
namespace: meta.namespace.clone(),
80-
..Subject::default()
81-
}];
82-
// If a cluster is called hdfs this would result in the same subject
83-
// being written twicex.
84-
// Since we know this vec only contains two elements we can use dedup for
85-
// simply removing this duplicate.
86-
result.dedup();
87-
result
75+
.map(|(meta, sa_name)| Subject {
76+
kind: "ServiceAccount".to_string(),
77+
name: sa_name,
78+
namespace: meta.namespace.clone(),
79+
..Subject::default()
8880
})
8981
.collect();
9082

0 commit comments

Comments
 (0)