Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ All notable changes to this project will be documented in this file.
templates (all previously set to the placeholder value `none`). After the operator upgrade,
delete each coordinator StatefulSet so that the operator immediately recreates it with the
new labels ([#932]).
- Make operations infallible where dependent on static inputs ([#939]).
- Make operations infallible where dependent on static inputs ([#939], [#943]).

### Fixed

Expand All @@ -48,6 +48,7 @@ All notable changes to this project will be documented in this file.
[#932]: https://github.com/stackabletech/trino-operator/pull/932
[#934]: https://github.com/stackabletech/trino-operator/pull/934
[#939]: https://github.com/stackabletech/trino-operator/pull/939
[#943]: https://github.com/stackabletech/trino-operator/pull/943

## [26.7.0] - 2026-07-21

Expand Down
5 changes: 3 additions & 2 deletions rust/operator-binary/src/authentication/password/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,14 @@ pub fn build_password_file_update_container(
resolved_product_image: &ResolvedProductImage,
volume_mounts: Vec<VolumeMount>,
) -> Result<Container, Error> {
let mut cb_pw_file_updater = new_container_builder(&crate::crd::Container::PasswordFileUpdater);
let mut cb_pw_file_updater =
new_container_builder(crate::crd::Container::PasswordFileUpdater.name());

let mut commands = vec![];

commands.push(product_logging::framework::capture_shell_output(
STACKABLE_LOG_DIR,
&crate::crd::Container::PasswordFileUpdater.to_string(),
crate::crd::Container::PasswordFileUpdater.name().as_ref(),
// we do not access any of the crd config options for this and just log it to file
&AutomaticContainerLogConfig::default(),
));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ mod tests {
.expect("the fixture defines a worker role group")
.config;
let mut pod_builder = PodBuilder::new();
let mut trino_builder = new_container_builder(&Container::Trino);
let mut trino_builder = new_container_builder(Container::Trino.name());
add_graceful_shutdown_config(
&cluster,
&TrinoRole::Worker,
Expand Down Expand Up @@ -354,7 +354,7 @@ mod tests {
.expect("the fixture defines a coordinator role group")
.config;
let mut pod_builder = PodBuilder::new();
let mut trino_builder = new_container_builder(&Container::Trino);
let mut trino_builder = new_container_builder(Container::Trino.name());
add_graceful_shutdown_config(
&cluster,
&TrinoRole::Coordinator,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ pub fn build(
LOG_PATH.to_string(),
format!(
"{STACKABLE_LOG_DIR}/{container}/server.airlift.json",
container = Container::Trino
container = Container::Trino.name()
),
);
props.insert(LOG_COMPRESSION.to_string(), "none".to_string());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ pub fn build_rolegroup_statefulset(
let config_map_name = resource_names.role_group_config_map().to_string();

let mut pod_builder = PodBuilder::new();
let mut cb_prepare = new_container_builder(&Container::Prepare);
let mut cb_trino = new_container_builder(&Container::Trino);
let mut cb_prepare = new_container_builder(Container::Prepare.name());
let mut cb_trino = new_container_builder(Container::Trino.name());

// Operator-set env vars first; the user's `envOverrides` are merged on top last and win.
let mut env = EnvVarSet::new();
Expand Down Expand Up @@ -320,7 +320,7 @@ pub fn build_rolegroup_statefulset(
{
prepare_args.push(product_logging::framework::capture_shell_output(
STACKABLE_LOG_DIR,
&Container::Prepare.to_string(),
Container::Prepare.name().as_ref(),
log_config,
));
}
Expand Down Expand Up @@ -396,7 +396,7 @@ pub fn build_rolegroup_statefulset(

if let Some(vector_log_config) = &merged_config.logging.vector_container {
pod_builder.add_container(vector_container(
&Container::Vector,
Container::Vector.name(),
resolved_product_image,
vector_log_config,
&resource_names,
Expand Down
14 changes: 6 additions & 8 deletions rust/operator-binary/src/crd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -469,10 +469,9 @@ constant!(VECTOR_CONTAINER_NAME: ContainerName = "vector");
constant!(PASSWORD_FILE_UPDATER_CONTAINER_NAME: ContainerName = "password-file-updater");
constant!(TRINO_CONTAINER_NAME: ContainerName = "trino");

impl Deref for Container {
type Target = ContainerName;

fn deref(&self) -> &Self::Target {
impl Container {
/// The typed container name of this variant.
pub fn name(&self) -> &'static ContainerName {
match self {
Container::Prepare => &PREPARE_CONTAINER_NAME,
Container::Vector => &VECTOR_CONTAINER_NAME,
Expand Down Expand Up @@ -640,13 +639,12 @@ mod tests {
let _ = *TRINO_CONTAINER_NAME;
}

/// The typed container names behind `Container`'s `Deref` must agree with its strum `Display`,
/// which the rest of the operator still uses for log capture and container lookups.
/// The typed container names returned by `name` must agree with the strum `Display` of
/// `Container`, which operator-rs's `Logging<T>` requires and uses in error messages.
#[test]
fn container_names_match_display() {
for container in Container::iter() {
let container_name: &ContainerName = &container;
assert_eq!(container_name.to_string(), container.to_string());
assert_eq!(container.name().to_string(), container.to_string());
}
}

Expand Down
Loading