Skip to content

Commit 51c8fc3

Browse files
committed
Added legacy serviceAccount name to clusterrolebinding.
1 parent bdb93eb commit 51c8fc3

File tree

1 file changed

+22
-5
lines changed

1 file changed

+22
-5
lines changed

rust/operator-binary/src/hdfs_clusterrolebinding_nodes_controller.rs

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,29 @@ pub async fn reconcile(
7272
}
7373
}
7474
})
75-
.map(|(meta, sa_name)| Subject {
76-
kind: "ServiceAccount".to_string(),
77-
name: sa_name,
78-
namespace: meta.namespace.clone(),
79-
..Subject::default()
75+
.map(|(meta, sa_name)| {
76+
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+
]
8096
})
97+
.flat_map(|vec| vec.into_iter())
8198
.collect();
8299

83100
let patch = Patch::Apply(json!({

0 commit comments

Comments
 (0)