Skip to content

Commit c536653

Browse files
authored
fix: Bump stackable-operator for delayed controller functionality (#764)
* fix: Delay controller startup to avoid 404 in initial list * chore: Fix clippy lints * chore: Add changelog * chore: Add missing permissions
1 parent e348fbd commit c536653

File tree

9 files changed

+64
-52
lines changed

9 files changed

+64
-52
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@ All notable changes to this project will be documented in this file.
1313

1414
### Changed
1515

16-
- Bump stackable-operator to 0.106.2, and strum to 0.28 ([#760]).
16+
- Bump stackable-operator to 0.108.0, and strum to 0.28 ([#760], [#764]).
1717
- Gracefully shutdown all concurrent tasks by forwarding the SIGTERM signal ([#747]).
1818
- Added warning and exit condition to format-namenodes container script to check for corrupted data after formatting ([#751]).
1919

2020
### Fixed
2121

22+
- Fix "404 page not found" error for the initial object list ([#764]).
2223
- Previously, some shell output of init-containers was not logged properly and therefore not aggregated, which is fixed now ([#746]).
2324

2425
[#738]: https://github.com/stackabletech/hdfs-operator/pull/738
@@ -28,6 +29,7 @@ All notable changes to this project will be documented in this file.
2829
[#751]: https://github.com/stackabletech/hdfs-operator/pull/751
2930
[#753]: https://github.com/stackabletech/hdfs-operator/pull/753
3031
[#760]: https://github.com/stackabletech/hdfs-operator/pull/760
32+
[#764]: https://github.com/stackabletech/hdfs-operator/pull/764
3133

3234
## [25.11.0] - 2025-11-07
3335

Cargo.lock

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

Cargo.nix

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

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ repository = "https://github.com/stackabletech/hdfs-operator"
1111

1212
[workspace.dependencies]
1313
product-config = { git = "https://github.com/stackabletech/product-config.git", tag = "0.8.0" }
14-
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "stackable-operator-0.106.2", features = ["telemetry", "versioned", "webhook"] }
14+
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "stackable-operator-0.108.0", features = ["crds", "webhook"] }
1515

1616
anyhow = "1.0"
1717
built = { version = "0.8", features = ["chrono", "git2"] }

crate-hashes.json

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

deploy/helm/hdfs-operator/templates/roles.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ rules:
9797
{{- if .Values.maintenance.customResourceDefinitions.maintain }}
9898
- create
9999
- patch
100+
# Required for startup condition
101+
- list
102+
- watch
100103
{{- end }}
101104
- apiGroups:
102105
- events.k8s.io

rust/operator-binary/src/crd/storage.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -156,25 +156,23 @@ fn default_number_of_datanode_pvcs() -> Option<u16> {
156156
Some(1)
157157
}
158158

159-
#[derive(Clone, Debug, Deserialize, Eq, JsonSchema, PartialEq, Serialize)]
159+
#[derive(Clone, Debug, Default, Deserialize, Eq, JsonSchema, PartialEq, Serialize)]
160160
#[serde(rename_all = "PascalCase")]
161161
pub enum HdfsStorageType {
162162
Archive,
163+
164+
#[default]
163165
Disk,
166+
164167
#[serde(rename = "SSD")]
165168
Ssd,
169+
166170
#[serde(rename = "RAMDisk")]
167171
RamDisk,
168172
}
169173

170174
impl Atomic for HdfsStorageType {}
171175

172-
impl Default for HdfsStorageType {
173-
fn default() -> Self {
174-
Self::Disk
175-
}
176-
}
177-
178176
impl HdfsStorageType {
179177
pub fn as_hdfs_config_literal(&self) -> &str {
180178
match self {

rust/operator-binary/src/event.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ pub fn build_invalid_replica_message(
6060
Some(format!(
6161
"{role_name}: only has {replicas} replicas configured, it is strongly recommended to use at least [{min_replicas}]"
6262
))
63-
} else if !role.replicas_can_be_even() && replicas % 2 == 0 {
63+
} else if !role.replicas_can_be_even() && replicas.is_multiple_of(2) {
6464
Some(format!(
6565
"{role_name}: currently has an even number of replicas [{replicas}], but should always have an odd number to ensure quorum"
6666
))

rust/operator-binary/src/main.rs

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use stackable_operator::{
1818
core::v1::{ConfigMap, Service},
1919
},
2020
kube::{
21-
Api, ResourceExt,
21+
Api, CustomResourceExt, ResourceExt,
2222
api::PartialObjectMeta,
2323
core::DeserializeGuard,
2424
runtime::{
@@ -31,7 +31,7 @@ use stackable_operator::{
3131
logging::controller::report_controller_reconciled,
3232
shared::yaml::SerializeOptions,
3333
telemetry::Tracing,
34-
utils::signal::SignalWatcher,
34+
utils::signal::{self, SignalWatcher},
3535
};
3636
use tracing::info_span;
3737
use tracing_futures::Instrument;
@@ -215,8 +215,18 @@ async fn main() -> anyhow::Result<()> {
215215
.instrument(info_span!("hdfs_controller"))
216216
.map(anyhow::Ok);
217217

218+
let delayed_hdfs_controller = async {
219+
signal::crd_established(&client, v1alpha1::HdfsCluster::crd_name(), None).await?;
220+
hdfs_controller.await
221+
};
222+
218223
// kube-runtime's Controller will tokio::spawn each reconciliation, so this only concerns the internal watch machinery
219-
futures::try_join!(hdfs_controller, reflector, eos_checker, webhook_server)?;
224+
futures::try_join!(
225+
delayed_hdfs_controller,
226+
webhook_server,
227+
eos_checker,
228+
reflector,
229+
)?;
220230
}
221231
};
222232

0 commit comments

Comments
 (0)