Skip to content

Commit d94777e

Browse files
committed
Merge remote-tracking branch 'origin/main' into feat/tls-support
2 parents cfc730a + 3f57fd1 commit d94777e

61 files changed

Lines changed: 2634 additions & 1023 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

deploy/helm/opensearch-operator/crds/crds.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ spec:
5050
- Which ca.crt to use when validating the other server
5151
maxLength: 253
5252
minLength: 1
53+
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
5354
type: string
5455
serverSecretClass:
5556
default: tls
@@ -61,6 +62,7 @@ spec:
6162
maxLength: 253
6263
minLength: 1
6364
nullable: true
65+
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
6466
type: string
6567
type: object
6668
vectorAggregatorConfigMapName:
@@ -72,6 +74,7 @@ spec:
7274
maxLength: 253
7375
minLength: 1
7476
nullable: true
77+
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
7578
type: string
7679
type: object
7780
clusterOperation:
@@ -222,6 +225,7 @@ spec:
222225
maxLength: 253
223226
minLength: 1
224227
nullable: true
228+
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
225229
type: string
226230
logging:
227231
default:
@@ -578,6 +582,7 @@ spec:
578582
maxLength: 253
579583
minLength: 1
580584
nullable: true
585+
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
581586
type: string
582587
logging:
583588
default:

rust/operator-binary/src/controller.rs

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,16 @@ use validate::validate;
3030
use crate::{
3131
crd::{NodeRoles, v1alpha1},
3232
framework::{
33-
ClusterName, ControllerName, HasName, HasUid, ListenerClassName, NameIsValidLabelValue,
34-
NamespaceName, OperatorName, ProductName, ProductVersion, RoleGroupName, RoleName, Uid,
33+
HasName, HasUid, NameIsValidLabelValue,
3534
product_logging::framework::{ValidatedContainerLogConfigChoice, VectorContainerLogConfig},
3635
role_utils::{GenericProductSpecificCommonConfig, RoleGroupConfig},
36+
types::{
37+
kubernetes::{ListenerClassName, NamespaceName, Uid},
38+
operator::{
39+
ClusterName, ControllerName, OperatorName, ProductName, ProductVersion,
40+
RoleGroupName, RoleName,
41+
},
42+
},
3743
},
3844
};
3945

@@ -383,10 +389,13 @@ mod tests {
383389
controller::{OpenSearchNodeResources, ValidatedOpenSearchConfig},
384390
crd::{NodeRoles, v1alpha1},
385391
framework::{
386-
ClusterName, ListenerClassName, NamespaceName, OperatorName, ProductVersion,
387-
RoleGroupName, builder::pod::container::EnvVarSet,
392+
builder::pod::container::EnvVarSet,
388393
product_logging::framework::ValidatedContainerLogConfigChoice,
389394
role_utils::GenericProductSpecificCommonConfig,
395+
types::{
396+
kubernetes::{ListenerClassName, NamespaceName},
397+
operator::{ClusterName, OperatorName, ProductVersion, RoleGroupName},
398+
},
390399
},
391400
};
392401

rust/operator-binary/src/controller/apply.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,13 @@ use stackable_operator::{
1010
use strum::{EnumDiscriminants, IntoStaticStr};
1111

1212
use super::{Applied, ContextNames, KubernetesResources, Prepared};
13-
use crate::framework::{ClusterName, NamespaceName, Uid, cluster_resources::cluster_resources_new};
13+
use crate::framework::{
14+
cluster_resources::cluster_resources_new,
15+
types::{
16+
kubernetes::{NamespaceName, Uid},
17+
operator::ClusterName,
18+
},
19+
};
1420

1521
#[derive(Snafu, Debug, EnumDiscriminants)]
1622
#[strum_discriminants(derive(IntoStaticStr))]

rust/operator-binary/src/controller/build.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,15 @@ mod tests {
8383
v1alpha1::{self, OpenSearchTls},
8484
},
8585
framework::{
86-
ClusterName, ControllerName, ListenerClassName, NamespaceName, OperatorName,
87-
ProductName, ProductVersion, RoleGroupName, builder::pod::container::EnvVarSet,
86+
builder::pod::container::EnvVarSet,
8887
role_utils::GenericProductSpecificCommonConfig,
88+
types::{
89+
kubernetes::{ListenerClassName, NamespaceName},
90+
operator::{
91+
ClusterName, ControllerName, OperatorName, ProductName, ProductVersion,
92+
RoleGroupName,
93+
},
94+
},
8995
},
9096
};
9197

rust/operator-binary/src/controller/build/node_config.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ use crate::{
1010
controller::OpenSearchRoleGroupConfig,
1111
crd::v1alpha1,
1212
framework::{
13-
RoleGroupName, ServiceName,
1413
builder::pod::container::{EnvVarName, EnvVarSet},
1514
role_group_utils,
15+
types::{kubernetes::ServiceName, operator::RoleGroupName},
1616
},
1717
};
1818

@@ -409,9 +409,12 @@ mod tests {
409409
controller::{ValidatedLogging, ValidatedOpenSearchConfig},
410410
crd::{NodeRoles, v1alpha1},
411411
framework::{
412-
ClusterName, ListenerClassName, NamespaceName, ProductVersion, RoleGroupName,
413412
product_logging::framework::ValidatedContainerLogConfigChoice,
414413
role_utils::GenericProductSpecificCommonConfig,
414+
types::{
415+
kubernetes::{ListenerClassName, NamespaceName},
416+
operator::{ClusterName, ProductVersion, RoleGroupName},
417+
},
415418
},
416419
};
417420

rust/operator-binary/src/controller/build/role_builder.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,9 +242,15 @@ mod tests {
242242
},
243243
crd::{NodeRoles, v1alpha1},
244244
framework::{
245-
ClusterName, ControllerName, ListenerClassName, NamespaceName, OperatorName,
246-
ProductName, ProductVersion, RoleGroupName, builder::pod::container::EnvVarSet,
245+
builder::pod::container::EnvVarSet,
247246
role_utils::GenericProductSpecificCommonConfig,
247+
types::{
248+
kubernetes::{ListenerClassName, NamespaceName},
249+
operator::{
250+
ClusterName, ControllerName, OperatorName, ProductName, ProductVersion,
251+
RoleGroupName,
252+
},
253+
},
248254
},
249255
};
250256

rust/operator-binary/src/controller/build/role_group_builder.rs

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@ use crate::{
4646
},
4747
crd::v1alpha1,
4848
framework::{
49-
PersistentVolumeClaimName, RoleGroupName, SecretClassName, ServiceAccountName, ServiceName,
50-
VolumeName,
5149
builder::{
5250
meta::ownerreference_from_resource,
5351
pod::{
@@ -60,6 +58,13 @@ use crate::{
6058
STACKABLE_LOG_DIR, ValidatedContainerLogConfigChoice, vector_container,
6159
},
6260
role_group_utils::ResourceNames,
61+
types::{
62+
kubernetes::{
63+
PersistentVolumeClaimName, SecretClassName, ServiceAccountName, ServiceName,
64+
VolumeName,
65+
},
66+
operator::RoleGroupName,
67+
},
6368
},
6469
};
6570

@@ -725,11 +730,19 @@ mod tests {
725730
v1alpha1::{self, OpenSearchTls},
726731
},
727732
framework::{
728-
ClusterName, ConfigMapName, ControllerName, ListenerClassName, NamespaceName,
729-
OperatorName, ProductName, ProductVersion, RoleGroupName, ServiceAccountName,
730-
ServiceName, builder::pod::container::EnvVarSet,
733+
builder::pod::container::EnvVarSet,
731734
product_logging::framework::VectorContainerLogConfig,
732735
role_utils::GenericProductSpecificCommonConfig,
736+
types::{
737+
kubernetes::{
738+
ConfigMapName, ListenerClassName, NamespaceName, ServiceAccountName,
739+
ServiceName,
740+
},
741+
operator::{
742+
ClusterName, ControllerName, OperatorName, ProductName, ProductVersion,
743+
RoleGroupName,
744+
},
745+
},
733746
},
734747
};
735748

rust/operator-binary/src/controller/validate.rs

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,15 @@ use super::{
1818
use crate::{
1919
crd::v1alpha1::{self},
2020
framework::{
21-
ClusterName, ConfigMapName, NamespaceName, Uid,
2221
builder::pod::container::{EnvVarName, EnvVarSet},
2322
product_logging::framework::{
2423
VectorContainerLogConfig, validate_logging_configuration_for_container,
2524
},
2625
role_utils::{GenericProductSpecificCommonConfig, RoleGroupConfig, with_validated_config},
26+
types::{
27+
kubernetes::{ConfigMapName, NamespaceName, Uid},
28+
operator::ClusterName,
29+
},
2730
},
2831
};
2932

@@ -45,24 +48,34 @@ pub enum Error {
4548
GetVectorAggregatorConfigMapName {},
4649

4750
#[snafu(display("failed to set cluster name"))]
48-
ParseClusterName { source: crate::framework::Error },
51+
ParseClusterName {
52+
source: crate::framework::macros::attributed_string_type::Error,
53+
},
4954

5055
#[snafu(display("failed to set cluster namespace"))]
51-
ParseClusterNamespace { source: crate::framework::Error },
56+
ParseClusterNamespace {
57+
source: crate::framework::macros::attributed_string_type::Error,
58+
},
5259

5360
#[snafu(display("failed to set UID"))]
54-
ParseClusterUid { source: crate::framework::Error },
61+
ParseClusterUid {
62+
source: crate::framework::macros::attributed_string_type::Error,
63+
},
5564

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

6170
#[snafu(display("failed to set product version"))]
62-
ParseProductVersion { source: crate::framework::Error },
71+
ParseProductVersion {
72+
source: crate::framework::macros::attributed_string_type::Error,
73+
},
6374

6475
#[snafu(display("failed to set role-group name"))]
65-
ParseRoleGroupName { source: crate::framework::Error },
76+
ParseRoleGroupName {
77+
source: crate::framework::macros::attributed_string_type::Error,
78+
},
6679

6780
#[snafu(display("failed to resolve product image"))]
6881
ResolveProductImage {
@@ -279,13 +292,18 @@ mod tests {
279292
v1alpha1::{self, OpenSearchTls},
280293
},
281294
framework::{
282-
ClusterName, ConfigMapName, ControllerName, ListenerClassName, NamespaceName,
283-
OperatorName, ProductName, ProductVersion, RoleGroupName, SecretClassName,
284295
builder::pod::container::{EnvVarName, EnvVarSet},
285296
product_logging::framework::{
286297
ValidatedContainerLogConfigChoice, VectorContainerLogConfig,
287298
},
288299
role_utils::{GenericProductSpecificCommonConfig, RoleGroupConfig},
300+
types::{
301+
kubernetes::{ConfigMapName, ListenerClassName, NamespaceName, SecretClassName},
302+
operator::{
303+
ClusterName, ControllerName, OperatorName, ProductName, ProductVersion,
304+
RoleGroupName,
305+
},
306+
},
289307
},
290308
};
291309

rust/operator-binary/src/crd/mod.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,12 @@ use strum::{Display, EnumIter};
2929
use crate::{
3030
constant,
3131
framework::{
32-
ClusterName, ConfigMapName, ContainerName, ListenerClassName, NameIsValidLabelValue,
33-
ProductName, RoleName, SecretClassName, role_utils::GenericProductSpecificCommonConfig,
32+
NameIsValidLabelValue,
33+
role_utils::GenericProductSpecificCommonConfig,
34+
types::{
35+
kubernetes::{ConfigMapName, ContainerName, ListenerClassName, SecretClassName},
36+
operator::{ClusterName, ProductName, RoleName},
37+
},
3438
},
3539
};
3640

0 commit comments

Comments
 (0)