diff --git a/CHANGELOG.md b/CHANGELOG.md index b90627c5..769e6e44 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,15 +4,22 @@ ### Added -- Support for configuring which reverse proxies the webserver trusts `X-Forwarded-*` headers from, via `spec.webservers.roleConfig.trustedProxies` ([#835]). +- Support floating tags for product images via the new `spec.image.stackableVersionPolicy` field + ([#862]). +- Support for configuring which reverse proxies the webserver trusts `X-Forwarded-*` headers from, + via `spec.webservers.roleConfig.trustedProxies` ([#835]). ### Changed +- BREAKING: `spec.image.stackableVersion` must now be a full, valid semver version, e.g. `26.7.1`. + Abbreviated values such as `26.7` are no longer accepted ([#862]). +- BREAKING: `spec.image.pullPolicy` now defaults to `IfNotPresent` for non-floating tags instead of + always defaulting to `Always` ([#862]). - Internal operator refactoring: introduce a build() step in the reconciler that assembles all relevant Kubernetes resources before anything is applied ([#814]). - The RBAC ServiceAccount and RoleBinding are now built with the operator-rs `v2::rbac` functions and carry the full set of recommended labels ([#821]). -- Bump stackable-operator to 0.116.0 ([#827], [#838]). +- Bump stackable-operator to 0.118.0 ([#827], [#838], [#862]). - The reconciler now applies resources and derives the cluster status in discrete apply and update_status steps ([#828]). - The level configured for the `airflow.task` logger now sets the level of the `task` handler, @@ -61,6 +68,7 @@ [#849]: https://github.com/stackabletech/airflow-operator/pull/849 [#852]: https://github.com/stackabletech/airflow-operator/pull/852 [#860]: https://github.com/stackabletech/airflow-operator/pull/860 +[#862]: https://github.com/stackabletech/airflow-operator/pull/862 ## [26.7.0] - 2026-07-21 diff --git a/Cargo.lock b/Cargo.lock index 2be5ba74..bf8315ca 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -334,9 +334,9 @@ checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" [[package]] name = "chacha20" -version = "0.10.1" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d524456ba66e72eb8b115ff89e01e497f8e6d11d78b70b1aa13c0fbd97540a81" +checksum = "65c35e4b699c7e15ccbe7ee35c005e4fc0a278d22238a2857e6ce2dadeda1b06" dependencies = [ "cfg-if", "cpufeatures 0.3.0", @@ -1715,7 +1715,7 @@ dependencies = [ [[package]] name = "k8s-version" version = "0.1.3" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.116.0#7b9f9ac9a76fa425ab27f2821377ef86571ca121" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.118.0#bc6c84025c2dcc834b94bfb57ec72810ae5f5eb1" dependencies = [ "darling 0.24.1", "regex", @@ -2683,9 +2683,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.43" +version = "0.23.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0283386ce02abc0151e1761d08802dfe86c173b0b494af5cbc086574e453da06" +checksum = "0d41d731c7d2f962d1ccc364cec258de3c0e93b38c2fb3ba97ac74513048d634" dependencies = [ "log", "once_cell", @@ -2868,6 +2868,10 @@ name = "semver" version = "1.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" +dependencies = [ + "serde", + "serde_core", +] [[package]] name = "serde" @@ -3165,6 +3169,7 @@ dependencies = [ "futures 0.3.34", "indoc", "rstest", + "semver", "serde", "serde_json", "serde_yaml", @@ -3178,7 +3183,7 @@ dependencies = [ [[package]] name = "stackable-certs" version = "0.4.1" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.116.0#7b9f9ac9a76fa425ab27f2821377ef86571ca121" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.118.0#bc6c84025c2dcc834b94bfb57ec72810ae5f5eb1" dependencies = [ "const-oid", "ecdsa", @@ -3201,8 +3206,8 @@ dependencies = [ [[package]] name = "stackable-operator" -version = "0.116.0" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.116.0#7b9f9ac9a76fa425ab27f2821377ef86571ca121" +version = "0.118.0" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.118.0#bc6c84025c2dcc834b94bfb57ec72810ae5f5eb1" dependencies = [ "base64 0.23.1", "clap", @@ -3246,7 +3251,7 @@ dependencies = [ [[package]] name = "stackable-operator-derive" version = "0.3.1" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.116.0#7b9f9ac9a76fa425ab27f2821377ef86571ca121" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.118.0#bc6c84025c2dcc834b94bfb57ec72810ae5f5eb1" dependencies = [ "darling 0.24.1", "proc-macro2", @@ -3257,7 +3262,7 @@ dependencies = [ [[package]] name = "stackable-shared" version = "0.1.2" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.116.0#7b9f9ac9a76fa425ab27f2821377ef86571ca121" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.118.0#bc6c84025c2dcc834b94bfb57ec72810ae5f5eb1" dependencies = [ "jiff", "k8s-openapi", @@ -3274,7 +3279,7 @@ dependencies = [ [[package]] name = "stackable-telemetry" version = "0.6.5" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.116.0#7b9f9ac9a76fa425ab27f2821377ef86571ca121" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.118.0#bc6c84025c2dcc834b94bfb57ec72810ae5f5eb1" dependencies = [ "axum", "clap", @@ -3298,7 +3303,7 @@ dependencies = [ [[package]] name = "stackable-versioned" version = "0.11.1" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.116.0#7b9f9ac9a76fa425ab27f2821377ef86571ca121" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.118.0#bc6c84025c2dcc834b94bfb57ec72810ae5f5eb1" dependencies = [ "kube", "schemars", @@ -3312,7 +3317,7 @@ dependencies = [ [[package]] name = "stackable-versioned-macros" version = "0.11.1" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.116.0#7b9f9ac9a76fa425ab27f2821377ef86571ca121" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.118.0#bc6c84025c2dcc834b94bfb57ec72810ae5f5eb1" dependencies = [ "convert_case", "convert_case_extras", @@ -3330,7 +3335,7 @@ dependencies = [ [[package]] name = "stackable-webhook" version = "0.9.2" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.116.0#7b9f9ac9a76fa425ab27f2821377ef86571ca121" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.118.0#bc6c84025c2dcc834b94bfb57ec72810ae5f5eb1" dependencies = [ "arc-swap", "async-trait", diff --git a/Cargo.nix b/Cargo.nix index 1c54068d..48cf1df2 100644 --- a/Cargo.nix +++ b/Cargo.nix @@ -1036,9 +1036,9 @@ rec { }; "chacha20" = rec { crateName = "chacha20"; - version = "0.10.1"; + version = "0.10.2"; edition = "2024"; - sha256 = "108aajbvs3rwl4d0pdvq3p8ydy4pwh0rxy2z265ynwkflrmla96m"; + sha256 = "01hvvbgdmqkcgs2s4f12s9wa5h2gbq05rqvypv61azlwd55mxhv5"; authors = [ "RustCrypto Developers" ]; @@ -5436,8 +5436,8 @@ rec { workspace_member = null; src = pkgs.fetchgit { url = "https://github.com/stackabletech/operator-rs.git"; - rev = "7b9f9ac9a76fa425ab27f2821377ef86571ca121"; - sha256 = "1p3744fxgvs12sqwvi8hhainwrgvhdfwmbyqf0sp0aq3awq3q1v9"; + rev = "bc6c84025c2dcc834b94bfb57ec72810ae5f5eb1"; + sha256 = "0cgziqra8097hp05ynib1qpw4c95n972f4w2rk9l3llyp8r1vmci"; }; libName = "k8s_version"; authors = [ @@ -8841,9 +8841,9 @@ rec { }; "rustls" = rec { crateName = "rustls"; - version = "0.23.43"; + version = "0.23.45"; edition = "2021"; - sha256 = "01nsagj78r88pifaz55ln1rw31py5n00h7bnw58h3g1aw1n3i0q2"; + sha256 = "0d6n90q52x5cjyxb6bwcnf9hwg6yb31cwr63rk8n5yfjqwqxfh8d"; dependencies = [ { name = "log"; @@ -9478,11 +9478,27 @@ rec { authors = [ "David Tolnay " ]; + dependencies = [ + { + name = "serde"; + packageId = "serde"; + optional = true; + usesDefaultFeatures = false; + target = { target, features }: false; + } + { + name = "serde_core"; + packageId = "serde_core"; + rename = "serde"; + optional = true; + usesDefaultFeatures = false; + } + ]; features = { "default" = [ "std" ]; "serde" = [ "dep:serde" ]; }; - resolvedDefaultFeatures = [ "default" "std" ]; + resolvedDefaultFeatures = [ "default" "serde" "std" ]; }; "serde" = rec { crateName = "serde"; @@ -10368,6 +10384,10 @@ rec { name = "indoc"; packageId = "indoc"; } + { + name = "semver"; + packageId = "semver"; + } { name = "serde"; packageId = "serde"; @@ -10436,8 +10456,8 @@ rec { workspace_member = null; src = pkgs.fetchgit { url = "https://github.com/stackabletech/operator-rs.git"; - rev = "7b9f9ac9a76fa425ab27f2821377ef86571ca121"; - sha256 = "1p3744fxgvs12sqwvi8hhainwrgvhdfwmbyqf0sp0aq3awq3q1v9"; + rev = "bc6c84025c2dcc834b94bfb57ec72810ae5f5eb1"; + sha256 = "0cgziqra8097hp05ynib1qpw4c95n972f4w2rk9l3llyp8r1vmci"; }; libName = "stackable_certs"; authors = [ @@ -10534,13 +10554,13 @@ rec { }; "stackable-operator" = rec { crateName = "stackable-operator"; - version = "0.116.0"; + version = "0.118.0"; edition = "2024"; workspace_member = null; src = pkgs.fetchgit { url = "https://github.com/stackabletech/operator-rs.git"; - rev = "7b9f9ac9a76fa425ab27f2821377ef86571ca121"; - sha256 = "1p3744fxgvs12sqwvi8hhainwrgvhdfwmbyqf0sp0aq3awq3q1v9"; + rev = "bc6c84025c2dcc834b94bfb57ec72810ae5f5eb1"; + sha256 = "0cgziqra8097hp05ynib1qpw4c95n972f4w2rk9l3llyp8r1vmci"; }; libName = "stackable_operator"; authors = [ @@ -10631,6 +10651,7 @@ rec { { name = "semver"; packageId = "semver"; + features = [ "serde" ]; } { name = "serde"; @@ -10720,8 +10741,10 @@ rec { "client-feature-gates" = [ "dep:winnow" ]; "crds" = [ "dep:stackable-versioned" ]; "default" = [ "crds" ]; - "full" = [ "client-feature-gates" "crds" "certs" "test-support" "time" "webhook" "kube-ws" "kube-cel" ]; + "full" = [ "client-feature-gates" "crds" "certs" "test-support" "time" "webhook" "kube-ws" "kube-cel" "kube-http-proxy" "kube-socks5" ]; "kube-cel" = [ "kube/cel" ]; + "kube-http-proxy" = [ "kube/http-proxy" ]; + "kube-socks5" = [ "kube/socks5" ]; "kube-ws" = [ "kube/ws" ]; "time" = [ "stackable-shared/time" ]; "webhook" = [ "dep:stackable-webhook" ]; @@ -10735,8 +10758,8 @@ rec { workspace_member = null; src = pkgs.fetchgit { url = "https://github.com/stackabletech/operator-rs.git"; - rev = "7b9f9ac9a76fa425ab27f2821377ef86571ca121"; - sha256 = "1p3744fxgvs12sqwvi8hhainwrgvhdfwmbyqf0sp0aq3awq3q1v9"; + rev = "bc6c84025c2dcc834b94bfb57ec72810ae5f5eb1"; + sha256 = "0cgziqra8097hp05ynib1qpw4c95n972f4w2rk9l3llyp8r1vmci"; }; procMacro = true; libName = "stackable_operator_derive"; @@ -10770,8 +10793,8 @@ rec { workspace_member = null; src = pkgs.fetchgit { url = "https://github.com/stackabletech/operator-rs.git"; - rev = "7b9f9ac9a76fa425ab27f2821377ef86571ca121"; - sha256 = "1p3744fxgvs12sqwvi8hhainwrgvhdfwmbyqf0sp0aq3awq3q1v9"; + rev = "bc6c84025c2dcc834b94bfb57ec72810ae5f5eb1"; + sha256 = "0cgziqra8097hp05ynib1qpw4c95n972f4w2rk9l3llyp8r1vmci"; }; libName = "stackable_shared"; authors = [ @@ -10851,8 +10874,8 @@ rec { workspace_member = null; src = pkgs.fetchgit { url = "https://github.com/stackabletech/operator-rs.git"; - rev = "7b9f9ac9a76fa425ab27f2821377ef86571ca121"; - sha256 = "1p3744fxgvs12sqwvi8hhainwrgvhdfwmbyqf0sp0aq3awq3q1v9"; + rev = "bc6c84025c2dcc834b94bfb57ec72810ae5f5eb1"; + sha256 = "0cgziqra8097hp05ynib1qpw4c95n972f4w2rk9l3llyp8r1vmci"; }; libName = "stackable_telemetry"; authors = [ @@ -10961,8 +10984,8 @@ rec { workspace_member = null; src = pkgs.fetchgit { url = "https://github.com/stackabletech/operator-rs.git"; - rev = "7b9f9ac9a76fa425ab27f2821377ef86571ca121"; - sha256 = "1p3744fxgvs12sqwvi8hhainwrgvhdfwmbyqf0sp0aq3awq3q1v9"; + rev = "bc6c84025c2dcc834b94bfb57ec72810ae5f5eb1"; + sha256 = "0cgziqra8097hp05ynib1qpw4c95n972f4w2rk9l3llyp8r1vmci"; }; libName = "stackable_versioned"; authors = [ @@ -11011,8 +11034,8 @@ rec { workspace_member = null; src = pkgs.fetchgit { url = "https://github.com/stackabletech/operator-rs.git"; - rev = "7b9f9ac9a76fa425ab27f2821377ef86571ca121"; - sha256 = "1p3744fxgvs12sqwvi8hhainwrgvhdfwmbyqf0sp0aq3awq3q1v9"; + rev = "bc6c84025c2dcc834b94bfb57ec72810ae5f5eb1"; + sha256 = "0cgziqra8097hp05ynib1qpw4c95n972f4w2rk9l3llyp8r1vmci"; }; procMacro = true; libName = "stackable_versioned_macros"; @@ -11079,8 +11102,8 @@ rec { workspace_member = null; src = pkgs.fetchgit { url = "https://github.com/stackabletech/operator-rs.git"; - rev = "7b9f9ac9a76fa425ab27f2821377ef86571ca121"; - sha256 = "1p3744fxgvs12sqwvi8hhainwrgvhdfwmbyqf0sp0aq3awq3q1v9"; + rev = "bc6c84025c2dcc834b94bfb57ec72810ae5f5eb1"; + sha256 = "0cgziqra8097hp05ynib1qpw4c95n972f4w2rk9l3llyp8r1vmci"; }; libName = "stackable_webhook"; authors = [ diff --git a/Cargo.toml b/Cargo.toml index 089b52ac..2d198df0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,7 @@ repository = "https://github.com/stackabletech/airflow-operator" stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", features = [ "crds", "webhook", -], tag = "stackable-operator-0.116.0" } +], tag = "stackable-operator-0.118.0" } anyhow = "1.0" built = { version = "0.8", features = ["chrono", "git2"] } diff --git a/crate-hashes.json b/crate-hashes.json index 3fae0f9f..8357dcf2 100644 --- a/crate-hashes.json +++ b/crate-hashes.json @@ -1,11 +1,11 @@ { - "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.116.0#k8s-version@0.1.3": "1p3744fxgvs12sqwvi8hhainwrgvhdfwmbyqf0sp0aq3awq3q1v9", - "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.116.0#stackable-certs@0.4.1": "1p3744fxgvs12sqwvi8hhainwrgvhdfwmbyqf0sp0aq3awq3q1v9", - "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.116.0#stackable-operator-derive@0.3.1": "1p3744fxgvs12sqwvi8hhainwrgvhdfwmbyqf0sp0aq3awq3q1v9", - "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.116.0#stackable-operator@0.116.0": "1p3744fxgvs12sqwvi8hhainwrgvhdfwmbyqf0sp0aq3awq3q1v9", - "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.116.0#stackable-shared@0.1.2": "1p3744fxgvs12sqwvi8hhainwrgvhdfwmbyqf0sp0aq3awq3q1v9", - "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.116.0#stackable-telemetry@0.6.5": "1p3744fxgvs12sqwvi8hhainwrgvhdfwmbyqf0sp0aq3awq3q1v9", - "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.116.0#stackable-versioned-macros@0.11.1": "1p3744fxgvs12sqwvi8hhainwrgvhdfwmbyqf0sp0aq3awq3q1v9", - "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.116.0#stackable-versioned@0.11.1": "1p3744fxgvs12sqwvi8hhainwrgvhdfwmbyqf0sp0aq3awq3q1v9", - "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.116.0#stackable-webhook@0.9.2": "1p3744fxgvs12sqwvi8hhainwrgvhdfwmbyqf0sp0aq3awq3q1v9" + "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.118.0#k8s-version@0.1.3": "0cgziqra8097hp05ynib1qpw4c95n972f4w2rk9l3llyp8r1vmci", + "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.118.0#stackable-certs@0.4.1": "0cgziqra8097hp05ynib1qpw4c95n972f4w2rk9l3llyp8r1vmci", + "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.118.0#stackable-operator-derive@0.3.1": "0cgziqra8097hp05ynib1qpw4c95n972f4w2rk9l3llyp8r1vmci", + "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.118.0#stackable-operator@0.118.0": "0cgziqra8097hp05ynib1qpw4c95n972f4w2rk9l3llyp8r1vmci", + "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.118.0#stackable-shared@0.1.2": "0cgziqra8097hp05ynib1qpw4c95n972f4w2rk9l3llyp8r1vmci", + "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.118.0#stackable-telemetry@0.6.5": "0cgziqra8097hp05ynib1qpw4c95n972f4w2rk9l3llyp8r1vmci", + "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.118.0#stackable-versioned-macros@0.11.1": "0cgziqra8097hp05ynib1qpw4c95n972f4w2rk9l3llyp8r1vmci", + "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.118.0#stackable-versioned@0.11.1": "0cgziqra8097hp05ynib1qpw4c95n972f4w2rk9l3llyp8r1vmci", + "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.118.0#stackable-webhook@0.9.2": "0cgziqra8097hp05ynib1qpw4c95n972f4w2rk9l3llyp8r1vmci" } \ No newline at end of file diff --git a/extra/crds.yaml b/extra/crds.yaml index 282db8fc..69bed1dd 100644 --- a/extra/crds.yaml +++ b/extra/crds.yaml @@ -2606,12 +2606,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.' @@ -2637,12 +2638,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 kubernetesExecutors: description: With the Kubernetes executor, executor Pods are created on demand. @@ -8841,12 +8877,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.' @@ -8872,12 +8909,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 kubernetesExecutors: description: With the Kubernetes executor, executor Pods are created on demand. diff --git a/rust/operator-binary/Cargo.toml b/rust/operator-binary/Cargo.toml index d12eee75..3e4f5b9d 100644 --- a/rust/operator-binary/Cargo.toml +++ b/rust/operator-binary/Cargo.toml @@ -17,6 +17,7 @@ const_format.workspace = true fnv.workspace = true futures.workspace = true indoc.workspace = true +semver.workspace = true serde.workspace = true serde_json.workspace = true serde_yaml.workspace = true diff --git a/rust/operator-binary/src/controller/validate.rs b/rust/operator-binary/src/controller/validate.rs index 96d045b8..2d092c89 100644 --- a/rust/operator-binary/src/controller/validate.rs +++ b/rust/operator-binary/src/controller/validate.rs @@ -105,7 +105,7 @@ pub fn validate_cluster( .resolve( CONTAINER_IMAGE_BASE_NAME, image_repository, - crate::built_info::PKG_VERSION, + &crate::built_info::PKG_VERSION_SEMVER, ) .context(ResolveProductImageSnafu)?; diff --git a/rust/operator-binary/src/crd/mod.rs b/rust/operator-binary/src/crd/mod.rs index 3e0216fd..846c643d 100644 --- a/rust/operator-binary/src/crd/mod.rs +++ b/rust/operator-binary/src/crd/mod.rs @@ -1123,7 +1123,13 @@ mod tests { let resolved_airflow_image: ResolvedProductImage = cluster .spec .image - .resolve("airflow", "oci.example.org", "0.0.0-dev") + .resolve( + "airflow", + "oci.example.org", + &"0.0.0-dev" + .parse() + .expect("static semantic version must parse"), + ) .expect("test: resolved product image is always valid"); assert_eq!("3.1.6", &resolved_airflow_image.product_version); diff --git a/rust/operator-binary/src/main.rs b/rust/operator-binary/src/main.rs index 0b4d8efe..e3a932f8 100644 --- a/rust/operator-binary/src/main.rs +++ b/rust/operator-binary/src/main.rs @@ -47,7 +47,14 @@ mod util; mod webhooks; mod built_info { + use std::{str::FromStr, sync::LazyLock}; + include!(concat!(env!("OUT_DIR"), "/built.rs")); + + pub static PKG_VERSION_SEMVER: LazyLock = LazyLock::new(|| { + semver::Version::from_str(PKG_VERSION) + .expect("PKG_VERSION must be able to be parsed as semver") + }); } #[derive(Parser)]