Skip to content

Commit b3b5ec1

Browse files
committed
bump stackable-versioned, refactor version imports and references
1 parent 6e604b5 commit b3b5ec1

File tree

9 files changed

+158
-1141
lines changed

9 files changed

+158
-1141
lines changed

Cargo.lock

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

Cargo.nix

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

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ serde_json = "1.0"
2424
serde_yaml = "0.9"
2525
snafu = "0.8"
2626
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "stackable-operator-0.85.0" }
27-
stackable-versioned = { git = "https://github.com/stackabletech/operator-rs.git", features = ["k8s"], tag = "stackable-versioned-0.5.0" }
27+
stackable-versioned = { git = "https://github.com/stackabletech/operator-rs.git", features = ["k8s"], tag = "stackable-versioned-0.5.1" }
2828
strum = { version = "0.26", features = ["derive"] }
2929
tokio = { version = "1.40", features = ["full"] }
3030
tracing = "0.1"

crate-hashes.json

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

rust/operator-binary/src/config.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ use stackable_operator::commons::authentication::{ldap, oidc};
66

77
use crate::crd::{
88
authentication::{
9-
v1alpha1::FlaskRolesSyncMoment, SupersetAuthenticationClassResolved,
10-
SupersetClientAuthenticationDetailsResolved, DEFAULT_OIDC_PROVIDER,
9+
self, SupersetAuthenticationClassResolved, SupersetClientAuthenticationDetailsResolved,
10+
DEFAULT_OIDC_PROVIDER,
1111
},
1212
SupersetConfigOptions,
1313
};
@@ -121,7 +121,8 @@ fn append_authentication_config(
121121
);
122122
config.insert(
123123
SupersetConfigOptions::AuthRolesSyncAtLogin.to_string(),
124-
(auth_config.sync_roles_at == FlaskRolesSyncMoment::Login).to_string(),
124+
(auth_config.sync_roles_at == authentication::v1alpha1::FlaskRolesSyncMoment::Login)
125+
.to_string(),
125126
);
126127

127128
Ok(())

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

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use std::collections::BTreeMap;
22

3-
use authentication::v1alpha1::SupersetClientAuthenticationDetails;
43
use product_config::flask_app_config_writer::{FlaskAppConfigOptions, PythonType};
54
use serde::{Deserialize, Serialize};
65
use snafu::{OptionExt, ResultExt, Snafu};
@@ -32,8 +31,6 @@ use stackable_operator::{
3231
use stackable_versioned::versioned;
3332
use strum::{Display, EnumIter, EnumString, IntoEnumIterator};
3433

35-
use crate::crd::affinity::get_affinity;
36-
3734
pub mod affinity;
3835
pub mod authentication;
3936
pub mod druidconnection;
@@ -130,7 +127,7 @@ pub mod versioned {
130127
pub struct SupersetClusterConfig {
131128
/// List of AuthenticationClasses used to authenticate users.
132129
#[serde(default)]
133-
pub authentication: Vec<SupersetClientAuthenticationDetails>,
130+
pub authentication: Vec<authentication::v1alpha1::SupersetClientAuthenticationDetails>,
134131

135132
/// The name of the Secret object containing the admin user credentials and database connection details.
136133
/// Read the
@@ -304,7 +301,7 @@ pub enum SupersetRole {
304301
Node,
305302
}
306303

307-
/// A reference to a [`SupersetCluster`]
304+
/// A reference to a [`v1alpha1::SupersetCluster`]
308305
#[derive(Clone, Debug, Default, Deserialize, Eq, JsonSchema, PartialEq, Serialize)]
309306
#[serde(rename_all = "camelCase")]
310307
pub struct SupersetClusterRef {
@@ -396,7 +393,7 @@ impl v1alpha1::SupersetConfig {
396393
storage: v1alpha1::SupersetStorageConfigFragment {},
397394
},
398395
logging: product_logging::spec::default_logging(),
399-
affinity: get_affinity(cluster_name, role),
396+
affinity: affinity::get_affinity(cluster_name, role),
400397
graceful_shutdown_timeout: Some(DEFAULT_NODE_GRACEFUL_SHUTDOWN_TIMEOUT),
401398
row_limit: None,
402399
webserver_timeout: None,

rust/operator-binary/src/main.rs

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use stackable_operator::{
2424
};
2525

2626
use crate::{
27-
crd::{druidconnection::v1alpha1::DruidConnection, v1alpha1::SupersetCluster, APP_NAME},
27+
crd::{druidconnection, v1alpha1, APP_NAME},
2828
druid_connection_controller::DRUID_CONNECTION_FULL_CONTROLLER_NAME,
2929
superset_controller::SUPERSET_FULL_CONTROLLER_NAME,
3030
};
@@ -59,8 +59,8 @@ async fn main() -> anyhow::Result<()> {
5959
let opts = Opts::parse();
6060
match opts.cmd {
6161
Command::Crd => {
62-
SupersetCluster::print_yaml_schema(built_info::PKG_VERSION)?;
63-
DruidConnection::print_yaml_schema(built_info::PKG_VERSION)?;
62+
v1alpha1::SupersetCluster::print_yaml_schema(built_info::PKG_VERSION)?;
63+
druidconnection::v1alpha1::DruidConnection::print_yaml_schema(built_info::PKG_VERSION)?;
6464
}
6565
Command::Run(ProductOperatorRun {
6666
product_config,
@@ -101,7 +101,7 @@ async fn main() -> anyhow::Result<()> {
101101
},
102102
));
103103
let superset_controller = Controller::new(
104-
watch_namespace.get_api::<DeserializeGuard<SupersetCluster>>(&client),
104+
watch_namespace.get_api::<DeserializeGuard<v1alpha1::SupersetCluster>>(&client),
105105
watcher::Config::default(),
106106
);
107107
let superset_store_1 = superset_controller.store();
@@ -162,7 +162,10 @@ async fn main() -> anyhow::Result<()> {
162162
},
163163
));
164164
let druid_connection_controller = Controller::new(
165-
watch_namespace.get_api::<DeserializeGuard<DruidConnection>>(&client),
165+
watch_namespace
166+
.get_api::<DeserializeGuard<druidconnection::v1alpha1::DruidConnection>>(
167+
&client,
168+
),
166169
watcher::Config::default(),
167170
);
168171
let druid_connection_store_1 = druid_connection_controller.store();
@@ -171,7 +174,7 @@ async fn main() -> anyhow::Result<()> {
171174
let druid_connection_controller = druid_connection_controller
172175
.shutdown_on_signal()
173176
.watches(
174-
watch_namespace.get_api::<DeserializeGuard<SupersetCluster>>(&client),
177+
watch_namespace.get_api::<DeserializeGuard<v1alpha1::SupersetCluster>>(&client),
175178
watcher::Config::default(),
176179
move |superset_cluster| {
177180
druid_connection_store_1
@@ -242,7 +245,7 @@ async fn main() -> anyhow::Result<()> {
242245
}
243246

244247
fn references_authentication_class(
245-
superset: &DeserializeGuard<SupersetCluster>,
248+
superset: &DeserializeGuard<v1alpha1::SupersetCluster>,
246249
authentication_class: &DeserializeGuard<AuthenticationClass>,
247250
) -> bool {
248251
let Ok(superset) = &superset.0 else {
@@ -259,8 +262,8 @@ fn references_authentication_class(
259262
}
260263

261264
fn valid_druid_connection(
262-
superset_cluster: &DeserializeGuard<SupersetCluster>,
263-
druid_connection: &DeserializeGuard<DruidConnection>,
265+
superset_cluster: &DeserializeGuard<v1alpha1::SupersetCluster>,
266+
druid_connection: &DeserializeGuard<druidconnection::v1alpha1::DruidConnection>,
264267
) -> bool {
265268
let Ok(druid_connection) = &druid_connection.0 else {
266269
return false;
@@ -270,7 +273,7 @@ fn valid_druid_connection(
270273
}
271274

272275
fn valid_druid_connection_namespace(
273-
druid_connection: &DeserializeGuard<DruidConnection>,
276+
druid_connection: &DeserializeGuard<druidconnection::v1alpha1::DruidConnection>,
274277
config_map: &DeserializeGuard<ConfigMap>,
275278
) -> bool {
276279
let Ok(druid_connection) = &druid_connection.0 else {
@@ -281,7 +284,7 @@ fn valid_druid_connection_namespace(
281284
}
282285

283286
fn valid_druid_job(
284-
druid_connection: &DeserializeGuard<DruidConnection>,
287+
druid_connection: &DeserializeGuard<druidconnection::v1alpha1::DruidConnection>,
285288
job: &DeserializeGuard<Job>,
286289
) -> bool {
287290
let Ok(druid_connection) = &druid_connection.0 else {

rust/operator-binary/src/operations/graceful_shutdown.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use snafu::{ResultExt, Snafu};
22
use stackable_operator::builder::pod::PodBuilder;
33

4-
use crate::crd::v1alpha1::SupersetConfig;
4+
use crate::crd::v1alpha1;
55

66
#[derive(Debug, Snafu)]
77
pub enum Error {
@@ -12,7 +12,7 @@ pub enum Error {
1212
}
1313

1414
pub fn add_graceful_shutdown_config(
15-
merged_config: &SupersetConfig,
15+
merged_config: &v1alpha1::SupersetConfig,
1616
pod_builder: &mut PodBuilder,
1717
) -> Result<(), Error> {
1818
// This must be always set by the merge mechanism, as we provide a default value,

rust/operator-binary/src/operations/pdb.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use stackable_operator::{
55
};
66

77
use crate::{
8-
crd::{v1alpha1::SupersetCluster, SupersetRole, APP_NAME},
8+
crd::{v1alpha1, SupersetRole, APP_NAME},
99
superset_controller::SUPERSET_CONTROLLER_NAME,
1010
OPERATOR_NAME,
1111
};
@@ -26,7 +26,7 @@ pub enum Error {
2626

2727
pub async fn add_pdbs(
2828
pdb: &PdbConfig,
29-
superset: &SupersetCluster,
29+
superset: &v1alpha1::SupersetCluster,
3030
role: &SupersetRole,
3131
client: &Client,
3232
cluster_resources: &mut ClusterResources,

0 commit comments

Comments
 (0)