Skip to content

Commit 541a1f4

Browse files
authored
chore: bump operator rs to 0.67.1 (#462)
* bump dependencies - compiling * fix built info * bump nix deps * bump missing dependencies * bump operator-rs to 0.67.1 * regenerate charts * update nix * use full import name for product config error * clean up imports * default in affinity tests
1 parent b746a22 commit 541a1f4

File tree

15 files changed

+2983
-2793
lines changed

15 files changed

+2983
-2793
lines changed

Cargo.lock

Lines changed: 686 additions & 580 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.nix

Lines changed: 1508 additions & 1983 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,22 @@ repository = "https://github.com/stackabletech/hive-operator"
1111

1212
[workspace.dependencies]
1313
anyhow = "1.0"
14-
built = { version = "0.6", features = ["chrono", "git2"] }
15-
clap = "4.3"
14+
built = { version = "0.7", features = ["chrono", "git2"] }
15+
clap = "4.5"
1616
fnv = "1.0"
1717
futures = { version = "0.3", features = ["compat"] }
1818
indoc = "2.0"
1919
pin-project = "1.1"
20-
rstest = "0.18"
20+
rstest = "0.19"
2121
semver = "1.0"
2222
serde = { version = "1.0", features = ["derive"] }
2323
serde_json = "1.0"
2424
serde_yaml = "0.9"
25-
snafu = "0.7"
26-
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "0.64.0" }
25+
snafu = "0.8"
26+
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "stackable-operator-0.67.1" }
2727
product-config = { git = "https://github.com/stackabletech/product-config.git", tag = "0.6.0" }
28-
strum = { version = "0.25", features = ["derive"] }
29-
tokio = { version = "1.29", features = ["full"] }
28+
strum = { version = "0.26", features = ["derive"] }
29+
tokio = { version = "1.37", features = ["full"] }
3030
tracing = "0.1"
3131

3232
# [patch."https://github.com/stackabletech/operator-rs.git"]

crate-hashes.json

Lines changed: 288 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 437 additions & 157 deletions
Large diffs are not rendered by default.

rust/crd/src/affinity.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ mod tests {
7171
WeightedPodAffinityTerm {
7272
pod_affinity_term: PodAffinityTerm {
7373
label_selector: Some(LabelSelector {
74-
match_expressions: None,
7574
match_labels: Some(BTreeMap::from([
7675
("app.kubernetes.io/name".to_string(), "hive".to_string(),),
7776
(
@@ -82,11 +81,11 @@ mod tests {
8281
"app.kubernetes.io/component".to_string(),
8382
"metastore".to_string(),
8483
)
85-
]))
84+
])),
85+
..LabelSelector::default()
8686
}),
87-
namespace_selector: None,
88-
namespaces: None,
8987
topology_key: "kubernetes.io/hostname".to_string(),
88+
..PodAffinityTerm::default()
9089
},
9190
weight: 70
9291
}

rust/crd/src/lib.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ use indoc::formatdoc;
44
use security::AuthenticationConfig;
55
use serde::{Deserialize, Serialize};
66
use snafu::{OptionExt, ResultExt, Snafu};
7-
use stackable_operator::kube::ResourceExt;
87
use stackable_operator::{
98
commons::{
109
affinity::StackableAffinity,
@@ -18,8 +17,8 @@ use stackable_operator::{
1817
},
1918
config::{fragment, fragment::Fragment, fragment::ValidationError, merge::Merge},
2019
k8s_openapi::apimachinery::pkg::api::resource::Quantity,
21-
kube::{runtime::reflector::ObjectRef, CustomResource},
22-
product_config_utils::{ConfigError, Configuration},
20+
kube::{runtime::reflector::ObjectRef, CustomResource, ResourceExt},
21+
product_config_utils::{self, Configuration},
2322
product_logging::{self, spec::Logging},
2423
role_utils::{GenericRoleConfig, Role, RoleGroup, RoleGroupRef},
2524
schemars::{self, JsonSchema},
@@ -442,7 +441,7 @@ impl Configuration for MetaStoreConfigFragment {
442441
&self,
443442
hive: &Self::Configurable,
444443
_role_name: &str,
445-
) -> Result<BTreeMap<String, Option<String>>, ConfigError> {
444+
) -> Result<BTreeMap<String, Option<String>>, product_config_utils::Error> {
446445
let mut result = BTreeMap::new();
447446

448447
let env = formatdoc! {"
@@ -464,7 +463,7 @@ impl Configuration for MetaStoreConfigFragment {
464463
&self,
465464
hive: &Self::Configurable,
466465
_role_name: &str,
467-
) -> Result<BTreeMap<String, Option<String>>, ConfigError> {
466+
) -> Result<BTreeMap<String, Option<String>>, product_config_utils::Error> {
468467
let mut result = BTreeMap::new();
469468
result.insert(
470469
MetaStoreConfig::DB_TYPE_CLI.to_string(),
@@ -478,7 +477,7 @@ impl Configuration for MetaStoreConfigFragment {
478477
hive: &Self::Configurable,
479478
_role_name: &str,
480479
file: &str,
481-
) -> Result<BTreeMap<String, Option<String>>, ConfigError> {
480+
) -> Result<BTreeMap<String, Option<String>>, product_config_utils::Error> {
482481
let mut result = BTreeMap::new();
483482

484483
match file {

rust/operator-binary/build.rs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,3 @@
1-
use std::path::PathBuf;
2-
31
fn main() {
4-
let out_dir = PathBuf::from(std::env::var("OUT_DIR").expect("OUT_DIR is required"));
5-
built::write_built_file_with_opts(
6-
// built's env module depends on a whole bunch of variables that crate2nix doesn't provide
7-
// so we grab the specific env variables that we care about out ourselves instead.
8-
built::Options::default().set_env(false),
9-
"Cargo.toml".as_ref(),
10-
&out_dir.join("built.rs"),
11-
)
12-
.unwrap();
2+
built::write_built_file().unwrap();
133
}

rust/operator-binary/src/controller.rs

Lines changed: 30 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,15 @@ use stackable_hive_crd::{
2626

2727
use stackable_operator::{
2828
builder::{
29-
resources::ResourceRequirementsBuilder, ConfigMapBuilder, ContainerBuilder,
30-
ObjectMetaBuilder, PodBuilder, PodSecurityContextBuilder,
31-
SecretOperatorVolumeSourceBuilder, VolumeBuilder,
29+
configmap::ConfigMapBuilder,
30+
meta::ObjectMetaBuilder,
31+
pod::{
32+
container::ContainerBuilder,
33+
resources::ResourceRequirementsBuilder,
34+
security::PodSecurityContextBuilder,
35+
volume::{SecretOperatorVolumeSourceBuilder, VolumeBuilder},
36+
PodBuilder,
37+
},
3238
},
3339
cluster_resources::{ClusterResourceApplyStrategy, ClusterResources},
3440
commons::{
@@ -119,59 +125,59 @@ pub enum Error {
119125

120126
#[snafu(display("failed to apply global Service"))]
121127
ApplyRoleService {
122-
source: stackable_operator::error::Error,
128+
source: stackable_operator::cluster_resources::Error,
123129
},
124130

125131
#[snafu(display("failed to apply Service for {rolegroup}"))]
126132
ApplyRoleGroupService {
127-
source: stackable_operator::error::Error,
133+
source: stackable_operator::cluster_resources::Error,
128134
rolegroup: RoleGroupRef<HiveCluster>,
129135
},
130136

131137
#[snafu(display("failed to build ConfigMap for {rolegroup}"))]
132138
BuildRoleGroupConfig {
133-
source: stackable_operator::error::Error,
139+
source: stackable_operator::builder::configmap::Error,
134140
rolegroup: RoleGroupRef<HiveCluster>,
135141
},
136142

137143
#[snafu(display("failed to apply ConfigMap for {rolegroup}"))]
138144
ApplyRoleGroupConfig {
139-
source: stackable_operator::error::Error,
145+
source: stackable_operator::cluster_resources::Error,
140146
rolegroup: RoleGroupRef<HiveCluster>,
141147
},
142148

143149
#[snafu(display("failed to apply StatefulSet for {rolegroup}"))]
144150
ApplyRoleGroupStatefulSet {
145-
source: stackable_operator::error::Error,
151+
source: stackable_operator::cluster_resources::Error,
146152
rolegroup: RoleGroupRef<HiveCluster>,
147153
},
148154

149155
#[snafu(display("failed to generate product config"))]
150156
GenerateProductConfig {
151-
source: stackable_operator::product_config_utils::ConfigError,
157+
source: stackable_operator::product_config_utils::Error,
152158
},
153159

154160
#[snafu(display("invalid product config"))]
155161
InvalidProductConfig {
156-
source: stackable_operator::error::Error,
162+
source: stackable_operator::product_config_utils::Error,
157163
},
158164

159165
#[snafu(display("object is missing metadata to build owner reference"))]
160166
ObjectMissingMetadataForOwnerRef {
161-
source: stackable_operator::error::Error,
167+
source: stackable_operator::builder::meta::Error,
162168
},
163169

164170
#[snafu(display("failed to build discovery ConfigMap"))]
165171
BuildDiscoveryConfig { source: discovery::Error },
166172

167173
#[snafu(display("failed to apply discovery ConfigMap"))]
168174
ApplyDiscoveryConfig {
169-
source: stackable_operator::error::Error,
175+
source: stackable_operator::cluster_resources::Error,
170176
},
171177

172178
#[snafu(display("failed to update status"))]
173179
ApplyStatus {
174-
source: stackable_operator::error::Error,
180+
source: stackable_operator::client::Error,
175181
},
176182

177183
#[snafu(display("failed to parse db type {db_type}"))]
@@ -182,7 +188,7 @@ pub enum Error {
182188

183189
#[snafu(display("failed to resolve S3 connection"))]
184190
ResolveS3Connection {
185-
source: stackable_operator::error::Error,
191+
source: stackable_operator::commons::s3::Error,
186192
},
187193

188194
#[snafu(display(
@@ -198,24 +204,24 @@ pub enum Error {
198204

199205
#[snafu(display("failed to convert java heap config to unit [{unit}]"))]
200206
FailedToConvertJavaHeap {
201-
source: stackable_operator::error::Error,
207+
source: stackable_operator::memory::Error,
202208
unit: String,
203209
},
204210

205211
#[snafu(display("failed to create hive container [{name}]"))]
206212
FailedToCreateHiveContainer {
207-
source: stackable_operator::error::Error,
213+
source: stackable_operator::builder::pod::container::Error,
208214
name: String,
209215
},
210216

211217
#[snafu(display("failed to create cluster resources"))]
212218
CreateClusterResources {
213-
source: stackable_operator::error::Error,
219+
source: stackable_operator::cluster_resources::Error,
214220
},
215221

216222
#[snafu(display("failed to delete orphaned resources"))]
217223
DeleteOrphanedResources {
218-
source: stackable_operator::error::Error,
224+
source: stackable_operator::cluster_resources::Error,
219225
},
220226

221227
#[snafu(display("failed to resolve the Vector aggregator address"))]
@@ -231,17 +237,17 @@ pub enum Error {
231237

232238
#[snafu(display("failed to patch service account"))]
233239
ApplyServiceAccount {
234-
source: stackable_operator::error::Error,
240+
source: stackable_operator::cluster_resources::Error,
235241
},
236242

237243
#[snafu(display("failed to patch role binding"))]
238244
ApplyRoleBinding {
239-
source: stackable_operator::error::Error,
245+
source: stackable_operator::cluster_resources::Error,
240246
},
241247

242248
#[snafu(display("failed to build RBAC resources"))]
243249
BuildRbacResources {
244-
source: stackable_operator::error::Error,
250+
source: stackable_operator::commons::rbac::Error,
245251
},
246252

247253
#[snafu(display("internal operator failure"))]
@@ -268,7 +274,7 @@ pub enum Error {
268274

269275
#[snafu(display("failed to build TLS certificate SecretClass Volume"))]
270276
TlsCertSecretClassVolumeBuild {
271-
source: stackable_operator::builder::SecretOperatorVolumeSourceBuilderError,
277+
source: stackable_operator::builder::pod::volume::SecretOperatorVolumeSourceBuilderError,
272278
},
273279

274280
#[snafu(display("failed to build S3 credentials SecretClass Volume"))]
@@ -283,7 +289,7 @@ pub enum Error {
283289

284290
#[snafu(display("failed to build Metadata"))]
285291
MetadataBuild {
286-
source: stackable_operator::builder::ObjectMetaBuilderError,
292+
source: stackable_operator::builder::meta::Error,
287293
},
288294

289295
#[snafu(display("failed to get required Labels"))]
@@ -318,7 +324,7 @@ pub async fn reconcile_hive(hive: Arc<HiveCluster>, ctx: Arc<Ctx>) -> Result<Act
318324
let resolved_product_image: ResolvedProductImage = hive
319325
.spec
320326
.image
321-
.resolve(DOCKER_IMAGE_BASE_NAME, crate::built_info::CARGO_PKG_VERSION);
327+
.resolve(DOCKER_IMAGE_BASE_NAME, crate::built_info::PKG_VERSION);
322328
let hive_role = HiveRole::MetaStore;
323329

324330
let s3_connection_spec: Option<S3ConnectionSpec> =

rust/operator-binary/src/discovery.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use snafu::{OptionExt, ResultExt, Snafu};
44
use stackable_hive_crd::{HiveCluster, HiveRole, ServiceType, HIVE_PORT, HIVE_PORT_NAME};
55
use stackable_operator::commons::product_image_selection::ResolvedProductImage;
66
use stackable_operator::{
7-
builder::{ConfigMapBuilder, ObjectMetaBuilder},
7+
builder::{configmap::ConfigMapBuilder, meta::ObjectMetaBuilder},
88
k8s_openapi::api::core::v1::ConfigMap,
99
k8s_openapi::api::core::v1::{Endpoints, Service, ServiceSpec},
1010
kube::{runtime::reflector::ObjectRef, Resource},
@@ -20,14 +20,14 @@ pub enum Error {
2020
NoNamespace,
2121
#[snafu(display("object is missing metadata to build owner reference {hive}"))]
2222
ObjectMissingMetadataForOwnerRef {
23-
source: stackable_operator::error::Error,
23+
source: stackable_operator::builder::meta::Error,
2424
hive: ObjectRef<HiveCluster>,
2525
},
2626
#[snafu(display("chroot path {chroot} was relative (must be absolute)"))]
2727
RelativeChroot { chroot: String },
2828
#[snafu(display("could not build discovery config map for {obj_ref}"))]
2929
DiscoveryConfigMap {
30-
source: stackable_operator::error::Error,
30+
source: stackable_operator::builder::configmap::Error,
3131
obj_ref: ObjectRef<HiveCluster>,
3232
},
3333
#[snafu(display("could not find service [{obj_ref}] port [{port_name}]"))]
@@ -42,7 +42,7 @@ pub enum Error {
4242
},
4343
#[snafu(display("could not find Endpoints for {svc}"))]
4444
FindEndpoints {
45-
source: stackable_operator::error::Error,
45+
source: stackable_operator::client::Error,
4646
svc: ObjectRef<Service>,
4747
},
4848
#[snafu(display("nodePort was out of range"))]
@@ -52,7 +52,7 @@ pub enum Error {
5252

5353
#[snafu(display("failed to build Metadata"))]
5454
MetadataBuild {
55-
source: stackable_operator::builder::ObjectMetaBuilderError,
55+
source: stackable_operator::builder::meta::Error,
5656
},
5757
}
5858

0 commit comments

Comments
 (0)