Skip to content
7 changes: 7 additions & 0 deletions crates/stackable-operator/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.

## [Unreleased]

### Added

- [v2]: Make `ResourceNames::ensure_max_length` public ([#1260]).
- [v2]: Add `MAX_ANNOTATION_NAME_LENGTH` constant with a value of `63` ([#1260]).

[#1260]: https://github.com/stackabletech/operator-rs/pull/1260

## [0.115.0] - 2026-08-04

### Changed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ use strum::{EnumDiscriminants, IntoStaticStr};
/// Duplicates the private constant [`crate::kvp::LABEL_VALUE_MAX_LEN`]
pub const MAX_LABEL_VALUE_LENGTH: usize = 63;

/// Maximum length of annotation names
pub const MAX_ANNOTATION_NAME_LENGTH: usize = 63;
Comment thread
siegfriedweber marked this conversation as resolved.
Outdated

#[derive(Debug, EnumDiscriminants, Snafu)]
#[snafu(visibility(pub))]
#[strum_discriminants(derive(IntoStaticStr))]
Expand Down
6 changes: 5 additions & 1 deletion crates/stackable-operator/src/v2/role_group_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,11 @@ impl ResourceNames {
/// `max_length < 1 /* character */ + 1 /* dash */ + hash_length`.
///
/// Kubernetes object names cannot contain non-ASCII characters.
fn ensure_max_length(resource_name: String, max_length: usize, hash_length: usize) -> String {
pub fn ensure_max_length(
resource_name: String,
max_length: usize,
hash_length: usize,
) -> String {
Comment thread
siegfriedweber marked this conversation as resolved.
Outdated
assert!(resource_name.is_ascii());
assert!(max_length >= 1 /* character */ + 1 /* dash */ + hash_length);

Expand Down