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
885 changes: 447 additions & 438 deletions Cargo.lock

Large diffs are not rendered by default.

1,979 changes: 1,159 additions & 820 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,15 +11,15 @@ repository = "https://github.com/stackabletech/hdfs-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"] }
clap = "4.5"
const_format = "0.2"
futures = { version = "0.3", features = ["compat"] }
indoc = "2.0"
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/constants.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use stackable_operator::time::Duration;
use stackable_operator::shared::time::Duration;

pub const DEFAULT_DFS_REPLICATION_FACTOR: u8 = 3;

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 @@ -41,8 +41,8 @@ use stackable_operator::{
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 @@ -61,7 +61,7 @@ pub fn build_discovery_configmap(
.with_recommended_labels(build_recommended_labels(
hdfs,
controller,
&resolved_product_image.app_version_label,
&resolved_product_image.app_version_label_value,
&HdfsNodeRole::Name.to_string(),
"discovery",
))
Expand Down
23 changes: 18 additions & 5 deletions rust/operator-binary/src/hdfs_controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ use stackable_operator::{
},
client::Client,
cluster_resources::{ClusterResourceApplyStrategy, ClusterResources},
commons::{product_image_selection::ResolvedProductImage, rbac::build_rbac_resources},
commons::{
product_image_selection::{self, ResolvedProductImage},
rbac::build_rbac_resources,
},
iter::reverse_if,
k8s_openapi::{
DeepMerge,
Expand All @@ -38,14 +41,14 @@ use stackable_operator::{
logging::controller::ReconcilerError,
product_config_utils::{transform_all_roles_to_config, validate_all_roles_and_groups_config},
role_utils::{GenericRoleConfig, RoleGroupRef},
shared::time::Duration,
status::{
condition::{
compute_conditions, operations::ClusterOperationsConditionBuilder,
statefulset::StatefulSetConditionBuilder,
},
rollout::check_statefulset_rollout_complete,
},
time::Duration,
utils::cluster_info::KubernetesClusterInfo,
};
use strum::{EnumDiscriminants, IntoEnumIterator, IntoStaticStr};
Expand Down Expand Up @@ -242,6 +245,11 @@ pub enum Error {
InvalidHdfsCluster {
source: error_boundary::InvalidObject,
},

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

impl ReconcilerError for Error {
Expand Down Expand Up @@ -274,7 +282,8 @@ pub async fn reconcile_hdfs(
let resolved_product_image = hdfs
.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 validated_config = validate_all_roles_and_groups_config(
&resolved_product_image.product_version,
Expand Down Expand Up @@ -396,7 +405,7 @@ pub async fn reconcile_hdfs(
.with_recommended_labels(build_recommended_labels(
hdfs,
RESOURCE_MANAGER_HDFS_CONTROLLER,
&resolved_product_image.app_version_label,
&resolved_product_image.app_version_label_value,
&rolegroup_ref.role,
&rolegroup_ref.role_group,
))
Expand Down Expand Up @@ -1007,7 +1016,11 @@ properties: []
let env_overrides = rolegroup_config.get(&PropertyNameKind::Env);

let merged_config = role.merged_config(&hdfs, "default").unwrap();
let resolved_product_image = hdfs.spec.image.resolve(DOCKER_IMAGE_BASE_NAME, "0.0.0-dev");
let resolved_product_image = hdfs
.spec
.image
.resolve(DOCKER_IMAGE_BASE_NAME, "0.0.0-dev")
.expect("test resolved product image is always valid");

let mut pb = PodBuilder::new();
pb.metadata(ObjectMeta::default());
Expand Down
11 changes: 5 additions & 6 deletions rust/operator-binary/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,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 `HDFS_OPERATOR_LOG`, and is now `CONSOLE_LOG` (when using Tracing::pre_configured).
// - The file log level was set by `HDFS_OPERATOR_LOG`, and is now set via `FILE_LOG` (when using Tracing::pre_configured).
// - The file log directory was set by `HDFS_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 @@ -95,8 +95,7 @@ async fn main() -> anyhow::Result<()> {
"/etc/stackable/hdfs-operator/config-spec/properties.yaml",
])?;
let client =
client::initialize_operator(Some(OPERATOR_NAME.to_string()), &cluster_info_opts)
.await?;
client::initialize_operator(Some(OPERATOR_NAME.to_string()), &cluster_info).await?;
create_controller(client, product_config, watch_namespace).await;
}
};
Expand Down
Loading