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
499 changes: 306 additions & 193 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/hive-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 @@ -21,7 +21,7 @@ fnv = "1.0"
futures = { version = "0.3", features = ["compat"] }
indoc = "2.0"
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.

21 changes: 14 additions & 7 deletions rust/operator-binary/src/controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ use stackable_operator::{
},
cluster_resources::{ClusterResourceApplyStrategy, ClusterResources},
commons::{
product_image_selection::ResolvedProductImage, rbac::build_rbac_resources,
product_image_selection::{self, ResolvedProductImage},
rbac::build_rbac_resources,
tls_verification::TlsClientDetailsError,
},
crd::{listener::v1alpha1::Listener, s3},
Expand Down Expand Up @@ -71,11 +72,11 @@ use stackable_operator::{
},
},
role_utils::{GenericRoleConfig, RoleGroupRef},
shared::time::Duration,
status::condition::{
compute_conditions, operations::ClusterOperationsConditionBuilder,
statefulset::StatefulSetConditionBuilder,
},
time::Duration,
utils::{COMMON_BASH_TRAP_FUNCTIONS, cluster_info::KubernetesClusterInfo},
};
use strum::EnumDiscriminants;
Expand Down Expand Up @@ -350,8 +351,13 @@ pub enum Error {
source: ListenerOperatorVolumeSourceBuilderError,
},

#[snafu(display("faild to configure service"))]
#[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 All @@ -374,10 +380,11 @@ pub async fn reconcile_hive(
let client = &ctx.client;
let hive_namespace = hive.namespace().context(ObjectHasNoNamespaceSnafu)?;

let resolved_product_image: ResolvedProductImage = hive
let resolved_product_image = hive
.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 role = hive.spec.metastore.as_ref().context(NoMetaStoreRoleSnafu)?;
let hive_role = HiveRole::MetaStore;

Expand Down Expand Up @@ -693,7 +700,7 @@ fn build_metastore_rolegroup_config_map(
.context(ObjectMissingMetadataForOwnerRefSnafu)?
.with_recommended_labels(build_recommended_labels(
hive,
&resolved_product_image.app_version_label,
&resolved_product_image.app_version_label_value,
&rolegroup.role,
&rolegroup.role_group,
))
Expand Down Expand Up @@ -919,7 +926,7 @@ fn build_metastore_rolegroup_statefulset(

let recommended_object_labels = build_recommended_labels(
hive,
&resolved_product_image.app_version_label,
&resolved_product_image.app_version_label_value,
&rolegroup_ref.role,
&rolegroup_ref.role_group,
);
Expand Down
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 @@ -24,8 +24,8 @@ use stackable_operator::{
product_logging::{self, spec::Logging},
role_utils::{GenericRoleConfig, JavaCommonConfig, Role, RoleGroup, RoleGroupRef},
schemars::{self, JsonSchema},
shared::time::Duration,
status::condition::{ClusterCondition, HasStatusCondition},
time::Duration,
utils::cluster_info::KubernetesClusterInfo,
versioned::versioned,
};
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 @@ -91,7 +91,7 @@ fn build_discovery_configmap(
})?
.with_recommended_labels(build_recommended_labels(
hive,
&resolved_product_image.app_version_label,
&resolved_product_image.app_version_label_value,
&hive_role.to_string(),
"discovery",
))
Expand Down
2 changes: 1 addition & 1 deletion rust/operator-binary/src/listener.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ pub fn build_role_listener(
.context(ObjectMissingMetadataForOwnerRefSnafu)?
.with_recommended_labels(build_recommended_labels(
hive,
&resolved_product_image.app_version_label,
&resolved_product_image.app_version_label_value,
&hive_role.to_string(),
"none",
))
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 @@ -66,15 +66,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 `HIVE_OPERATOR_LOG`, and is now `CONSOLE_LOG` (when using Tracing::pre_configured).
// - The file log level was set by `HIVE_OPERATOR_LOG`, and is now set via `FILE_LOG` (when using Tracing::pre_configured).
// - The file log directory was set by `HIVE_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 @@ -93,7 +93,7 @@ async fn main() -> anyhow::Result<()> {

let client = stackable_operator::client::initialize_operator(
Some(OPERATOR_NAME.to_string()),
&cluster_info_opts,
&cluster_info,
)
.await?;
let event_recorder = Arc::new(Recorder::new(
Expand Down
4 changes: 2 additions & 2 deletions rust/operator-binary/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ pub fn build_rolegroup_headless_service(
.context(ObjectMissingMetadataForOwnerRefSnafu)?
.with_recommended_labels(build_recommended_labels(
hive,
&resolved_product_image.app_version_label,
&resolved_product_image.app_version_label_value,
&rolegroup.role,
&rolegroup.role_group,
))
Expand Down Expand Up @@ -85,7 +85,7 @@ pub fn build_rolegroup_metrics_service(
.context(ObjectMissingMetadataForOwnerRefSnafu)?
.with_recommended_labels(build_recommended_labels(
hive,
&resolved_product_image.app_version_label,
&resolved_product_image.app_version_label_value,
&rolegroup.role,
&rolegroup.role_group,
))
Expand Down
Loading