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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## [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` ([#xxx]).
Comment thread
Techassi marked this conversation as resolved.
Outdated

### Changed

- Document Helm deployed RBAC permissions and remove unnecessary permissions ([#717]).
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/superset-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 = ["webhook"] }
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "stackable-operator-0.111.1", features = ["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 @@ -273,8 +273,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 @@ -301,14 +302,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: 13 additions & 0 deletions rust/operator-binary/src/crd/druidconnection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,3 +143,16 @@ impl Default for v1alpha1::DruidConnectionStatus {
Self::new()
}
}

#[cfg(test)]
mod tests {
use stackable_operator::versioned::test_utils::RoundtripTestData;

use super::v1alpha1;

impl RoundtripTestData for v1alpha1::DruidConnectionSpec {
fn roundtrip_test_data() -> Vec<Self> {
vec![]
}
}
}
13 changes: 13 additions & 0 deletions rust/operator-binary/src/crd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -614,3 +614,16 @@ impl v1alpha1::SupersetCluster {
fragment::validate(conf_rolegroup).context(FragmentValidationFailureSnafu)
}
}

#[cfg(test)]
mod tests {
use stackable_operator::versioned::test_utils::RoundtripTestData;

use super::v1alpha1;

impl RoundtripTestData for v1alpha1::SupersetClusterSpec {
fn roundtrip_test_data() -> Vec<Self> {
vec![]
Comment thread
sbernauer marked this conversation as resolved.
Outdated
}
}
}
10 changes: 8 additions & 2 deletions rust/operator-binary/src/druid_connection_controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use stackable_operator::{
meta::ObjectMetaBuilder,
pod::{container::ContainerBuilder, security::PodSecurityContextBuilder},
},
cli::OperatorEnvironmentOptions,
client::Client,
commons::product_image_selection::{self, ResolvedProductImage},
database_connections::TemplatingMechanism,
Expand All @@ -31,7 +32,7 @@ use crate::{
INTERNAL_SECRET_SECRET_KEY, PYTHONPATH, SUPERSET_CONFIG_FILENAME, druidconnection, v1alpha1,
},
rbac,
superset_controller::DOCKER_IMAGE_BASE_NAME,
superset_controller::CONTAINER_IMAGE_BASE_NAME,
util::{JobState, get_job_state},
};

Expand All @@ -41,6 +42,7 @@ pub const DRUID_CONNECTION_FULL_CONTROLLER_NAME: &str =

pub struct Ctx {
pub client: Client,
pub operator_environment: OperatorEnvironmentOptions,
}

#[derive(Snafu, Debug, EnumDiscriminants)]
Expand Down Expand Up @@ -216,7 +218,11 @@ pub async fn reconcile_druid_connection(
let resolved_product_image = superset_cluster
.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 job = build_import_job(
&superset_cluster,
Expand Down
2 changes: 2 additions & 0 deletions rust/operator-binary/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ async fn main() -> anyhow::Result<()> {
superset_controller::error_policy,
Arc::new(superset_controller::Ctx {
client: client.clone(),
operator_environment: operator_environment.clone(),
product_config,
}),
)
Expand Down Expand Up @@ -271,6 +272,7 @@ async fn main() -> anyhow::Result<()> {
druid_connection_controller::error_policy,
Arc::new(druid_connection_controller::Ctx {
client: client.clone(),
operator_environment,
}),
)
// We can let the reporting happen in the background
Expand Down
Loading
Loading