Skip to content

Commit 41dabfb

Browse files
committed
fix: rename build sts replicas to effective_replicas (due to upgrade logic) to clarify usage
1 parent dffd2fc commit 41dabfb

2 files changed

Lines changed: 4 additions & 6 deletions

File tree

rust/operator-binary/src/controller/build/resource/statefulset.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ pub(crate) async fn build_node_rolegroup_statefulset(
175175
role_group_name: &RoleGroupName,
176176
rg: &NifiRoleGroupConfig,
177177
rolling_update_supported: bool,
178-
replicas: Option<i32>,
178+
effective_replicas: Option<i32>,
179179
service_account_name: &str,
180180
) -> Result<StatefulSet> {
181181
tracing::debug!("Building statefulset");
@@ -675,7 +675,7 @@ pub(crate) async fn build_node_rolegroup_statefulset(
675675
.build(),
676676
spec: Some(StatefulSetSpec {
677677
pod_management_policy: Some("Parallel".to_string()),
678-
replicas,
678+
replicas: effective_replicas,
679679
selector: LabelSelector {
680680
match_labels: Some(cluster.role_group_selector(role_group_name).into()),
681681
..LabelSelector::default()

rust/operator-binary/src/nifi_controller.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -301,12 +301,10 @@ pub async fn reconcile_nifi(
301301
rolegroup: role_group_name.clone(),
302302
})?;
303303

304-
let replicas =
304+
let effective_replicas =
305305
if cluster_version_update_state == ClusterVersionUpdateState::UpdateRequested {
306306
Some(0)
307307
} else {
308-
// `None` (HPA-managed role group) is passed straight through to the StatefulSet
309-
// so the Horizontal Pod Autoscaler owns the replica count.
310308
rg.replicas.map(i32::from)
311309
};
312310

@@ -316,7 +314,7 @@ pub async fn reconcile_nifi(
316314
role_group_name,
317315
rg,
318316
rolling_upgrade_supported,
319-
replicas,
317+
effective_replicas,
320318
&rbac_sa.name_any(),
321319
)
322320
.await

0 commit comments

Comments
 (0)