diff --git a/CHANGELOG.md b/CHANGELOG.md index ad721e00..db1a78d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,23 +6,28 @@ All notable changes to this project will be documented in this file. ### Added +- Support floating tags for product images via the new `spec.image.stackableVersionPolicy` field + ([#773]). - The history server and Spark Connect server StatefulSets now carry the `restarter.stackable.tech/enabled: "true"` label, opting them into the restarter-controller so that their Pods are automatically rolled when a mounted ConfigMap or Secret changes ([#754]). ### Changed +- Bump `stackable-operator` to 0.118.0 ([#732], [#753], [#773]). +- 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 ([#773]). +- BREAKING: `spec.image.pullPolicy` now defaults to `IfNotPresent` for non-floating tags instead of + always defaulting to `Always` ([#773]). - Internal operator refactoring: introduce a build() step in the history and connect server reconcilers that assembles all relevant Kubernetes resources before anything is applied ([#721]). -- Bump stackable-operator to 0.114.0 ([#732]). - The RBAC ServiceAccounts and RoleBindings of the history and connect servers are now built with the operator-rs `v2::rbac` functions and carry the recommended labels ([#727]). - All product containers now run with `securityContext.runAsNonRoot` set to `true` to improve security ([#744]). - The reconcilers now apply resources in a discrete apply step; the connect server and application controllers additionally update the status in a discrete update_status step (the history server CRD has no status) ([#746]). -- Bump stackable-operator to 0.116.0 ([#753]). - BREAKING: Remove the `app.kubernetes.io/component` and `app.kubernetes.io/role-group` labels from the resources they don't apply to (previously set to `none` or a placeholder value such as `sparkapplication` or `default`). StatefulSets created by older operator versions cannot be @@ -79,6 +84,7 @@ All notable changes to this project will be documented in this file. [#764]: https://github.com/stackabletech/spark-k8s-operator/pull/764 [#766]: https://github.com/stackabletech/spark-k8s-operator/pull/766 [#769]: https://github.com/stackabletech/spark-k8s-operator/pull/769 +[#773]: https://github.com/stackabletech/spark-k8s-operator/pull/773 ## [26.7.0] - 2026-07-21 diff --git a/Cargo.lock b/Cargo.lock index 950d5d71..10745770 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.0", "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" @@ -3156,7 +3160,7 @@ checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" [[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", @@ -3179,8 +3183,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", @@ -3224,7 +3228,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.0", "proc-macro2", @@ -3235,7 +3239,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", @@ -3276,7 +3280,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", @@ -3300,7 +3304,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", @@ -3314,7 +3318,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", @@ -3332,7 +3336,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 772b4f39..e0d74fb1 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"; @@ -10334,8 +10350,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 = [ @@ -10432,13 +10448,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 = [ @@ -10529,6 +10545,7 @@ rec { { name = "semver"; packageId = "semver"; + features = [ "serde" ]; } { name = "serde"; @@ -10618,8 +10635,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" ]; @@ -10633,8 +10652,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"; @@ -10668,8 +10687,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 = [ @@ -10855,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 = [ @@ -10965,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 = [ @@ -11015,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"; @@ -11083,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 298802c9..dc8a0a05 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,7 @@ edition = "2024" repository = "https://github.com/stackabletech/spark-k8s-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"] } 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 30719a06..5ff4fee4 100644 --- a/extra/crds.yaml +++ b/extra/crds.yaml @@ -2140,12 +2140,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.' @@ -2171,12 +2172,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 vectorAggregatorConfigMapName: description: |- @@ -2282,12 +2318,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.' @@ -2313,12 +2350,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 logFileDirectory: description: The log file directory definition used by the Spark history server. @@ -4135,12 +4207,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.' @@ -4166,12 +4239,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: [] @@ -6746,12 +6854,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.' @@ -6777,12 +6886,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 vectorAggregatorConfigMapName: description: |- diff --git a/rust/operator-binary/src/connect/controller/validate.rs b/rust/operator-binary/src/connect/controller/validate.rs index aa761dc7..89b09713 100644 --- a/rust/operator-binary/src/connect/controller/validate.rs +++ b/rust/operator-binary/src/connect/controller/validate.rs @@ -233,7 +233,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)?; diff --git a/rust/operator-binary/src/crd/mod.rs b/rust/operator-binary/src/crd/mod.rs index ec0b6d6f..f5992a18 100644 --- a/rust/operator-binary/src/crd/mod.rs +++ b/rust/operator-binary/src/crd/mod.rs @@ -1690,7 +1690,13 @@ spec: let resolved_product_image = spark_application .spec .spark_image - .resolve("spark-k8s", "oci.example.org/sdp", "0.0.0-dev") + .resolve( + "spark-k8s", + "oci.example.org/sdp", + &"0.0.0-dev" + .parse() + .expect("static semantic version must parse"), + ) .expect("the product image resolves"); let command = spark_application diff --git a/rust/operator-binary/src/history/controller/validate.rs b/rust/operator-binary/src/history/controller/validate.rs index 3b5b39d1..c5ff8bab 100644 --- a/rust/operator-binary/src/history/controller/validate.rs +++ b/rust/operator-binary/src/history/controller/validate.rs @@ -271,7 +271,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)?; diff --git a/rust/operator-binary/src/main.rs b/rust/operator-binary/src/main.rs index 215d3e56..f14ecf41 100644 --- a/rust/operator-binary/src/main.rs +++ b/rust/operator-binary/src/main.rs @@ -62,7 +62,14 @@ pub(crate) mod test_support; 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)] diff --git a/rust/operator-binary/src/spark_k8s_controller/validate.rs b/rust/operator-binary/src/spark_k8s_controller/validate.rs index 69623ed5..ce054f1a 100644 --- a/rust/operator-binary/src/spark_k8s_controller/validate.rs +++ b/rust/operator-binary/src/spark_k8s_controller/validate.rs @@ -170,7 +170,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)?;