Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.

## [Unreleased]

### Added

- BREAKING: Add required CLI argument and env var to set the image repository used to construct final product image names: `IMAGE_REPOSITORY` (`--image-repository`), eg. `oci.example.org/my/namespace` ([#778]).

### Changed

- Document Helm deployed RBAC permissions and remove unnecessary permissions ([#770]).
Expand All @@ -15,6 +19,7 @@ All notable changes to this project will be documented in this file.

[#770]: https://github.com/stackabletech/hdfs-operator/pull/770
[#777]: https://github.com/stackabletech/hdfs-operator/pull/777
[#778]: https://github.com/stackabletech/hdfs-operator/pull/778

## [26.3.0] - 2026-03-16

Expand Down
25 changes: 13 additions & 12 deletions Cargo.lock

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

30 changes: 18 additions & 12 deletions Cargo.nix

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repository = "https://github.com/stackabletech/hdfs-operator"

[workspace.dependencies]
product-config = { git = "https://github.com/stackabletech/product-config.git", tag = "0.8.0" }
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "stackable-operator-0.110.1", features = ["crds", "webhook"] }
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "stackable-operator-0.111.1", features = ["crds", "webhook"] }

anyhow = "1.0"
built = { version = "0.8", features = ["chrono", "git2"] }
Expand Down
18 changes: 9 additions & 9 deletions crate-hashes.json

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

17 changes: 12 additions & 5 deletions extra/crds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1332,8 +1332,9 @@ spec:
properties:
custom:
description: |-
Overwrite the docker image.
Specify the full docker image name, e.g. `oci.stackable.tech/sdp/superset:1.4.1-stackable2.1.0`
Provide a custom container image.

Specify the full container image name, e.g. `oci.example.tech/namespace/superset:1.4.1-my-tag`
type: string
productVersion:
description: Version of the product, e.g. `1.4.1`.
Expand All @@ -1360,14 +1361,20 @@ spec:
nullable: true
type: array
repo:
description: Name of the docker repo, e.g. `oci.stackable.tech/sdp`
description: |-
The repository on the container image registry where the container image is located, e.g.
`oci.example.com/namespace`.

If not specified, the operator will use the image registry provided via the operator
environment options.
nullable: true
type: string
stackableVersion:
description: |-
Stackable version of the product, e.g. `23.4`, `23.4.1` or `0.0.0-dev`.
If not specified, the operator will use its own version, e.g. `23.4.1`.
When using a nightly operator or a pr version, it will use the nightly `0.0.0-dev` image.

If not specified, the operator will use its own version, e.g. `23.4.1`. When using a nightly
operator or a PR version, it will use the nightly `0.0.0-dev` image.
nullable: true
type: string
type: object
Expand Down
13 changes: 11 additions & 2 deletions rust/operator-binary/src/crd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1698,8 +1698,11 @@ pub struct HdfsClusterStatus {

#[cfg(test)]
mod test {
use stackable_operator::k8s_openapi::{
api::core::v1::ResourceRequirements, apimachinery::pkg::api::resource::Quantity,
use stackable_operator::{
k8s_openapi::{
api::core::v1::ResourceRequirements, apimachinery::pkg::api::resource::Quantity,
},
versioned::test_utils::RoundtripTestData,
};

use super::*;
Expand Down Expand Up @@ -2050,4 +2053,10 @@ spec:
rack_awareness
);
}

impl RoundtripTestData for v1alpha1::HdfsClusterSpec {
fn roundtrip_test_data() -> Vec<Self> {
vec![]
Comment thread
sbernauer marked this conversation as resolved.
Outdated
}
}
}
12 changes: 9 additions & 3 deletions rust/operator-binary/src/hdfs_controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ use stackable_operator::{
meta::ObjectMetaBuilder,
pod::{PodBuilder, security::PodSecurityContextBuilder},
},
cli::OperatorEnvironmentOptions,
client::Client,
cluster_resources::{ClusterResourceApplyStrategy, ClusterResources},
commons::{
Expand Down Expand Up @@ -76,7 +77,7 @@ pub const RESOURCE_MANAGER_HDFS_CONTROLLER: &str = "hdfs-operator-hdfs-controlle
const HDFS_CONTROLLER_NAME: &str = "hdfs-controller";
pub const HDFS_FULL_CONTROLLER_NAME: &str = concatcp!(HDFS_CONTROLLER_NAME, '.', OPERATOR_NAME);

const DOCKER_IMAGE_BASE_NAME: &str = "hadoop";
const CONTAINER_IMAGE_BASE_NAME: &str = "hadoop";

#[derive(Snafu, Debug, EnumDiscriminants)]
#[strum_discriminants(derive(IntoStaticStr))]
Expand Down Expand Up @@ -262,6 +263,7 @@ pub struct Ctx {
pub client: Client,
pub product_config: ProductConfigManager,
pub event_recorder: Arc<Recorder>,
pub operator_environment: OperatorEnvironmentOptions,
}

pub async fn reconcile_hdfs(
Expand All @@ -280,7 +282,11 @@ pub async fn reconcile_hdfs(
let resolved_product_image = hdfs
.spec
.image
.resolve(DOCKER_IMAGE_BASE_NAME, crate::built_info::PKG_VERSION)
.resolve(
CONTAINER_IMAGE_BASE_NAME,
&ctx.operator_environment.image_repository,
crate::built_info::PKG_VERSION,
)
.context(ResolveProductImageSnafu)?;

let validated_config = {
Expand Down Expand Up @@ -995,7 +1001,7 @@ properties: []
let resolved_product_image = hdfs
.spec
.image
.resolve(DOCKER_IMAGE_BASE_NAME, "0.0.0-dev")
.resolve(CONTAINER_IMAGE_BASE_NAME, "oci.example.org", "0.0.0-dev")
.expect("test resolved product image is always valid");

let mut pb = PodBuilder::new();
Expand Down
3 changes: 2 additions & 1 deletion rust/operator-binary/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,10 @@ async fn main() -> anyhow::Result<()> {
hdfs_controller::reconcile_hdfs,
hdfs_controller::error_policy,
Arc::new(hdfs_controller::Ctx {
event_recorder: hdfs_event_recorder.clone(),
client: client.clone(),
operator_environment,
product_config,
event_recorder: hdfs_event_recorder.clone(),
}),
)
// We can let the reporting happen in the background
Expand Down
Loading