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 @@ -55,7 +55,7 @@ All notable changes to this project will be documented in this file.
deletion is required ([#880]).
- The operator now watches all resources that it creates and early-exits the reconcile action when the
cluster is marked for deletion ([#882]).
- Make operations infallible where dependent on static inputs ([#886]).
- Make operations infallible where dependent on static inputs ([#886], [#889]).

### Fixed

Expand Down Expand Up @@ -83,6 +83,7 @@ All notable changes to this project will be documented in this file.
[#880]: https://github.com/stackabletech/opa-operator/pull/880
[#882]: https://github.com/stackabletech/opa-operator/pull/882
[#886]: https://github.com/stackabletech/opa-operator/pull/886
[#889]: https://github.com/stackabletech/opa-operator/pull/889

## [26.7.0] - 2026-07-21

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ use stackable_operator::{
product_logging::framework::{
STACKABLE_LOG_DIR, ValidatedContainerLogConfigChoice, vector_container,
},
types::kubernetes::{ContainerName, VolumeName},
types::kubernetes::VolumeName,
},
};

Expand Down Expand Up @@ -283,20 +283,17 @@ pub fn build_server_rolegroup_daemonset(

let mut pb = PodBuilder::new();

let prepare_container_name: &ContainerName = &Container::Prepare;
let mut cb_prepare = new_container_builder(prepare_container_name);
let mut cb_prepare = new_container_builder(Container::Prepare.name());

let bundle_builder_container_name: &ContainerName = &Container::BundleBuilder;
let mut cb_bundle_builder = new_container_builder(bundle_builder_container_name);
let mut cb_bundle_builder = new_container_builder(Container::BundleBuilder.name());

let opa_container_name: &ContainerName = &Container::Opa;
let mut cb_opa = new_container_builder(opa_container_name);
let mut cb_opa = new_container_builder(Container::Opa.name());

cb_prepare
.image_from_product_image(resolved_product_image)
.command(bash_entrypoint_command())
.args(vec![
build_prepare_start_command(merged_config, prepare_container_name.as_ref())
build_prepare_start_command(merged_config, Container::Prepare.name().as_ref())
.join(" && "),
])
.add_volume_mount(BUNDLES_VOLUME_NAME.as_ref(), BUNDLES_DIR)
Expand All @@ -321,7 +318,7 @@ pub fn build_server_rolegroup_daemonset(
.command(bash_entrypoint_command())
.args(vec![build_bundle_builder_start_command(
merged_config,
bundle_builder_container_name.as_ref(),
Container::BundleBuilder.name().as_ref(),
)])
.add_env_vars(bundle_builder_env_vars)
.add_volume_mount(BUNDLES_VOLUME_NAME.as_ref(), BUNDLES_DIR)
Expand Down Expand Up @@ -355,7 +352,7 @@ pub fn build_server_rolegroup_daemonset(
.command(bash_entrypoint_command())
.args(vec![build_opa_start_command(
merged_config,
opa_container_name.as_ref(),
Container::Opa.name().as_ref(),
cluster.is_tls_enabled(),
&rolegroup_config.cli_overrides,
)])
Expand Down Expand Up @@ -504,7 +501,7 @@ pub fn build_server_rolegroup_daemonset(
// the Vector agent is enabled and the aggregator discovery ConfigMap name is valid.
if let Some(vector_log_config) = &merged_config.logging.vector_container {
pb.add_container(vector_container(
&Container::Vector,
Container::Vector.name(),
resolved_product_image,
vector_log_config,
&cluster.role_group_resource_names(role_group_name),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ pub fn add_resource_info_fetcher_sidecar(
cluster_info: &KubernetesClusterInfo,
) -> Result<()> {
if let Some(resource_info) = &cluster.cluster_config.resource_info {
let mut cb_rif = new_container_builder(&Container::ResourceInfoFetcher);
let mut cb_rif = new_container_builder(Container::ResourceInfoFetcher.name());

// All operator-set environment variables of the resource-info-fetcher container, collected
// into an `EnvVarSet` so that every name occurs only once.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ pub fn add_user_info_fetcher_sidecar(
cluster_info: &KubernetesClusterInfo,
) -> Result<()> {
if let Some(user_info) = &cluster.cluster_config.user_info {
let mut cb_user_info_fetcher = new_container_builder(&Container::UserInfoFetcher);
let mut cb_user_info_fetcher = new_container_builder(Container::UserInfoFetcher.name());

// All operator-set environment variables of the user-info-fetcher container, collected
// into an `EnvVarSet` so that every name occurs only once. The backend match below may
Expand Down
18 changes: 7 additions & 11 deletions rust/operator-binary/src/crd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,10 +228,9 @@ constant!(OPA_CONTAINER_NAME: ContainerName = "opa");
constant!(USER_INFO_FETCHER_CONTAINER_NAME: ContainerName = "user-info-fetcher");
constant!(RESOURCE_INFO_FETCHER_CONTAINER_NAME: ContainerName = "resource-info-fetcher");

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 @@ -355,9 +354,7 @@ impl HasStatusCondition for v1alpha2::OpaCluster {
#[cfg(test)]
mod tests {
use indoc::formatdoc;
use stackable_operator::{
v2::types::kubernetes::ContainerName, versioned::test_utils::RoundtripTestData,
};
use stackable_operator::versioned::test_utils::RoundtripTestData;
use strum::IntoEnumIterator;

use super::{
Expand All @@ -378,13 +375,12 @@ mod tests {
let _ = *RESOURCE_INFO_FETCHER_CONTAINER_NAME;
}

/// The typed container names behind `Container`'s `Deref` must agree with its strum
/// `Display`, which the logging configuration still uses as the per-container key.
/// The typed container names returned by `name` must agree with the strum `Display`
/// of `Container`, which the logging configuration still uses as the per-container key.
#[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