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/bump-operator-rs-0.67-and-deps #495

Merged
merged 6 commits into from
May 10, 2024
Merged
Show file tree
Hide file tree
Changes from 5 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
950 changes: 491 additions & 459 deletions Cargo.lock

Large diffs are not rendered by default.

1,953 changes: 1,090 additions & 863 deletions Cargo.nix

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ repository = "https://github.com/stackabletech/superset-operator"

[workspace.dependencies]
anyhow = "1.0"
built = { version = "0.6", features = ["chrono", "git2"] }
clap = "4.3"
built = { version = "0.7", features = ["chrono", "git2"] }
clap = "4.5"
fnv = "1.0"
futures = { version = "0.3", features = ["compat"] }
indoc = "2.0"
product-config = { git = "https://github.com/stackabletech/product-config.git", tag = "0.6.0" }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
serde_yaml = "0.9"
snafu = "0.7"
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "0.64.0" }
strum = { version = "0.25", features = ["derive"] }
tokio = { version = "1.29", features = ["full"] }
snafu = "0.8"
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "stackable-operator-0.67.1" }
strum = { version = "0.26", features = ["derive"] }
tokio = { version = "1.37", features = ["full"] }
tracing = "0.1"

# [patch."https://github.com/stackabletech/operator-rs.git"]
Expand Down
6 changes: 3 additions & 3 deletions crate-hashes.json

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

564 changes: 422 additions & 142 deletions deploy/helm/superset-operator/crds/crds.yaml

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions rust/crd/src/affinity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ mod tests {
)
]))
}),
match_label_keys: None,
Techassi marked this conversation as resolved.
Show resolved Hide resolved
mismatch_label_keys: None,
namespace_selector: None,
namespaces: None,
topology_key: "kubernetes.io/hostname".to_string(),
Expand Down
25 changes: 12 additions & 13 deletions rust/crd/src/authentication.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ use stackable_operator::{
oidc::{self, IdentityProviderHint},
AuthenticationClass, AuthenticationClassProvider, ClientAuthenticationDetails,
},
error::OperatorResult,
schemars::{self, JsonSchema},
};
use tracing::info;
Expand All @@ -29,7 +28,7 @@ pub enum Error {

#[snafu(display("failed to retrieve AuthenticationClass"))]
AuthenticationClassRetrievalFailed {
source: stackable_operator::error::Error,
source: stackable_operator::client::Error,
},

#[snafu(display("only one authentication type at a time is supported by Superset, see https://github.com/dpgaspar/Flask-AppBuilder/issues/1924"))]
Expand Down Expand Up @@ -63,7 +62,7 @@ pub enum Error {

#[snafu(display("invalid OIDC configuration"))]
OidcConfigurationInvalid {
source: stackable_operator::error::Error,
source: stackable_operator::commons::authentication::Error,
},

#[snafu(display("the OIDC provider {oidc_provider:?} is not yet supported (AuthenticationClass {auth_class_name:?})"))]
Expand Down Expand Up @@ -162,7 +161,7 @@ impl SupersetClientAuthenticationDetailsResolved {
resolve_auth_class: impl Fn(ClientAuthenticationDetails) -> R,
) -> Result<SupersetClientAuthenticationDetailsResolved>
where
R: Future<Output = OperatorResult<AuthenticationClass>>,
R: Future<Output = Result<AuthenticationClass, stackable_operator::client::Error>>,
{
let mut resolved_auth_classes = Vec::new();
let mut user_registration = None;
Expand Down Expand Up @@ -325,13 +324,11 @@ mod tests {
use std::pin::Pin;

use indoc::indoc;
use stackable_operator::{
commons::authentication::{
oidc,
tls::{CaCert, Tls, TlsClientDetails, TlsServerVerification, TlsVerification},
},
kube,
use stackable_operator::commons::authentication::{
oidc,
tls::{CaCert, Tls, TlsClientDetails, TlsServerVerification, TlsVerification},
};
use stackable_operator::kube;
Techassi marked this conversation as resolved.
Show resolved Hide resolved

use super::*;

Expand Down Expand Up @@ -770,7 +767,7 @@ mod tests {
invalid OIDC configuration

Caused by this error:
1: OIDC authentication details not specified. The AuthenticationClass "oidc" uses an OIDC provider, you need to specify OIDC authentication details (such as client credentials) as well"#
1: authentication details for OIDC were not specified. The AuthenticationClass "oidc" uses an OIDC provider, you need to specify OIDC authentication details (such as client credentials) as well"#
},
error_message
);
Expand Down Expand Up @@ -931,7 +928,9 @@ mod tests {
auth_classes: Vec<AuthenticationClass>,
) -> impl Fn(
ClientAuthenticationDetails,
) -> Pin<Box<dyn Future<Output = OperatorResult<AuthenticationClass>>>> {
) -> Pin<
Box<dyn Future<Output = Result<AuthenticationClass, stackable_operator::client::Error>>>,
> {
move |auth_details: ClientAuthenticationDetails| {
let auth_classes = auth_classes.clone();
Box::pin(async move {
Expand All @@ -942,7 +941,7 @@ mod tests {
== Some(auth_details.authentication_class_name())
})
.cloned()
.ok_or_else(|| stackable_operator::error::Error::KubeError {
.ok_or_else(|| stackable_operator::client::Error::ListResources {
source: kube::Error::Api(kube::error::ErrorResponse {
code: 404,
message: "AuthenticationClass not found".into(),
Expand Down
8 changes: 4 additions & 4 deletions rust/crd/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use stackable_operator::{
k8s_openapi::apimachinery::pkg::api::resource::Quantity,
kube::{runtime::reflector::ObjectRef, CustomResource, ResourceExt},
memory::{BinaryMultiple, MemoryQuantity},
product_config_utils::{ConfigError, Configuration},
product_config_utils::{self, Configuration},
product_logging::{self, spec::Logging},
role_utils::{GenericRoleConfig, Role, RoleGroupRef},
schemars::{self, JsonSchema},
Expand Down Expand Up @@ -381,7 +381,7 @@ impl Configuration for SupersetConfigFragment {
&self,
cluster: &Self::Configurable,
_role_name: &str,
) -> Result<BTreeMap<String, Option<String>>, ConfigError> {
) -> Result<BTreeMap<String, Option<String>>, product_config_utils::Error> {
let mut result = BTreeMap::new();
result.insert(
SupersetConfig::CREDENTIALS_SECRET_PROPERTY.to_string(),
Expand All @@ -401,7 +401,7 @@ impl Configuration for SupersetConfigFragment {
&self,
_cluster: &Self::Configurable,
_role_name: &str,
) -> Result<BTreeMap<String, Option<String>>, ConfigError> {
) -> Result<BTreeMap<String, Option<String>>, product_config_utils::Error> {
Ok(BTreeMap::new())
}

Expand All @@ -410,7 +410,7 @@ impl Configuration for SupersetConfigFragment {
_cluster: &Self::Configurable,
_role_name: &str,
file: &str,
) -> Result<BTreeMap<String, Option<String>>, ConfigError> {
) -> Result<BTreeMap<String, Option<String>>, product_config_utils::Error> {
let mut result = BTreeMap::new();

if file == SUPERSET_CONFIG_FILENAME {
Expand Down
12 changes: 1 addition & 11 deletions rust/operator-binary/build.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
use std::path::PathBuf;

fn main() {
let out_dir = PathBuf::from(std::env::var("OUT_DIR").expect("OUT_DIR is required"));
built::write_built_file_with_opts(
// built's env module depends on a whole bunch of variables that crate2nix doesn't provide
// so we grab the specific env variables that we care about out ourselves instead.
built::Options::default().set_env(false),
"Cargo.toml".as_ref(),
&out_dir.join("built.rs"),
)
.unwrap();
built::write_built_file().unwrap();
}
2 changes: 1 addition & 1 deletion rust/operator-binary/src/controller_commons.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use stackable_operator::{
builder::VolumeBuilder,
builder::pod::volume::VolumeBuilder,
k8s_openapi::api::core::v1::{ConfigMapVolumeSource, EmptyDirVolumeSource, Volume},
product_logging::{
self,
Expand Down
27 changes: 15 additions & 12 deletions rust/operator-binary/src/druid_connection_controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ use crate::util::{get_job_state, JobState};
use crate::{rbac, superset_controller::DOCKER_IMAGE_BASE_NAME, APP_NAME};
use snafu::{OptionExt, ResultExt, Snafu};
use stackable_operator::{
builder::{ContainerBuilder, ObjectMetaBuilder, PodSecurityContextBuilder},
builder::{
meta::ObjectMetaBuilder,
pod::{container::ContainerBuilder, security::PodSecurityContextBuilder},
},
client::Client,
commons::product_image_selection::ResolvedProductImage,
k8s_openapi::api::{
Expand All @@ -29,7 +32,7 @@ use strum::{EnumDiscriminants, IntoStaticStr};
pub const DRUID_CONNECTION_CONTROLLER_NAME: &str = "druid-connection";

pub struct Ctx {
pub client: stackable_operator::client::Client,
pub client: Client,
}

#[derive(Snafu, Debug, EnumDiscriminants)]
Expand All @@ -38,31 +41,31 @@ pub struct Ctx {
pub enum Error {
#[snafu(display("failed to apply Job for Druid Connection"))]
ApplyJob {
source: stackable_operator::error::Error,
source: stackable_operator::client::Error,
},
#[snafu(display("failed to update status"))]
ApplyStatus {
source: stackable_operator::error::Error,
source: stackable_operator::client::Error,
},
#[snafu(display("object is missing metadata to build owner reference"))]
ObjectMissingMetadataForOwnerRef {
source: stackable_operator::error::Error,
source: stackable_operator::builder::meta::Error,
},
#[snafu(display("failed to get Druid connection string from config map {config_map}"))]
GetDruidConnStringConfigMap {
source: stackable_operator::error::Error,
source: stackable_operator::client::Error,
config_map: ObjectRef<ConfigMap>,
},
#[snafu(display("failed to get Druid connection string from config map"))]
MissingDruidConnString,
#[snafu(display("druid connection state is 'importing' but failed to find job {import_job}"))]
GetImportJob {
source: stackable_operator::error::Error,
source: stackable_operator::client::Error,
import_job: ObjectRef<Job>,
},
#[snafu(display("failed to check if druid discovery map exists"))]
DruidDiscoveryCheck {
source: stackable_operator::error::Error,
source: stackable_operator::client::Error,
},
#[snafu(display("namespace missing on DruidConnection {druid_connection}"))]
DruidConnectionNoNamespace {
Expand All @@ -71,15 +74,15 @@ pub enum Error {
},
#[snafu(display("failed to patch service account"))]
ApplyServiceAccount {
source: stackable_operator::error::Error,
source: stackable_operator::client::Error,
},
#[snafu(display("failed to patch role binding"))]
ApplyRoleBinding {
source: stackable_operator::error::Error,
source: stackable_operator::client::Error,
},
#[snafu(display("failed to retrieve superset cluster"))]
SupersetClusterRetrieval {
source: stackable_operator::error::Error,
source: stackable_operator::client::Error,
},
}

Expand Down Expand Up @@ -189,7 +192,7 @@ pub async fn reconcile_druid_connection(
let resolved_product_image: ResolvedProductImage = superset_cluster
.spec
.image
.resolve(DOCKER_IMAGE_BASE_NAME, crate::built_info::CARGO_PKG_VERSION);
.resolve(DOCKER_IMAGE_BASE_NAME, crate::built_info::PKG_VERSION);
let job = build_import_job(
&superset_cluster,
&druid_connection,
Expand Down
8 changes: 3 additions & 5 deletions rust/operator-binary/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ mod util;

mod built_info {
include!(concat!(env!("OUT_DIR"), "/built.rs"));
pub const TARGET_PLATFORM: Option<&str> = option_env!("TARGET");
pub const CARGO_PKG_VERSION: &str = env!("CARGO_PKG_VERSION");
}

pub const APP_PORT: u16 = 8088;
Expand All @@ -53,8 +51,8 @@ async fn main() -> anyhow::Result<()> {
let opts = Opts::parse();
match opts.cmd {
Command::Crd => {
SupersetCluster::print_yaml_schema(built_info::CARGO_PKG_VERSION)?;
DruidConnection::print_yaml_schema(built_info::CARGO_PKG_VERSION)?;
SupersetCluster::print_yaml_schema(built_info::PKG_VERSION)?;
DruidConnection::print_yaml_schema(built_info::PKG_VERSION)?;
}
Command::Run(ProductOperatorRun {
product_config,
Expand All @@ -70,7 +68,7 @@ async fn main() -> anyhow::Result<()> {
crate_description!(),
crate_version!(),
built_info::GIT_VERSION,
built_info::TARGET_PLATFORM.unwrap_or("unknown target"),
built_info::TARGET,
built_info::BUILT_TIME_UTC,
built_info::RUSTC_VERSION,
);
Expand Down
2 changes: 1 addition & 1 deletion rust/operator-binary/src/operations/graceful_shutdown.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use snafu::{ResultExt, Snafu};
use stackable_operator::builder::PodBuilder;
use stackable_operator::builder::pod::PodBuilder;
use stackable_superset_crd::SupersetConfig;

#[derive(Debug, Snafu)]
Expand Down
4 changes: 2 additions & 2 deletions rust/operator-binary/src/operations/pdb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ use crate::{superset_controller::SUPERSET_CONTROLLER_NAME, OPERATOR_NAME};
pub enum Error {
#[snafu(display("Cannot create PodDisruptionBudget for role [{role}]"))]
CreatePdb {
source: stackable_operator::error::Error,
source: stackable_operator::builder::pdb::Error,
role: String,
},
#[snafu(display("Cannot apply PodDisruptionBudget [{name}]"))]
ApplyPdb {
source: stackable_operator::error::Error,
source: stackable_operator::cluster_resources::Error,
name: String,
},
}
Expand Down
4 changes: 2 additions & 2 deletions rust/operator-binary/src/product_logging.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::fmt::{Display, Write};

use snafu::{OptionExt, ResultExt, Snafu};
use stackable_operator::{
builder::ConfigMapBuilder,
builder::configmap::ConfigMapBuilder,
client::Client,
k8s_openapi::api::core::v1::ConfigMap,
kube::Resource,
Expand All @@ -22,7 +22,7 @@ pub enum Error {
ObjectHasNoNamespace,
#[snafu(display("failed to retrieve the ConfigMap [{cm_name}]"))]
ConfigMapNotFound {
source: stackable_operator::error::Error,
source: stackable_operator::client::Error,
cm_name: String,
},
#[snafu(display("failed to retrieve the entry [{entry}] for ConfigMap [{cm_name}]"))]
Expand Down
2 changes: 1 addition & 1 deletion rust/operator-binary/src/rbac.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use stackable_operator::builder::ObjectMetaBuilder;
use stackable_operator::builder::meta::ObjectMetaBuilder;
use stackable_operator::k8s_openapi::api::core::v1::ServiceAccount;
Techassi marked this conversation as resolved.
Show resolved Hide resolved
use stackable_operator::k8s_openapi::api::rbac::v1::{RoleBinding, RoleRef, Subject};
use stackable_operator::kube::{Resource, ResourceExt};
Expand Down
Loading
Loading