Skip to content

Commit fcdbca8

Browse files
authored
fix: remove legacy service account binding (#697)
* remove legacy service account binding * update changelog * remove sa dedup
1 parent 9339476 commit fcdbca8

File tree

2 files changed

+7
-27
lines changed

2 files changed

+7
-27
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ All notable changes to this project will be documented in this file.
3030
- The defaults from the docker images itself will now apply, which will be different from 1000/0 going forward
3131
- This is marked as breaking because tools and policies might exist, which require these fields to be set
3232
- Use versioned common structs ([#684]).
33+
- BREAKING: remove legacy service account binding for cluster role nodes ([#697]).
3334

3435
### Fixed
3536

@@ -52,6 +53,7 @@ All notable changes to this project will be documented in this file.
5253
[#693]: https://github.com/stackabletech/hdfs-operator/pull/693
5354
[#695]: https://github.com/stackabletech/hdfs-operator/pull/695
5455
[#696]: https://github.com/stackabletech/hdfs-operator/pull/696
56+
[#697]: https://github.com/stackabletech/hdfs-operator/pull/697
5557

5658
## [25.3.0] - 2025-03-21
5759

rust/operator-binary/src/hdfs_clusterrolebinding_nodes_controller.rs

Lines changed: 5 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -72,33 +72,11 @@ pub async fn reconcile(
7272
}
7373
}
7474
})
75-
.flat_map(|(meta, sa_name)| {
76-
let mut result = vec![
77-
Subject {
78-
kind: "ServiceAccount".to_string(),
79-
name: sa_name,
80-
namespace: meta.namespace.clone(),
81-
..Subject::default()
82-
},
83-
// This extra Serviceaccount is being written for legacy/compatibility purposes
84-
// to ensure that running clusters don't lose access to anything during an upgrade
85-
// of the Stackable operators, this code can be removed in later releases
86-
// The value is hardcoded here, as we have removed access to the private fns that
87-
// would have built it, since this is a known target though, and will be removed soon
88-
// this should not be an issue.
89-
Subject {
90-
kind: "ServiceAccount".to_string(),
91-
name: "hdfs-serviceaccount".to_string(),
92-
namespace: meta.namespace.clone(),
93-
..Subject::default()
94-
},
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
75+
.map(|(meta, sa_name)| Subject {
76+
kind: "ServiceAccount".to_string(),
77+
name: sa_name,
78+
namespace: meta.namespace.clone(),
79+
..Subject::default()
10280
})
10381
.collect();
10482

0 commit comments

Comments
 (0)