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
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@ All notable changes to this project will be documented in this file.

### Changed

- Bump stackable-operator to 0.114.0 ([#166]).
- Bump stackable-operator to 0.116.0 ([#166], [#171]).
- BREAKING: Remove the `app.kubernetes.io/version` label from the listener PVC templates of the
StatefulSets (previously set to the product version). StatefulSets created by older operator
versions cannot be updated in place: after the operator upgrade, delete each nodes StatefulSet
so that the operator immediately recreates it with the new labels ([#171]).
- `envOverrides` names are now validated by the shared `EnvVarName` type rather than by
operator-specific validation code ([#171]).
- All product containers now run with `securityContext.runAsNonRoot` set to `true` to improve security ([#172]).

### Fixed
Expand All @@ -16,6 +22,7 @@ All notable changes to this project will be documented in this file.
See [our internal issue](https://github.com/stackabletech/hdfs-operator/issues/626) and [the fix](https://github.com/kube-rs/kube/pull/2042) for details ([#172]).

[#166]: https://github.com/stackabletech/opensearch-operator/pull/166
[#171]: https://github.com/stackabletech/opensearch-operator/pull/171
[#172]: https://github.com/stackabletech/opensearch-operator/pull/172

## [26.7.0] - 2026-07-21
Expand Down
20 changes: 10 additions & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

41 changes: 21 additions & 20 deletions Cargo.nix

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ edition = "2024"
repository = "https://github.com/stackabletech/opensearch-operator"

[workspace.dependencies]
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "stackable-operator-0.115.0", features = ["webhook"] }
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "stackable-operator-0.116.0", features = ["webhook"] }

built = { version = "0.8", features = ["chrono", "git2"] }
clap = "4.6"
Expand Down
18 changes: 9 additions & 9 deletions crate-hashes.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions extra/crds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1925,7 +1925,8 @@ spec:
default: {}
description: |-
`envOverrides` configure environment variables to be set in the Pods.
It is a map from strings to strings - environment variables and the value to set.
It is a map from environment variable names to their values. The names are validated to be
valid environment variable names.
Read the
[environment variable overrides documentation](https://docs.stackable.tech/home/nightly/concepts/overrides#env-overrides)
for more information and consult the operator specific usage guide to find out about
Expand Down Expand Up @@ -2656,7 +2657,8 @@ spec:
default: {}
description: |-
`envOverrides` configure environment variables to be set in the Pods.
It is a map from strings to strings - environment variables and the value to set.
It is a map from environment variable names to their values. The names are validated to be
valid environment variable names.
Read the
[environment variable overrides documentation](https://docs.stackable.tech/home/nightly/concepts/overrides#env-overrides)
for more information and consult the operator specific usage guide to find out about
Expand Down
24 changes: 11 additions & 13 deletions rust/operator-binary/src/controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ use stackable_operator::{
affinity::StackableAffinity, networking::DomainName,
product_image_selection::ResolvedProductImage,
},
constant,
crd::listener,
k8s_openapi::api::{
apps::v1::StatefulSet,
Expand Down Expand Up @@ -65,6 +66,9 @@ pub const TRANSPORT_PORT_NAME: &str = "transport";
pub const TRANSPORT_PORT: Port = Port(9300);
pub const FIELD_MANAGER: &str = "opensearch-operator";

// The name of the single OpenSearch role.
constant!(pub NODES_ROLE_NAME: RoleName = "nodes");

/// Names in the controller context which are passed to the submodules of the controller
///
/// The names are not directly defined in [`Context`] because not every submodule requires a
Expand Down Expand Up @@ -306,11 +310,6 @@ impl ValidatedCluster {
}
}

/// Returns the one role name
pub fn role_name() -> RoleName {
RoleName::from_str("nodes").expect("should be a valid role name")
}

/// Returns true if only a single OpenSearch node is defined in the cluster
pub fn is_single_node(&self) -> bool {
self.node_count() == 1
Expand Down Expand Up @@ -340,10 +339,7 @@ impl ValidatedCluster {
ValidatedSecurity::ManagedByApi {
tls_server_secret_class: Some(_),
..
} | ValidatedSecurity::ManagedByOperator {
tls_server_secret_class: _,
..
}
} | ValidatedSecurity::ManagedByOperator { .. }
)
}
}
Expand Down Expand Up @@ -529,7 +525,9 @@ mod tests {
};
use uuid::uuid;

use super::{Context, OpenSearchRoleGroupConfig, ValidatedCluster, ValidatedLogging};
use super::{
Context, NODES_ROLE_NAME, OpenSearchRoleGroupConfig, ValidatedCluster, ValidatedLogging,
};
use crate::{
controller::{
OpenSearchNodeResources, ValidatedNodeRole, ValidatedNodeRoles,
Expand All @@ -548,9 +546,9 @@ mod tests {
}

#[test]
fn test_validated_cluster_role_name() {
// Test that the function does not panic
ValidatedCluster::role_name();
fn test_constants() {
// Test that dereferencing the constants does not panic.
let _ = *NODES_ROLE_NAME;
}

#[test]
Expand Down
6 changes: 3 additions & 3 deletions rust/operator-binary/src/controller/build/node_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use stackable_operator::{
use super::ValidatedCluster;
use crate::{
controller::{
OpenSearchRoleGroupConfig, ValidatedNodeRole,
NODES_ROLE_NAME, OpenSearchRoleGroupConfig, ValidatedNodeRole,
build::role_group_builder::RoleGroupSecurityMode, replicas,
},
crd::v1alpha1,
Expand Down Expand Up @@ -264,7 +264,7 @@ impl NodeConfig {
.map(|role_group_name| {
let resource_names = ResourceNames {
cluster_name: self.cluster.name.clone(),
role_name: ValidatedCluster::role_name(),
role_name: NODES_ROLE_NAME.clone(),
role_group_name: role_group_name.clone(),
};

Expand Down Expand Up @@ -494,7 +494,7 @@ impl NodeConfig {
for (role_group_name, role_group_config) in cluster_manager_configs {
let role_group_resource_names = role_group_utils::ResourceNames {
cluster_name: self.cluster.name.clone(),
role_name: ValidatedCluster::role_name(),
role_name: NODES_ROLE_NAME.clone(),
role_group_name,
};

Expand Down
Loading