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
661 changes: 351 additions & 310 deletions Cargo.lock

Large diffs are not rendered by default.

1,414 changes: 917 additions & 497 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/hbase-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 @@ -20,7 +20,7 @@ const_format = "0.2"
fnv = "1.0"
futures = { version = "0.3", features = ["compat"] }
indoc = "2.0"
rstest = "0.25"
rstest = "0.26"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
serde_yaml = "0.9"
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 @@ -34,8 +34,8 @@ use stackable_operator::{
product_logging::{self, spec::Logging},
role_utils::{GenericRoleConfig, JavaCommonConfig, Role, RoleGroupRef},
schemars::{self, JsonSchema},
shared::time::Duration,
status::condition::{ClusterCondition, HasStatusCondition},
time::Duration,
versioned::versioned,
};
use strum::{Display, EnumIter, EnumString};
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 @@ -64,7 +64,7 @@ pub fn build_discovery_configmap(
})?
.with_recommended_labels(build_recommended_labels(
hbase,
&resolved_product_image.app_version_label,
&resolved_product_image.app_version_label_value,
&HbaseRole::RegionServer.to_string(),
"discovery",
))
Expand Down
27 changes: 19 additions & 8 deletions rust/operator-binary/src/hbase_controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ use stackable_operator::{
},
},
cluster_resources::{ClusterResourceApplyStrategy, ClusterResources},
commons::{product_image_selection::ResolvedProductImage, rbac::build_rbac_resources},
commons::{
product_image_selection::{self, ResolvedProductImage},
rbac::build_rbac_resources,
},
k8s_openapi::{
api::{
apps::v1::{StatefulSet, StatefulSetSpec},
Expand Down Expand Up @@ -55,11 +58,11 @@ use stackable_operator::{
},
},
role_utils::{GenericRoleConfig, RoleGroupRef},
shared::time::Duration,
status::condition::{
compute_conditions, operations::ClusterOperationsConditionBuilder,
statefulset::StatefulSetConditionBuilder,
},
time::Duration,
utils::cluster_info::KubernetesClusterInfo,
};
use strum::{EnumDiscriminants, IntoStaticStr, ParseError};
Expand Down Expand Up @@ -321,6 +324,11 @@ pub enum Error {

#[snafu(display("failed to build listener persistent volume claim"))]
ListenerPersistentVolumeClaim { source: crate::crd::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 @@ -348,15 +356,16 @@ pub async fn reconcile_hbase(
let resolved_product_image = hbase
.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 zookeeper_connection_information = ZookeeperConnectionInformation::retrieve(hbase, client)
.await
.context(RetrieveZookeeperConnectionInformationSnafu)?;

let roles = hbase.build_role_properties().context(RolePropertiesSnafu)?;

let validated_config = validate_all_roles_and_groups_config(
&resolved_product_image.app_version_label,
&resolved_product_image.app_version_label_value,
&transform_all_roles_to_config(hbase, roles).context(GenerateProductConfigSnafu)?,
&ctx.product_config,
false,
Expand Down Expand Up @@ -676,7 +685,7 @@ fn build_rolegroup_config_map(
.context(ObjectMissingMetadataForOwnerRefSnafu)?
.with_recommended_labels(build_recommended_labels(
hbase,
&resolved_product_image.app_version_label,
&resolved_product_image.app_version_label_value,
&rolegroup.role,
&rolegroup.role_group,
))
Expand Down Expand Up @@ -740,7 +749,7 @@ fn build_rolegroup_service(
.context(ObjectMissingMetadataForOwnerRefSnafu)?
.with_recommended_labels(build_recommended_labels(
hbase,
&resolved_product_image.app_version_label,
&resolved_product_image.app_version_label_value,
&rolegroup.role,
&rolegroup.role_group,
))
Expand Down Expand Up @@ -782,7 +791,7 @@ fn build_rolegroup_statefulset(
resolved_product_image: &ResolvedProductImage,
service_account: &ServiceAccount,
) -> Result<StatefulSet> {
let hbase_version = &resolved_product_image.app_version_label;
let hbase_version = &resolved_product_image.app_version_label_value;

let ports = hbase
.ports(hbase_role)
Expand Down Expand Up @@ -1244,7 +1253,9 @@ mod test {

let resolved_image = ResolvedProductImage {
image: format!("oci.stackable.tech/sdp/hbase:{hbase_version}-stackable0.0.0-dev"),
app_version_label: hbase_version.to_string(),
app_version_label_value: hbase_version
.parse()
.expect("test: hbase version is always valid"),
product_version: hbase_version.to_string(),
image_pull_policy: "Never".to_string(),
pull_secrets: None,
Expand Down
2 changes: 1 addition & 1 deletion rust/operator-binary/src/kerberos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use stackable_operator::{
},
},
kube::{ResourceExt, runtime::reflector::ObjectRef},
time::Duration,
shared::time::Duration,
utils::cluster_info::KubernetesClusterInfo,
};

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 @@ -65,15 +65,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 `HBASE_OPERATOR_LOG`, and is now `CONSOLE_LOG` (when using Tracing::pre_configured).
// - The file log level was set by `HBASE_OPERATOR_LOG`, and is now set via `FILE_LOG` (when using Tracing::pre_configured).
// - The file log directory was set by `HBASE_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 @@ -91,7 +91,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
Loading