Skip to content
Open
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
28 changes: 16 additions & 12 deletions Cargo.lock

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

65 changes: 42 additions & 23 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 @@ -10,7 +10,7 @@ edition = "2024"
repository = "https://github.com/stackabletech/zookeeper-operator"

[workspace.dependencies]
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "stackable-operator-0.116.0", features = ["webhook"] }
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "stackable-operator-0.118.0", 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.

42 changes: 39 additions & 3 deletions extra/crds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,13 @@ spec:
description: Version of the product, e.g. `1.4.1`.
type: string
pullPolicy:
default: Always
description: '[Pull policy](https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy) used when pulling the image.'
enum:
- IfNotPresent
- Always
- Never
- null
nullable: true
type: string
pullSecrets:
description: '[Image pull secrets](https://kubernetes.io/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod) to pull images from a private registry.'
Expand All @@ -191,12 +192,47 @@ spec:
type: string
stackableVersion:
description: |-
Stackable version of the product, e.g. `23.4`, `23.4.1` or `0.0.0-dev`.
Stackable version of the product, e.g. `26.7.0` or `0.0.0-dev`.

If not specified, the operator will use its own version, e.g. `23.4.1`. When using a nightly
If not specified, the operator will use its own version, e.g. `26.7.1`. When using a nightly
operator or a PR version, it will use the nightly `0.0.0-dev` image.

If this is used in combination with `stackableVersionPolicy: LatestPatch`, the correct
floating tag is computed automatically, e.g. `26.7.0` becomes `26.7` for the product image.
nullable: true
type: string
stackableVersionPolicy:
default: Exact
description: |-
Configure the Stackable version policy. Defaults to `Exact`.

Currently, two variants are supported:

- `Exact`, which uses the exact, fully-qualified, canonical version of a product image.
- `LatestPatch`, referencing a floating tag which always points to the latest patch version
in the current release line. The current release line is either automatically derived by
the operator based on its own version, or can be overridden with `stackableVersion`.

A potential newer image is only pulled when Pods are rotated or their containers are
restarted. Pods are NOT rotated and containers are NOT restarted automatically when a new
image is available. This behaviour makes this a passive update mechanism, rather than an
active one.

It should be noted that when this field is set to `LatestPatch`, the operator automatically
uses `Always` as the pull policy for product images. If set to `Exact`, `IfNotPresent` is
used. Explicitly setting `pullPolicy` takes precedence.

### Examples

- The `stackableVersion` field is not set, the operator falls back to its own version, eg.
26.7.0. If this field is set to `LatestPatch`, the `26.7` floating tag will be used for
product images, else, `26.7.0` will be used.
- The `stackableVersion` field is set to `26.3.0`. If this field is set to `LatestPatch`,
the `26.3` floating tag will be used for product images, else, `26.3.0` will be used.
enum:
- Exact
- LatestPatch
type: string
type: object
objectOverrides:
default: []
Expand Down
7 changes: 7 additions & 0 deletions rust/operator-binary/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,14 @@ mod zk_controller;
mod znode_controller;

mod built_info {
use std::{str::FromStr, sync::LazyLock};

include!(concat!(env!("OUT_DIR"), "/built.rs"));

pub static PKG_VERSION_SEMVER: LazyLock<semver::Version> = LazyLock::new(|| {
semver::Version::from_str(PKG_VERSION)
.expect("PKG_VERSION must be able to be parsed as semver")
});
}

#[derive(clap::Parser)]
Expand Down
2 changes: 1 addition & 1 deletion rust/operator-binary/src/zk_controller/validate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ pub fn validate(
.resolve(
CONTAINER_IMAGE_BASE_NAME,
&operator_environment.image_repository,
crate::built_info::PKG_VERSION,
&crate::built_info::PKG_VERSION_SEMVER,
)
.context(ResolveProductImageSnafu)?;

Expand Down
Loading
Loading