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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ All notable changes to this project will be documented in this file.
- `vector` `0.26.0` -> `0.33.0` ([#378], [#409]).
- Let secret-operator handle certificate conversion ([#392]).
- `operator-rs` `0.44.0` -> `0.55.0` ([#381], [#394], [#404], [#405], [#409]).
- Consolidate Rust workspace members ([#425]).

### Fixed

Expand All @@ -38,6 +39,7 @@ All notable changes to this project will be documented in this file.
[#407]: https://github.com/stackabletech/hdfs-operator/pull/407
[#409]: https://github.com/stackabletech/hdfs-operator/pull/409
[#422]: https://github.com/stackabletech/hdfs-operator/pull/422
[#425]: https://github.com/stackabletech/hdfs-operator/pull/425

## [23.7.0] - 2023-07-14

Expand Down
33 changes: 11 additions & 22 deletions Cargo.lock

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

4 changes: 1 addition & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
[workspace]
members = [
"rust/crd", "rust/operator", "rust/operator-binary"
]
members = ["rust/crd", "rust/operator-binary"]

[workspace.package]
version = "0.0.0-dev"
Expand Down
17 changes: 13 additions & 4 deletions rust/operator-binary/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,27 +1,36 @@
[package]
name = "stackable-hdfs-operator-binary"
name = "stackable-hdfs-operator"
description = "Stackable Operator for Apache Hadoop HDFS"
version.workspace = true
authors.workspace = true
license.workspace = true
edition.workspace = true
repository.workspace = true
publish = false
build = "build.rs"

[dependencies]
stackable-hdfs-crd = { path = "../crd" }
stackable-hdfs-operator = { path = "../operator" }

anyhow.workspace = true
clap.workspace = true
futures.workspace = true
indoc.workspace = true
product-config.workspace = true
serde_json.workspace = true
serde.workspace = true
snafu.workspace = true
stackable-operator.workspace = true
strum.workspace = true
tokio.workspace = true
tracing-futures.workspace = true
tracing.workspace = true

[dev-dependencies]
rstest.workspace = true

[build-dependencies]
built.workspace = true

[[bin]]
name = "stackable-hdfs-operator"
path = "src/stackable-hdfs-operator.rs"
path = "src/main.rs"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
50 changes: 49 additions & 1 deletion rust/operator/src/lib.rs → rust/operator-binary/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
use std::sync::Arc;

use clap::{crate_description, crate_version, Parser};
use futures::StreamExt;
use product_config::ProductConfigManager;
use stackable_hdfs_crd::{constants::*, HdfsCluster};
use stackable_operator::{
client::Client,
cli::{Command, ProductOperatorRun},
client::{self, Client},
k8s_openapi::api::{
apps::v1::StatefulSet,
core::v1::{ConfigMap, Pod, Service},
Expand All @@ -13,6 +15,7 @@ use stackable_operator::{
labels::ObjectLabels,
logging::controller::report_controller_reconciled,
namespace::WatchNamespace,
CustomResourceExt,
};
use tracing::info_span;
use tracing_futures::Instrument;
Expand All @@ -28,11 +31,56 @@ mod pod_svc_controller;
mod product_logging;

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 OPERATOR_NAME: &str = "hdfs.stackable.tech";

#[derive(clap::Parser)]
#[clap(about, author)]
struct Opts {
#[clap(subcommand)]
cmd: Command,
}

#[tokio::main]
async fn main() -> anyhow::Result<()> {
let opts = Opts::parse();
match opts.cmd {
Command::Crd => HdfsCluster::print_yaml_schema()?,
Command::Run(ProductOperatorRun {
product_config,
watch_namespace,
tracing_target,
}) => {
stackable_operator::logging::initialize_logging(
"HDFS_OPERATOR_LOG",
APP_NAME,
tracing_target,
);

stackable_operator::utils::print_startup_string(
crate_description!(),
crate_version!(),
built_info::GIT_VERSION,
built_info::TARGET_PLATFORM.unwrap_or("unknown target"),
built_info::BUILT_TIME_UTC,
built_info::RUSTC_VERSION,
);
let product_config = product_config.load(&[
"deploy/config-spec/properties.yaml",
"/etc/stackable/hdfs-operator/config-spec/properties.yaml",
])?;
let client = client::create_client(Some(OPERATOR_NAME.to_string())).await?;
create_controller(client, product_config, watch_namespace).await;
}
};

Ok(())
}

pub async fn create_controller(
client: Client,
product_config: ProductConfigManager,
Expand Down
58 changes: 0 additions & 58 deletions rust/operator-binary/src/stackable-hdfs-operator.rs

This file was deleted.

27 changes: 0 additions & 27 deletions rust/operator/Cargo.toml

This file was deleted.