Skip to content
Open
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: 3 additions & 0 deletions deploy/helm/opensearch-operator/crds/crds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ spec:
maxLength: 253
minLength: 1
nullable: true
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
type: string
type: object
clusterOperation:
Expand Down Expand Up @@ -191,6 +192,7 @@ spec:
maxLength: 253
minLength: 1
nullable: true
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
type: string
logging:
default:
Expand Down Expand Up @@ -539,6 +541,7 @@ spec:
maxLength: 253
minLength: 1
nullable: true
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
type: string
logging:
default:
Expand Down
17 changes: 13 additions & 4 deletions rust/operator-binary/src/controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,16 @@ use crate::{
v1alpha1::{self},
},
framework::{
ClusterName, ControllerName, HasName, HasUid, ListenerClassName, NameIsValidLabelValue,
NamespaceName, OperatorName, ProductName, ProductVersion, RoleGroupName, RoleName, Uid,
HasName, HasUid, NameIsValidLabelValue,
product_logging::framework::{ValidatedContainerLogConfigChoice, VectorContainerLogConfig},
role_utils::{GenericProductSpecificCommonConfig, RoleGroupConfig},
types::{
kubernetes::{ListenerClassName, NamespaceName, Uid},
operator::{
ClusterName, ControllerName, OperatorName, ProductName, ProductVersion,
RoleGroupName, RoleName,
},
},
},
};

Expand Down Expand Up @@ -380,10 +386,13 @@ mod tests {
controller::{OpenSearchNodeResources, ValidatedOpenSearchConfig},
crd::{NodeRoles, v1alpha1},
framework::{
ClusterName, ListenerClassName, NamespaceName, OperatorName, ProductVersion,
RoleGroupName, builder::pod::container::EnvVarSet,
builder::pod::container::EnvVarSet,
product_logging::framework::ValidatedContainerLogConfigChoice,
role_utils::GenericProductSpecificCommonConfig,
types::{
kubernetes::{ListenerClassName, NamespaceName},
operator::{ClusterName, OperatorName, ProductVersion, RoleGroupName},
},
},
};

Expand Down
8 changes: 7 additions & 1 deletion rust/operator-binary/src/controller/apply.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@ use stackable_operator::{
use strum::{EnumDiscriminants, IntoStaticStr};

use super::{Applied, ContextNames, KubernetesResources, Prepared};
use crate::framework::{ClusterName, NamespaceName, Uid, cluster_resources::cluster_resources_new};
use crate::framework::{
cluster_resources::cluster_resources_new,
types::{
kubernetes::{NamespaceName, Uid},
operator::ClusterName,
},
};

#[derive(Snafu, Debug, EnumDiscriminants)]
#[strum_discriminants(derive(IntoStaticStr))]
Expand Down
10 changes: 8 additions & 2 deletions rust/operator-binary/src/controller/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,15 @@ mod tests {
},
crd::{NodeRoles, v1alpha1},
framework::{
ClusterName, ControllerName, ListenerClassName, NamespaceName, OperatorName,
ProductName, ProductVersion, RoleGroupName, builder::pod::container::EnvVarSet,
builder::pod::container::EnvVarSet,
role_utils::GenericProductSpecificCommonConfig,
types::{
kubernetes::{ListenerClassName, NamespaceName},
operator::{
ClusterName, ControllerName, OperatorName, ProductName, ProductVersion,
RoleGroupName,
},
},
},
};

Expand Down
7 changes: 5 additions & 2 deletions rust/operator-binary/src/controller/build/node_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ use crate::{
controller::OpenSearchRoleGroupConfig,
crd::v1alpha1,
framework::{
RoleGroupName, ServiceName,
builder::pod::container::{EnvVarName, EnvVarSet},
role_group_utils,
types::{kubernetes::ServiceName, operator::RoleGroupName},
},
};

Expand Down Expand Up @@ -296,9 +296,12 @@ mod tests {
controller::{ValidatedLogging, ValidatedOpenSearchConfig},
crd::NodeRoles,
framework::{
ClusterName, ListenerClassName, NamespaceName, ProductVersion, RoleGroupName,
product_logging::framework::ValidatedContainerLogConfigChoice,
role_utils::GenericProductSpecificCommonConfig,
types::{
kubernetes::{ListenerClassName, NamespaceName},
operator::{ClusterName, ProductVersion, RoleGroupName},
},
},
};

Expand Down
10 changes: 8 additions & 2 deletions rust/operator-binary/src/controller/build/role_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,9 +241,15 @@ mod tests {
},
crd::{NodeRoles, v1alpha1},
framework::{
ClusterName, ControllerName, ListenerClassName, NamespaceName, OperatorName,
ProductName, ProductVersion, RoleGroupName, builder::pod::container::EnvVarSet,
builder::pod::container::EnvVarSet,
role_utils::GenericProductSpecificCommonConfig,
types::{
kubernetes::{ListenerClassName, NamespaceName},
operator::{
ClusterName, ControllerName, OperatorName, ProductName, ProductVersion,
RoleGroupName,
},
},
},
};

Expand Down
19 changes: 15 additions & 4 deletions rust/operator-binary/src/controller/build/role_group_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ use crate::{
},
crd::v1alpha1,
framework::{
PersistentVolumeClaimName, RoleGroupName, ServiceAccountName, ServiceName, VolumeName,
builder::{
meta::ownerreference_from_resource,
pod::{
Expand All @@ -55,6 +54,10 @@ use crate::{
STACKABLE_LOG_DIR, ValidatedContainerLogConfigChoice, vector_container,
},
role_group_utils::ResourceNames,
types::{
kubernetes::{PersistentVolumeClaimName, ServiceAccountName, ServiceName, VolumeName},
operator::RoleGroupName,
},
},
};

Expand Down Expand Up @@ -663,11 +666,19 @@ mod tests {
},
crd::{NodeRoles, v1alpha1},
framework::{
ClusterName, ConfigMapName, ControllerName, ListenerClassName, NamespaceName,
OperatorName, ProductName, ProductVersion, RoleGroupName, ServiceAccountName,
ServiceName, builder::pod::container::EnvVarSet,
builder::pod::container::EnvVarSet,
product_logging::framework::VectorContainerLogConfig,
role_utils::GenericProductSpecificCommonConfig,
types::{
kubernetes::{
ConfigMapName, ListenerClassName, NamespaceName, ServiceAccountName,
ServiceName,
},
operator::{
ClusterName, ControllerName, OperatorName, ProductName, ProductVersion,
RoleGroupName,
},
},
},
};

Expand Down
34 changes: 26 additions & 8 deletions rust/operator-binary/src/controller/validate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,15 @@ use super::{
use crate::{
crd::v1alpha1::{self},
framework::{
ClusterName, ConfigMapName, NamespaceName, Uid,
builder::pod::container::{EnvVarName, EnvVarSet},
product_logging::framework::{
VectorContainerLogConfig, validate_logging_configuration_for_container,
},
role_utils::{GenericProductSpecificCommonConfig, RoleGroupConfig, with_validated_config},
types::{
kubernetes::{ConfigMapName, NamespaceName, Uid},
operator::ClusterName,
},
},
};

Expand All @@ -45,24 +48,34 @@ pub enum Error {
GetVectorAggregatorConfigMapName {},

#[snafu(display("failed to set cluster name"))]
ParseClusterName { source: crate::framework::Error },
ParseClusterName {
source: crate::framework::macros::attributed_string_type::Error,
},

#[snafu(display("failed to set cluster namespace"))]
ParseClusterNamespace { source: crate::framework::Error },
ParseClusterNamespace {
source: crate::framework::macros::attributed_string_type::Error,
},

#[snafu(display("failed to set UID"))]
ParseClusterUid { source: crate::framework::Error },
ParseClusterUid {
source: crate::framework::macros::attributed_string_type::Error,
},

#[snafu(display("failed to parse environment variable"))]
ParseEnvironmentVariable {
source: crate::framework::builder::pod::container::Error,
},

#[snafu(display("failed to set product version"))]
ParseProductVersion { source: crate::framework::Error },
ParseProductVersion {
source: crate::framework::macros::attributed_string_type::Error,
},

#[snafu(display("failed to set role-group name"))]
ParseRoleGroupName { source: crate::framework::Error },
ParseRoleGroupName {
source: crate::framework::macros::attributed_string_type::Error,
},

#[snafu(display("failed to resolve product image"))]
ResolveProductImage {
Expand Down Expand Up @@ -277,13 +290,18 @@ mod tests {
v1alpha1::{self},
},
framework::{
ClusterName, ConfigMapName, ControllerName, ListenerClassName, NamespaceName,
OperatorName, ProductName, ProductVersion, RoleGroupName,
builder::pod::container::{EnvVarName, EnvVarSet},
product_logging::framework::{
ValidatedContainerLogConfigChoice, VectorContainerLogConfig,
},
role_utils::{GenericProductSpecificCommonConfig, RoleGroupConfig},
types::{
kubernetes::{ConfigMapName, ListenerClassName, NamespaceName},
operator::{
ClusterName, ControllerName, OperatorName, ProductName, ProductVersion,
RoleGroupName,
},
},
},
};

Expand Down
8 changes: 6 additions & 2 deletions rust/operator-binary/src/crd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,12 @@ use strum::{Display, EnumIter};
use crate::{
constant,
framework::{
ClusterName, ConfigMapName, ContainerName, ListenerClassName, NameIsValidLabelValue,
ProductName, RoleName, role_utils::GenericProductSpecificCommonConfig,
NameIsValidLabelValue,
role_utils::GenericProductSpecificCommonConfig,
types::{
kubernetes::{ConfigMapName, ContainerName, ListenerClassName},
operator::{ClusterName, ProductName, RoleName},
},
},
};

Expand Down
Loading