Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Version CRD #597

Merged
merged 18 commits into from
Mar 19, 2025
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
376 changes: 223 additions & 153 deletions Cargo.lock

Large diffs are not rendered by default.

846 changes: 556 additions & 290 deletions Cargo.nix

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[workspace]
members = ["rust/crd", "rust/operator-binary"]
members = ["rust/operator-binary"]
resolver = "2"

[workspace.package]
Expand All @@ -23,11 +23,12 @@ serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
serde_yaml = "0.9"
snafu = "0.8"
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "stackable-operator-0.87.0" }
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "stackable-operator-0.87.4" }
stackable-versioned = { git = "https://github.com/stackabletech/operator-rs.git", features = ["k8s"], tag = "stackable-versioned-0.7.0" }
strum = { version = "0.27", features = ["derive"] }
tokio = { version = "1.40", features = ["full"] }
tracing = "0.1"

# [patch."https://github.com/stackabletech/operator-rs.git"]
# [patch."https://github.com/stackabletech/operator-rs"]
# stackable-operator = { git = "https://github.com/stackabletech//operator-rs.git", branch = "main" }
# stackable-operator = { path = "../operator-rs/crates/stackable-operator" }
9 changes: 6 additions & 3 deletions crate-hashes.json

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

23 changes: 0 additions & 23 deletions rust/crd/Cargo.toml

This file was deleted.

137 changes: 0 additions & 137 deletions rust/crd/src/druidconnection.rs

This file was deleted.

7 changes: 5 additions & 2 deletions rust/operator-binary/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,27 @@ repository.workspace = true
publish = false

[dependencies]
stackable-superset-crd = { path = "../crd" }

anyhow.workspace = true
clap.workspace = true
const_format.workspace = true
fnv.workspace = true
futures.workspace = true
indoc.workspace = true
serde.workspace = true
serde_json.workspace = true
snafu.workspace = true
stackable-operator.workspace = true
stackable-versioned.workspace = true
product-config.workspace = true
strum.workspace = true
tokio.workspace = true
tracing.workspace = true

[dev-dependencies]
indoc.workspace = true
rstest.workspace = true
serde_yaml.workspace = true
tokio.workspace = true

[build-dependencies]
built.workspace = true
7 changes: 4 additions & 3 deletions rust/operator-binary/src/authorization/opa.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
use std::collections::BTreeMap;

use stackable_operator::{client::Client, commons::opa::OpaApiVersion, time::Duration};
use stackable_superset_crd::{SupersetCluster, SupersetOpaRoleMappingConfig};

use crate::crd::v1alpha1;

pub const OPA_IMPORTS: &[&str] =
&["from opa_authorizer.opa_manager import OpaSupersetSecurityManager"];
Expand All @@ -15,8 +16,8 @@ pub struct SupersetOpaConfigResolved {
impl SupersetOpaConfigResolved {
pub async fn from_opa_config(
client: &Client,
superset: &SupersetCluster,
opa_config: &SupersetOpaRoleMappingConfig,
superset: &v1alpha1::SupersetCluster,
opa_config: &v1alpha1::SupersetOpaRoleMappingConfig,
) -> Result<Self, stackable_operator::commons::opa::Error> {
let opa_endpoint = opa_config
.opa
Expand Down
10 changes: 6 additions & 4 deletions rust/operator-binary/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ use std::collections::BTreeMap;
use indoc::formatdoc;
use snafu::{ResultExt, Snafu};
use stackable_operator::commons::authentication::{ldap, oidc};
use stackable_superset_crd::{

use crate::crd::{
authentication::{
FlaskRolesSyncMoment, SupersetAuthenticationClassResolved,
SupersetClientAuthenticationDetailsResolved, DEFAULT_OIDC_PROVIDER,
self, SupersetAuthenticationClassResolved, SupersetClientAuthenticationDetailsResolved,
DEFAULT_OIDC_PROVIDER,
},
SupersetConfigOptions,
};
Expand Down Expand Up @@ -120,7 +121,8 @@ fn append_authentication_config(
);
config.insert(
SupersetConfigOptions::AuthRolesSyncAtLogin.to_string(),
(auth_config.sync_roles_at == FlaskRolesSyncMoment::Login).to_string(),
(auth_config.sync_roles_at == authentication::v1alpha1::FlaskRolesSyncMoment::Login)
.to_string(),
);

Ok(())
Expand Down
3 changes: 2 additions & 1 deletion rust/operator-binary/src/controller_commons.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ use stackable_operator::{
},
},
};
use stackable_superset_crd::MAX_LOG_FILES_SIZE;

use crate::crd::MAX_LOG_FILES_SIZE;

pub const CONFIG_VOLUME_NAME: &str = "config";
pub const LOG_CONFIG_VOLUME_NAME: &str = "log-config";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use stackable_operator::{
k8s_openapi::api::core::v1::PodAntiAffinity,
};

use crate::{SupersetRole, APP_NAME};
use crate::crd::{SupersetRole, APP_NAME};

pub fn get_affinity(cluster_name: &str, role: &SupersetRole) -> StackableAffinityFragment {
StackableAffinityFragment {
Expand Down Expand Up @@ -32,7 +32,7 @@ mod tests {
};

use super::*;
use crate::SupersetCluster;
use crate::crd::v1alpha1;

#[test]
fn test_affinity_defaults() {
Expand All @@ -51,7 +51,8 @@ mod tests {
default:
replicas: 1
"#;
let superset: SupersetCluster = serde_yaml::from_str(input).expect("illegal test input");
let superset: v1alpha1::SupersetCluster =
serde_yaml::from_str(input).expect("illegal test input");
let merged_config = superset
.merged_config(&SupersetRole::Node, &superset.node_rolegroup_ref("default"))
.unwrap();
Expand Down
Loading