Skip to content
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
501 changes: 307 additions & 194 deletions Cargo.lock

Large diffs are not rendered by default.

1,186 changes: 858 additions & 328 deletions Cargo.nix

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repository = "https://github.com/stackabletech/druid-operator"

[workspace.dependencies]
product-config = { git = "https://github.com/stackabletech/product-config.git", tag = "0.7.0" }
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", features = ["telemetry", "versioned"], tag = "stackable-operator-0.94.0" }
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", features = ["telemetry", "versioned"], tag = "stackable-operator-0.95.0" }

anyhow = "1.0"
built = { version = "0.8", features = ["chrono", "git2"] }
Expand All @@ -22,7 +22,7 @@ futures = { version = "0.3", features = ["compat"] }
indoc = "2.0"
openssl = "0.10"
pin-project = "1.1"
rstest = "0.25"
rstest = "0.26"
semver = "1.0"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
Expand Down
14 changes: 7 additions & 7 deletions crate-hashes.json

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

2 changes: 1 addition & 1 deletion rust/operator-binary/src/crd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ use stackable_operator::{
},
role_utils::{CommonConfiguration, GenericRoleConfig, JavaCommonConfig, Role, RoleGroup},
schemars::{self, JsonSchema},
shared::time::Duration,
status::condition::{ClusterCondition, HasStatusCondition},
time::Duration,
utils::{COMMON_BASH_TRAP_FUNCTIONS, crds::raw_object_list_schema},
versioned::versioned,
};
Expand Down
2 changes: 1 addition & 1 deletion rust/operator-binary/src/crd/security.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use stackable_operator::{
api::core::v1::{ContainerPort, Probe, ServicePort, TCPSocketAction},
apimachinery::pkg::util::intstr::IntOrString,
},
time::Duration,
shared::time::Duration,
};

use crate::crd::{
Expand Down
2 changes: 1 addition & 1 deletion rust/operator-binary/src/discovery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ fn build_discovery_configmap(
.with_recommended_labels(build_recommended_labels(
druid,
DRUID_CONTROLLER_NAME,
&resolved_product_image.app_version_label,
&resolved_product_image.app_version_label_value,
&DruidRole::Router.to_string(),
"discovery",
))
Expand Down
31 changes: 20 additions & 11 deletions rust/operator-binary/src/druid_controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@ use stackable_operator::{
},
cluster_resources::{ClusterResourceApplyStrategy, ClusterResources},
commons::{
opa::OpaApiVersion, product_image_selection::ResolvedProductImage,
rbac::build_rbac_resources, tls_verification::TlsClientDetailsError,
opa::OpaApiVersion,
product_image_selection::{self, ResolvedProductImage},
rbac::build_rbac_resources,
tls_verification::TlsClientDetailsError,
},
crd::s3,
k8s_openapi::{
Expand Down Expand Up @@ -55,11 +57,11 @@ use stackable_operator::{
},
},
role_utils::RoleGroupRef,
shared::time::Duration,
status::condition::{
compute_conditions, operations::ClusterOperationsConditionBuilder,
statefulset::StatefulSetConditionBuilder,
},
time::Duration,
};
use strum::{EnumDiscriminants, IntoStaticStr};

Expand Down Expand Up @@ -378,6 +380,11 @@ pub enum Error {

#[snafu(display("failed to configure service"))]
ServiceConfiguration { source: crate::service::Error },

#[snafu(display("failed to resolve product image"))]
ResolveProductImage {
source: product_image_selection::Error,
},
}

type Result<T, E = Error> = std::result::Result<T, E>;
Expand Down Expand Up @@ -405,10 +412,11 @@ pub async fn reconcile_druid(
.namespace
.clone()
.with_context(|| ObjectHasNoNamespaceSnafu {})?;
let resolved_product_image: ResolvedProductImage = druid
let resolved_product_image = druid
.spec
.image
.resolve(DOCKER_IMAGE_BASE_NAME, crate::built_info::PKG_VERSION);
.resolve(DOCKER_IMAGE_BASE_NAME, crate::built_info::PKG_VERSION)
.context(ResolveProductImageSnafu)?;

let zk_confmap = druid.spec.cluster_config.zookeeper_config_map_name.clone();
let zk_connstr = client
Expand Down Expand Up @@ -533,7 +541,7 @@ pub async fn reconcile_druid(
let role_group_service_recommended_labels = build_recommended_labels(
druid,
DRUID_CONTROLLER_NAME,
&resolved_product_image.app_version_label,
&resolved_product_image.app_version_label_value,
&rolegroup.role,
&rolegroup.role_group,
);
Expand Down Expand Up @@ -624,7 +632,7 @@ pub async fn reconcile_druid(
build_recommended_labels(
druid,
DRUID_CONTROLLER_NAME,
&resolved_product_image.app_version_label,
&resolved_product_image.app_version_label_value,
role_name,
"none",
),
Expand Down Expand Up @@ -857,7 +865,7 @@ fn build_rolegroup_config_map(
.with_recommended_labels(build_recommended_labels(
druid,
DRUID_CONTROLLER_NAME,
&resolved_product_image.app_version_label,
&resolved_product_image.app_version_label_value,
&rolegroup.role,
&rolegroup.role_group,
))
Expand Down Expand Up @@ -1131,7 +1139,7 @@ fn build_rolegroup_statefulset(
.with_recommended_labels(build_recommended_labels(
druid,
DRUID_CONTROLLER_NAME,
&resolved_product_image.app_version_label,
&resolved_product_image.app_version_label_value,
&rolegroup_ref.role,
&rolegroup_ref.role_group,
))
Expand Down Expand Up @@ -1190,7 +1198,7 @@ fn build_rolegroup_statefulset(
.with_recommended_labels(build_recommended_labels(
druid,
DRUID_CONTROLLER_NAME,
&resolved_product_image.app_version_label,
&resolved_product_image.app_version_label_value,
&rolegroup_ref.role,
&rolegroup_ref.role_group,
))
Expand Down Expand Up @@ -1401,7 +1409,8 @@ mod test {
let resolved_product_image: ResolvedProductImage = druid
.spec
.image
.resolve(DOCKER_IMAGE_BASE_NAME, crate::built_info::PKG_VERSION);
.resolve(DOCKER_IMAGE_BASE_NAME, crate::built_info::PKG_VERSION)
.expect("test: resolved product image is always valid");
let role_config = transform_all_roles_to_config(&druid, druid.build_role_properties());

let product_config_manager =
Expand Down
10 changes: 5 additions & 5 deletions rust/operator-binary/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ async fn main() -> anyhow::Result<()> {
Command::Run(ProductOperatorRun {
product_config,
watch_namespace,
telemetry_arguments,
cluster_info_opts,
operator_environment: _,
telemetry,
cluster_info,
}) => {
// NOTE (@NickLarsenNZ): Before stackable-telemetry was used:
// - The console log level was set by `DRUID_OPERATOR_LOG`, and is now `CONSOLE_LOG` (when using Tracing::pre_configured).
// - The file log level was set by `DRUID_OPERATOR_LOG`, and is now set via `FILE_LOG` (when using Tracing::pre_configured).
// - The file log directory was set by `DRUID_OPERATOR_LOG_DIRECTORY`, and is now set by `ROLLING_LOGS_DIR` (or via `--rolling-logs <DIRECTORY>`).
let _tracing_guard =
Tracing::pre_configured(built_info::PKG_NAME, telemetry_arguments).init()?;
let _tracing_guard = Tracing::pre_configured(built_info::PKG_NAME, telemetry).init()?;

tracing::info!(
built_info.pkg_version = built_info::PKG_VERSION,
Expand All @@ -89,7 +89,7 @@ async fn main() -> anyhow::Result<()> {
])?;
let client = stackable_operator::client::initialize_operator(
Some(OPERATOR_NAME.to_string()),
&cluster_info_opts,
&cluster_info,
)
.await?;

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
Expand Up @@ -3,7 +3,7 @@ use snafu::{ResultExt, Snafu};
use stackable_operator::{
builder::pod::{PodBuilder, container::ContainerBuilder},
k8s_openapi::api::core::v1::{ExecAction, LifecycleHandler},
time::Duration,
shared::time::Duration,
};

use crate::crd::{DruidRole, security::DruidTlsSecurity};
Expand Down
Loading