Skip to content

Commit bbaa5fc

Browse files
committed
Added removal of duplicate roleBindings in case a cluster is called hdfs.
1 parent 51c8fc3 commit bbaa5fc

File tree

3 files changed

+18
-12
lines changed

3 files changed

+18
-12
lines changed

Cargo.nix

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crate-hashes.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/operator-binary/src/hdfs_clusterrolebinding_nodes_controller.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ pub async fn reconcile(
7373
}
7474
})
7575
.map(|(meta, sa_name)| {
76-
vec![
76+
let mut result = vec![
7777
Subject {
7878
kind: "ServiceAccount".to_string(),
7979
name: sa_name,
@@ -92,7 +92,13 @@ pub async fn reconcile(
9292
namespace: meta.namespace.clone(),
9393
..Subject::default()
9494
},
95-
]
95+
];
96+
// If a cluster is called hdfs this would result in the same subject
97+
// being written twicex.
98+
// Since we know this vec only contains two elements we can use dedup for
99+
// simply removing this duplicate.
100+
result.dedup();
101+
result
96102
})
97103
.flat_map(|vec| vec.into_iter())
98104
.collect();

0 commit comments

Comments
 (0)