Skip to content

Commit 9c09308

Browse files
committed
feat(operator)!: Support dynamic product image selection
1 parent bdcd118 commit 9c09308

3 files changed

Lines changed: 162 additions & 43 deletions

File tree

crates/stackable-operator/crds/DummyCluster.yaml

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1781,8 +1781,9 @@ spec:
17811781
properties:
17821782
custom:
17831783
description: |-
1784-
Overwrite the docker image.
1785-
Specify the full docker image name, e.g. `oci.stackable.tech/sdp/superset:1.4.1-stackable2.1.0`
1784+
Overwrite the container image.
1785+
1786+
Specify the full container image name, e.g. `oci.stackable.tech/sdp/superset:1.4.1-stackable2.1.0`
17861787
type: string
17871788
productVersion:
17881789
description: Version of the product, e.g. `1.4.1`.
@@ -1808,15 +1809,29 @@ spec:
18081809
type: object
18091810
nullable: true
18101811
type: array
1811-
repo:
1812-
description: Name of the docker repo, e.g. `oci.stackable.tech/sdp`
1812+
registry:
1813+
description: |-
1814+
The container image registry, e.g. `oci.stackable.tech`.
1815+
1816+
If not specified, the operator will use the image registry provided via the operator
1817+
environment options.
1818+
nullable: true
1819+
type: string
1820+
repository:
1821+
description: |-
1822+
The repository on the container image registry where the container image is located, e.g.
1823+
`sdp/airflow`.
1824+
1825+
If not specified, the operator will use the image registry provided via the operator
1826+
environment options.
18131827
nullable: true
18141828
type: string
18151829
stackableVersion:
18161830
description: |-
18171831
Stackable version of the product, e.g. `23.4`, `23.4.1` or `0.0.0-dev`.
1818-
If not specified, the operator will use its own version, e.g. `23.4.1`.
1819-
When using a nightly operator or a pr version, it will use the nightly `0.0.0-dev` image.
1832+
1833+
If not specified, the operator will use its own version, e.g. `23.4.1`. When using a nightly
1834+
operator or a PR version, it will use the nightly `0.0.0-dev` image.
18201835
nullable: true
18211836
type: string
18221837
type: object

crates/stackable-operator/src/cli/environment.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,25 @@ pub struct OperatorEnvironmentOptions {
1313
/// something like `<product>-operator`.
1414
#[arg(long, env)]
1515
pub operator_service_name: String,
16+
17+
/// The image registry which should be used when resolving images provisioned by the operator.
18+
///
19+
/// Example values include: `127.0.0.1` or `oci.example.org`.
20+
///
21+
/// Note that when running the operator on Kubernetes we recommend to provide this value via
22+
/// the deployment mechanism, like Helm.
23+
#[arg(long, env, value_parser = url::Host::parse)]
24+
pub image_registry: url::Host,
25+
26+
/// The image repository used in conjunction with the `image_registry` to form the final image
27+
/// name.
28+
///
29+
/// Example values include: `airflow-operator` or `path/to/hbase-operator`.
30+
///
31+
/// Note that when running the operator on Kubernetes we recommend to provide this value via
32+
/// the deployment mechanism, like Helm. Additionally, care must be taken when this value is
33+
/// used as part of the product image selection, as it (most likely) includes the `-operator`
34+
/// suffix.
35+
#[arg(long, env)]
36+
pub image_repository: String,
1637
}

0 commit comments

Comments
 (0)