From 1429f44631329b03528bc50d200db2ee760a9fe9 Mon Sep 17 00:00:00 2001 From: Sebastian Bernauer Date: Mon, 19 Jan 2026 11:03:22 +0100 Subject: [PATCH 1/4] test: Add kuttl test for objectOverrides --- .../kuttl/object-overrides/00-patch-ns.yaml.j2 | 9 +++++++++ .../kuttl/object-overrides/10-assert.yaml.j2 | 12 ++++++++++++ .../object-overrides/10-create-listener.yaml | 5 +++++ .../kuttl/object-overrides/10_listener.yaml | 18 ++++++++++++++++++ tests/test-definition.yaml | 2 ++ 5 files changed, 46 insertions(+) create mode 100644 tests/templates/kuttl/object-overrides/00-patch-ns.yaml.j2 create mode 100644 tests/templates/kuttl/object-overrides/10-assert.yaml.j2 create mode 100644 tests/templates/kuttl/object-overrides/10-create-listener.yaml create mode 100644 tests/templates/kuttl/object-overrides/10_listener.yaml diff --git a/tests/templates/kuttl/object-overrides/00-patch-ns.yaml.j2 b/tests/templates/kuttl/object-overrides/00-patch-ns.yaml.j2 new file mode 100644 index 00000000..67185acf --- /dev/null +++ b/tests/templates/kuttl/object-overrides/00-patch-ns.yaml.j2 @@ -0,0 +1,9 @@ +{% if test_scenario['values']['openshift'] == 'true' %} +# see https://github.com/stackabletech/issues/issues/566 +--- +apiVersion: kuttl.dev/v1beta1 +kind: TestStep +commands: + - script: kubectl patch namespace $NAMESPACE -p '{"metadata":{"labels":{"pod-security.kubernetes.io/enforce":"privileged"}}}' + timeout: 120 +{% endif %} diff --git a/tests/templates/kuttl/object-overrides/10-assert.yaml.j2 b/tests/templates/kuttl/object-overrides/10-assert.yaml.j2 new file mode 100644 index 00000000..6321abab --- /dev/null +++ b/tests/templates/kuttl/object-overrides/10-assert.yaml.j2 @@ -0,0 +1,12 @@ +--- +apiVersion: v1 +kind: Service +metadata: + name: listener +spec: + type: ClusterIP + ports: + - name: http + port: 80 + # Set by objectOverrides + internalTrafficPolicy: Local diff --git a/tests/templates/kuttl/object-overrides/10-create-listener.yaml b/tests/templates/kuttl/object-overrides/10-create-listener.yaml new file mode 100644 index 00000000..3dd4317c --- /dev/null +++ b/tests/templates/kuttl/object-overrides/10-create-listener.yaml @@ -0,0 +1,5 @@ +--- +apiVersion: kuttl.dev/v1beta1 +kind: TestStep +commands: + - script: envsubst '$NAMESPACE' < 10_listener.yaml | kubectl apply -n $NAMESPACE -f - diff --git a/tests/templates/kuttl/object-overrides/10_listener.yaml b/tests/templates/kuttl/object-overrides/10_listener.yaml new file mode 100644 index 00000000..a7cde261 --- /dev/null +++ b/tests/templates/kuttl/object-overrides/10_listener.yaml @@ -0,0 +1,18 @@ +--- +apiVersion: listeners.stackable.tech/v1alpha1 +kind: Listener +metadata: + name: listener +spec: + className: cluster-internal + ports: + - name: http + port: 80 + objectOverrides: + - apiVersion: v1 + kind: Service + metadata: + name: listener + namespace: $NAMESPACE + spec: + internalTrafficPolicy: Local diff --git a/tests/test-definition.yaml b/tests/test-definition.yaml index 4f28a83d..64a49432 100644 --- a/tests/test-definition.yaml +++ b/tests/test-definition.yaml @@ -23,6 +23,8 @@ tests: dimensions: - openshift - loadbalancer-allocatenodeports + - name: object-overrides + dimensions: [] suites: - name: nightly - name: openshift From aa66fba7eb0ae9fe12a35b720c4fb11c203b3988 Mon Sep 17 00:00:00 2001 From: Sebastian Bernauer Date: Mon, 19 Jan 2026 11:39:04 +0100 Subject: [PATCH 2/4] feat: Support serviceOverride on the ListenerClass --- CHANGELOG.md | 2 + Cargo.lock | 16 +++---- Cargo.nix | 44 +++++++++---------- Cargo.toml | 2 +- crate-hashes.json | 14 +++--- deploy/helm/listener-operator/crds/crds.yaml | 14 ++++++ .../src/listener_controller.rs | 9 +++- .../kuttl/object-overrides/10-assert.yaml.j2 | 12 ----- .../00-patch-ns.yaml.j2 | 0 .../overrides/05-create-listenerclass.yaml | 5 +++ .../kuttl/overrides/05_listenerclass.yaml.j2 | 17 +++++++ .../kuttl/overrides/10-assert.yaml.j2 | 21 +++++++++ .../10-create-listener.yaml | 0 .../10_listener.yaml | 5 ++- tests/test-definition.yaml | 2 +- 15 files changed, 110 insertions(+), 53 deletions(-) delete mode 100644 tests/templates/kuttl/object-overrides/10-assert.yaml.j2 rename tests/templates/kuttl/{object-overrides => overrides}/00-patch-ns.yaml.j2 (100%) create mode 100644 tests/templates/kuttl/overrides/05-create-listenerclass.yaml create mode 100644 tests/templates/kuttl/overrides/05_listenerclass.yaml.j2 create mode 100644 tests/templates/kuttl/overrides/10-assert.yaml.j2 rename tests/templates/kuttl/{object-overrides => overrides}/10-create-listener.yaml (100%) rename tests/templates/kuttl/{object-overrides => overrides}/10_listener.yaml (70%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 064d5e17..a8aa3c4e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ All notable changes to this project will be documented in this file. - Support objectOverrides using `.spec.objectOverrides` on the `Listener`. See [objectOverrides concepts page](https://docs.stackable.tech/home/nightly/concepts/overrides/#object-overrides) for details ([#364]). +- Support serviceOverrides using `.spec.serviceOverrides` on the `ListenerClass` ([#XXX]). ### Changed @@ -20,6 +21,7 @@ All notable changes to this project will be documented in this file. [#360]: https://github.com/stackabletech/listener-operator/pull/360 [#363]: https://github.com/stackabletech/listener-operator/pull/363 [#364]: https://github.com/stackabletech/listener-operator/pull/364 +[#XXX]: https://github.com/stackabletech/listener-operator/pull/XXX ## [25.11.0] - 2025-11-07 diff --git a/Cargo.lock b/Cargo.lock index a95a12ea..52fb8b56 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1375,7 +1375,7 @@ dependencies = [ [[package]] name = "k8s-version" version = "0.1.3" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.102.0#402911782469fd689308f3e57c38ad249dec83f3" +source = "git+https://github.com/stackabletech//operator-rs.git?branch=feat%2Flistener-service-overrides#43556e8d1eb043ff9390e2652941a4a3db9f712f" dependencies = [ "darling 0.23.0", "regex", @@ -2582,8 +2582,8 @@ dependencies = [ [[package]] name = "stackable-operator" -version = "0.102.0" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.102.0#402911782469fd689308f3e57c38ad249dec83f3" +version = "0.103.0" +source = "git+https://github.com/stackabletech//operator-rs.git?branch=feat%2Flistener-service-overrides#43556e8d1eb043ff9390e2652941a4a3db9f712f" dependencies = [ "chrono", "clap", @@ -2621,7 +2621,7 @@ dependencies = [ [[package]] name = "stackable-operator-derive" version = "0.3.1" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.102.0#402911782469fd689308f3e57c38ad249dec83f3" +source = "git+https://github.com/stackabletech//operator-rs.git?branch=feat%2Flistener-service-overrides#43556e8d1eb043ff9390e2652941a4a3db9f712f" dependencies = [ "darling 0.23.0", "proc-macro2", @@ -2632,7 +2632,7 @@ dependencies = [ [[package]] name = "stackable-shared" version = "0.0.3" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.102.0#402911782469fd689308f3e57c38ad249dec83f3" +source = "git+https://github.com/stackabletech//operator-rs.git?branch=feat%2Flistener-service-overrides#43556e8d1eb043ff9390e2652941a4a3db9f712f" dependencies = [ "chrono", "k8s-openapi", @@ -2649,7 +2649,7 @@ dependencies = [ [[package]] name = "stackable-telemetry" version = "0.6.1" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.102.0#402911782469fd689308f3e57c38ad249dec83f3" +source = "git+https://github.com/stackabletech//operator-rs.git?branch=feat%2Flistener-service-overrides#43556e8d1eb043ff9390e2652941a4a3db9f712f" dependencies = [ "axum", "clap", @@ -2673,7 +2673,7 @@ dependencies = [ [[package]] name = "stackable-versioned" version = "0.8.3" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.102.0#402911782469fd689308f3e57c38ad249dec83f3" +source = "git+https://github.com/stackabletech//operator-rs.git?branch=feat%2Flistener-service-overrides#43556e8d1eb043ff9390e2652941a4a3db9f712f" dependencies = [ "schemars", "serde", @@ -2686,7 +2686,7 @@ dependencies = [ [[package]] name = "stackable-versioned-macros" version = "0.8.3" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.102.0#402911782469fd689308f3e57c38ad249dec83f3" +source = "git+https://github.com/stackabletech//operator-rs.git?branch=feat%2Flistener-service-overrides#43556e8d1eb043ff9390e2652941a4a3db9f712f" dependencies = [ "convert_case", "darling 0.23.0", diff --git a/Cargo.nix b/Cargo.nix index b900d65b..6bc98e02 100644 --- a/Cargo.nix +++ b/Cargo.nix @@ -4300,9 +4300,9 @@ rec { edition = "2024"; workspace_member = null; src = pkgs.fetchgit { - url = "https://github.com/stackabletech/operator-rs.git"; - rev = "402911782469fd689308f3e57c38ad249dec83f3"; - sha256 = "16j834cchvq6psb4lm5fjz6nm04cg3aqhsffyls20y617ky7whpy"; + url = "https://github.com/stackabletech//operator-rs.git"; + rev = "43556e8d1eb043ff9390e2652941a4a3db9f712f"; + sha256 = "14alwgih3775rijylmx5rw9hi8yc98nfam3bfpg4hsl8yhmqbdlq"; }; libName = "k8s_version"; authors = [ @@ -8549,13 +8549,13 @@ rec { }; "stackable-operator" = rec { crateName = "stackable-operator"; - version = "0.102.0"; + version = "0.103.0"; edition = "2024"; workspace_member = null; src = pkgs.fetchgit { - url = "https://github.com/stackabletech/operator-rs.git"; - rev = "402911782469fd689308f3e57c38ad249dec83f3"; - sha256 = "16j834cchvq6psb4lm5fjz6nm04cg3aqhsffyls20y617ky7whpy"; + url = "https://github.com/stackabletech//operator-rs.git"; + rev = "43556e8d1eb043ff9390e2652941a4a3db9f712f"; + sha256 = "14alwgih3775rijylmx5rw9hi8yc98nfam3bfpg4hsl8yhmqbdlq"; }; libName = "stackable_operator"; authors = [ @@ -8722,9 +8722,9 @@ rec { edition = "2024"; workspace_member = null; src = pkgs.fetchgit { - url = "https://github.com/stackabletech/operator-rs.git"; - rev = "402911782469fd689308f3e57c38ad249dec83f3"; - sha256 = "16j834cchvq6psb4lm5fjz6nm04cg3aqhsffyls20y617ky7whpy"; + url = "https://github.com/stackabletech//operator-rs.git"; + rev = "43556e8d1eb043ff9390e2652941a4a3db9f712f"; + sha256 = "14alwgih3775rijylmx5rw9hi8yc98nfam3bfpg4hsl8yhmqbdlq"; }; procMacro = true; libName = "stackable_operator_derive"; @@ -8757,9 +8757,9 @@ rec { edition = "2024"; workspace_member = null; src = pkgs.fetchgit { - url = "https://github.com/stackabletech/operator-rs.git"; - rev = "402911782469fd689308f3e57c38ad249dec83f3"; - sha256 = "16j834cchvq6psb4lm5fjz6nm04cg3aqhsffyls20y617ky7whpy"; + url = "https://github.com/stackabletech//operator-rs.git"; + rev = "43556e8d1eb043ff9390e2652941a4a3db9f712f"; + sha256 = "14alwgih3775rijylmx5rw9hi8yc98nfam3bfpg4hsl8yhmqbdlq"; }; libName = "stackable_shared"; authors = [ @@ -8839,9 +8839,9 @@ rec { edition = "2024"; workspace_member = null; src = pkgs.fetchgit { - url = "https://github.com/stackabletech/operator-rs.git"; - rev = "402911782469fd689308f3e57c38ad249dec83f3"; - sha256 = "16j834cchvq6psb4lm5fjz6nm04cg3aqhsffyls20y617ky7whpy"; + url = "https://github.com/stackabletech//operator-rs.git"; + rev = "43556e8d1eb043ff9390e2652941a4a3db9f712f"; + sha256 = "14alwgih3775rijylmx5rw9hi8yc98nfam3bfpg4hsl8yhmqbdlq"; }; libName = "stackable_telemetry"; authors = [ @@ -8949,9 +8949,9 @@ rec { edition = "2024"; workspace_member = null; src = pkgs.fetchgit { - url = "https://github.com/stackabletech/operator-rs.git"; - rev = "402911782469fd689308f3e57c38ad249dec83f3"; - sha256 = "16j834cchvq6psb4lm5fjz6nm04cg3aqhsffyls20y617ky7whpy"; + url = "https://github.com/stackabletech//operator-rs.git"; + rev = "43556e8d1eb043ff9390e2652941a4a3db9f712f"; + sha256 = "14alwgih3775rijylmx5rw9hi8yc98nfam3bfpg4hsl8yhmqbdlq"; }; libName = "stackable_versioned"; authors = [ @@ -8993,9 +8993,9 @@ rec { edition = "2024"; workspace_member = null; src = pkgs.fetchgit { - url = "https://github.com/stackabletech/operator-rs.git"; - rev = "402911782469fd689308f3e57c38ad249dec83f3"; - sha256 = "16j834cchvq6psb4lm5fjz6nm04cg3aqhsffyls20y617ky7whpy"; + url = "https://github.com/stackabletech//operator-rs.git"; + rev = "43556e8d1eb043ff9390e2652941a4a3db9f712f"; + sha256 = "14alwgih3775rijylmx5rw9hi8yc98nfam3bfpg4hsl8yhmqbdlq"; }; procMacro = true; libName = "stackable_versioned_macros"; diff --git a/Cargo.toml b/Cargo.toml index 039df3ed..8cf18446 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -44,4 +44,4 @@ kube = { git = "https://github.com/stackabletech/kube-rs", branch = "2.0.1-fix-s [patch."https://github.com/stackabletech/operator-rs.git"] # stackable-operator = { path = "../operator-rs/crates/stackable-operator" } -# stackable-operator = { git = "https://github.com/stackabletech//operator-rs.git", branch = "main" } +stackable-operator = { git = "https://github.com/stackabletech//operator-rs.git", branch = "feat/listener-service-overrides" } diff --git a/crate-hashes.json b/crate-hashes.json index 68215a44..7572c62f 100644 --- a/crate-hashes.json +++ b/crate-hashes.json @@ -1,15 +1,15 @@ { + "git+https://github.com/stackabletech//operator-rs.git?branch=feat%2Flistener-service-overrides#k8s-version@0.1.3": "14alwgih3775rijylmx5rw9hi8yc98nfam3bfpg4hsl8yhmqbdlq", + "git+https://github.com/stackabletech//operator-rs.git?branch=feat%2Flistener-service-overrides#stackable-operator-derive@0.3.1": "14alwgih3775rijylmx5rw9hi8yc98nfam3bfpg4hsl8yhmqbdlq", + "git+https://github.com/stackabletech//operator-rs.git?branch=feat%2Flistener-service-overrides#stackable-operator@0.103.0": "14alwgih3775rijylmx5rw9hi8yc98nfam3bfpg4hsl8yhmqbdlq", + "git+https://github.com/stackabletech//operator-rs.git?branch=feat%2Flistener-service-overrides#stackable-shared@0.0.3": "14alwgih3775rijylmx5rw9hi8yc98nfam3bfpg4hsl8yhmqbdlq", + "git+https://github.com/stackabletech//operator-rs.git?branch=feat%2Flistener-service-overrides#stackable-telemetry@0.6.1": "14alwgih3775rijylmx5rw9hi8yc98nfam3bfpg4hsl8yhmqbdlq", + "git+https://github.com/stackabletech//operator-rs.git?branch=feat%2Flistener-service-overrides#stackable-versioned-macros@0.8.3": "14alwgih3775rijylmx5rw9hi8yc98nfam3bfpg4hsl8yhmqbdlq", + "git+https://github.com/stackabletech//operator-rs.git?branch=feat%2Flistener-service-overrides#stackable-versioned@0.8.3": "14alwgih3775rijylmx5rw9hi8yc98nfam3bfpg4hsl8yhmqbdlq", "git+https://github.com/stackabletech/kube-rs?branch=2.0.1-fix-schema-hoisting#kube-client@2.0.1": "1a7bcl0w1jg71jc4iml0vjp8dpzy71mhxl012grxcy2xp5i6xvgf", "git+https://github.com/stackabletech/kube-rs?branch=2.0.1-fix-schema-hoisting#kube-core@2.0.1": "1a7bcl0w1jg71jc4iml0vjp8dpzy71mhxl012grxcy2xp5i6xvgf", "git+https://github.com/stackabletech/kube-rs?branch=2.0.1-fix-schema-hoisting#kube-derive@2.0.1": "1a7bcl0w1jg71jc4iml0vjp8dpzy71mhxl012grxcy2xp5i6xvgf", "git+https://github.com/stackabletech/kube-rs?branch=2.0.1-fix-schema-hoisting#kube-runtime@2.0.1": "1a7bcl0w1jg71jc4iml0vjp8dpzy71mhxl012grxcy2xp5i6xvgf", "git+https://github.com/stackabletech/kube-rs?branch=2.0.1-fix-schema-hoisting#kube@2.0.1": "1a7bcl0w1jg71jc4iml0vjp8dpzy71mhxl012grxcy2xp5i6xvgf", - "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.102.0#k8s-version@0.1.3": "16j834cchvq6psb4lm5fjz6nm04cg3aqhsffyls20y617ky7whpy", - "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.102.0#stackable-operator-derive@0.3.1": "16j834cchvq6psb4lm5fjz6nm04cg3aqhsffyls20y617ky7whpy", - "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.102.0#stackable-operator@0.102.0": "16j834cchvq6psb4lm5fjz6nm04cg3aqhsffyls20y617ky7whpy", - "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.102.0#stackable-shared@0.0.3": "16j834cchvq6psb4lm5fjz6nm04cg3aqhsffyls20y617ky7whpy", - "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.102.0#stackable-telemetry@0.6.1": "16j834cchvq6psb4lm5fjz6nm04cg3aqhsffyls20y617ky7whpy", - "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.102.0#stackable-versioned-macros@0.8.3": "16j834cchvq6psb4lm5fjz6nm04cg3aqhsffyls20y617ky7whpy", - "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.102.0#stackable-versioned@0.8.3": "16j834cchvq6psb4lm5fjz6nm04cg3aqhsffyls20y617ky7whpy", "git+https://github.com/stackabletech/product-config.git?tag=0.8.0#product-config@0.8.0": "1dz70kapm2wdqcr7ndyjji0lhsl98bsq95gnb2lw487wf6yr7987" } \ No newline at end of file diff --git a/deploy/helm/listener-operator/crds/crds.yaml b/deploy/helm/listener-operator/crds/crds.yaml index bb582426..fe96eb0f 100644 --- a/deploy/helm/listener-operator/crds/crds.yaml +++ b/deploy/helm/listener-operator/crds/crds.yaml @@ -91,6 +91,20 @@ spec: - Local nullable: true type: string + serviceOverrides: + default: + apiVersion: v1 + kind: Service + metadata: {} + description: |- + In the `serviceOverrides` property you can define a + [Service](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.34/#service-v1-core) + to override any property that can be set on a Kubernetes Service. + + This mechanism is similar to the `podOverrides`, which are documented in the + [Pod overrides documentation](https://docs.stackable.tech/home/nightly/concepts/overrides#pod-overrides). + type: object + x-kubernetes-preserve-unknown-fields: true serviceType: description: The method used to access the services. enum: diff --git a/rust/operator-binary/src/listener_controller.rs b/rust/operator-binary/src/listener_controller.rs index 38dd1d3d..9d1a4f6f 100644 --- a/rust/operator-binary/src/listener_controller.rs +++ b/rust/operator-binary/src/listener_controller.rs @@ -17,6 +17,7 @@ use stackable_operator::{ crd::listener, iter::TryFromIterator, k8s_openapi::{ + DeepMerge, api::core::v1::{Endpoints, Node, PersistentVolume, Service, ServicePort, ServiceSpec}, apimachinery::pkg::apis::meta::v1::LabelSelector, }, @@ -348,7 +349,7 @@ pub async fn reconcile( } }; - let svc = Service { + let mut svc = Service { metadata: ObjectMetaBuilder::new() .namespace(ns) .name(&svc_name) @@ -402,6 +403,12 @@ pub async fn reconcile( }), ..Default::default() }; + + // The overrides need to come last! + svc.merge_from(listener_class.spec.service_overrides.clone()); + // Prevent accidental further modification by removing mutability + let svc = svc; + let svc_ref = ObjectRef::from_obj(&svc); let svc = cluster_resources .add(&ctx.client, svc) diff --git a/tests/templates/kuttl/object-overrides/10-assert.yaml.j2 b/tests/templates/kuttl/object-overrides/10-assert.yaml.j2 deleted file mode 100644 index 6321abab..00000000 --- a/tests/templates/kuttl/object-overrides/10-assert.yaml.j2 +++ /dev/null @@ -1,12 +0,0 @@ ---- -apiVersion: v1 -kind: Service -metadata: - name: listener -spec: - type: ClusterIP - ports: - - name: http - port: 80 - # Set by objectOverrides - internalTrafficPolicy: Local diff --git a/tests/templates/kuttl/object-overrides/00-patch-ns.yaml.j2 b/tests/templates/kuttl/overrides/00-patch-ns.yaml.j2 similarity index 100% rename from tests/templates/kuttl/object-overrides/00-patch-ns.yaml.j2 rename to tests/templates/kuttl/overrides/00-patch-ns.yaml.j2 diff --git a/tests/templates/kuttl/overrides/05-create-listenerclass.yaml b/tests/templates/kuttl/overrides/05-create-listenerclass.yaml new file mode 100644 index 00000000..48c97ba5 --- /dev/null +++ b/tests/templates/kuttl/overrides/05-create-listenerclass.yaml @@ -0,0 +1,5 @@ +--- +apiVersion: kuttl.dev/v1beta1 +kind: TestStep +commands: + - script: envsubst '$NAMESPACE' < 05_listenerclass.yaml | kubectl apply -n $NAMESPACE -f - diff --git a/tests/templates/kuttl/overrides/05_listenerclass.yaml.j2 b/tests/templates/kuttl/overrides/05_listenerclass.yaml.j2 new file mode 100644 index 00000000..fba0b55d --- /dev/null +++ b/tests/templates/kuttl/overrides/05_listenerclass.yaml.j2 @@ -0,0 +1,17 @@ +--- +apiVersion: listeners.stackable.tech/v1alpha1 +kind: ListenerClass +metadata: + name: listener-operator-test-overrides-$NAMESPACE +spec: + serviceType: ClusterIP + serviceAnnotations: + deprecated: was here + winner: deprecated + serviceOverrides: + metadata: + annotations: + serviceOverrides: was here + winner: serviceOverrides + spec: + sessionAffinity: ClientIP diff --git a/tests/templates/kuttl/overrides/10-assert.yaml.j2 b/tests/templates/kuttl/overrides/10-assert.yaml.j2 new file mode 100644 index 00000000..77276fb4 --- /dev/null +++ b/tests/templates/kuttl/overrides/10-assert.yaml.j2 @@ -0,0 +1,21 @@ +--- +apiVersion: v1 +kind: Service +metadata: + name: listener + annotations: + deprecated: was here + serviceOverrides: was here + listener: was here + winner: listener +spec: + type: ClusterIP + ports: + - name: http + port: 80 + + # Set by ListenerClass.spec.serviceOverrides + sessionAffinity: ClientIP + + # Set by Listener.spec.objectOverrides + internalTrafficPolicy: Local diff --git a/tests/templates/kuttl/object-overrides/10-create-listener.yaml b/tests/templates/kuttl/overrides/10-create-listener.yaml similarity index 100% rename from tests/templates/kuttl/object-overrides/10-create-listener.yaml rename to tests/templates/kuttl/overrides/10-create-listener.yaml diff --git a/tests/templates/kuttl/object-overrides/10_listener.yaml b/tests/templates/kuttl/overrides/10_listener.yaml similarity index 70% rename from tests/templates/kuttl/object-overrides/10_listener.yaml rename to tests/templates/kuttl/overrides/10_listener.yaml index a7cde261..8fea1c00 100644 --- a/tests/templates/kuttl/object-overrides/10_listener.yaml +++ b/tests/templates/kuttl/overrides/10_listener.yaml @@ -4,7 +4,7 @@ kind: Listener metadata: name: listener spec: - className: cluster-internal + className: listener-operator-test-overrides-$NAMESPACE ports: - name: http port: 80 @@ -14,5 +14,8 @@ spec: metadata: name: listener namespace: $NAMESPACE + annotations: + listener: was here + winner: listener spec: internalTrafficPolicy: Local diff --git a/tests/test-definition.yaml b/tests/test-definition.yaml index 64a49432..fbfd17e3 100644 --- a/tests/test-definition.yaml +++ b/tests/test-definition.yaml @@ -23,7 +23,7 @@ tests: dimensions: - openshift - loadbalancer-allocatenodeports - - name: object-overrides + - name: overrides dimensions: [] suites: - name: nightly From 7d55b0e3b3fd163d0776823092238cda81006d68 Mon Sep 17 00:00:00 2001 From: Sebastian Bernauer Date: Tue, 20 Jan 2026 13:37:14 +0100 Subject: [PATCH 3/4] Update to op-rs 0.104.0 --- Cargo.lock | 16 ++++++++-------- Cargo.nix | 44 ++++++++++++++++++++++---------------------- Cargo.toml | 4 ++-- crate-hashes.json | 14 +++++++------- 4 files changed, 39 insertions(+), 39 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 52fb8b56..d4148d59 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1375,7 +1375,7 @@ dependencies = [ [[package]] name = "k8s-version" version = "0.1.3" -source = "git+https://github.com/stackabletech//operator-rs.git?branch=feat%2Flistener-service-overrides#43556e8d1eb043ff9390e2652941a4a3db9f712f" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.104.0#99ceb14e2466a8928b0075ad21c4aafeb54dcfe0" dependencies = [ "darling 0.23.0", "regex", @@ -2582,8 +2582,8 @@ dependencies = [ [[package]] name = "stackable-operator" -version = "0.103.0" -source = "git+https://github.com/stackabletech//operator-rs.git?branch=feat%2Flistener-service-overrides#43556e8d1eb043ff9390e2652941a4a3db9f712f" +version = "0.104.0" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.104.0#99ceb14e2466a8928b0075ad21c4aafeb54dcfe0" dependencies = [ "chrono", "clap", @@ -2621,7 +2621,7 @@ dependencies = [ [[package]] name = "stackable-operator-derive" version = "0.3.1" -source = "git+https://github.com/stackabletech//operator-rs.git?branch=feat%2Flistener-service-overrides#43556e8d1eb043ff9390e2652941a4a3db9f712f" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.104.0#99ceb14e2466a8928b0075ad21c4aafeb54dcfe0" dependencies = [ "darling 0.23.0", "proc-macro2", @@ -2632,7 +2632,7 @@ dependencies = [ [[package]] name = "stackable-shared" version = "0.0.3" -source = "git+https://github.com/stackabletech//operator-rs.git?branch=feat%2Flistener-service-overrides#43556e8d1eb043ff9390e2652941a4a3db9f712f" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.104.0#99ceb14e2466a8928b0075ad21c4aafeb54dcfe0" dependencies = [ "chrono", "k8s-openapi", @@ -2649,7 +2649,7 @@ dependencies = [ [[package]] name = "stackable-telemetry" version = "0.6.1" -source = "git+https://github.com/stackabletech//operator-rs.git?branch=feat%2Flistener-service-overrides#43556e8d1eb043ff9390e2652941a4a3db9f712f" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.104.0#99ceb14e2466a8928b0075ad21c4aafeb54dcfe0" dependencies = [ "axum", "clap", @@ -2673,7 +2673,7 @@ dependencies = [ [[package]] name = "stackable-versioned" version = "0.8.3" -source = "git+https://github.com/stackabletech//operator-rs.git?branch=feat%2Flistener-service-overrides#43556e8d1eb043ff9390e2652941a4a3db9f712f" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.104.0#99ceb14e2466a8928b0075ad21c4aafeb54dcfe0" dependencies = [ "schemars", "serde", @@ -2686,7 +2686,7 @@ dependencies = [ [[package]] name = "stackable-versioned-macros" version = "0.8.3" -source = "git+https://github.com/stackabletech//operator-rs.git?branch=feat%2Flistener-service-overrides#43556e8d1eb043ff9390e2652941a4a3db9f712f" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.104.0#99ceb14e2466a8928b0075ad21c4aafeb54dcfe0" dependencies = [ "convert_case", "darling 0.23.0", diff --git a/Cargo.nix b/Cargo.nix index 6bc98e02..43e8bf85 100644 --- a/Cargo.nix +++ b/Cargo.nix @@ -4300,9 +4300,9 @@ rec { edition = "2024"; workspace_member = null; src = pkgs.fetchgit { - url = "https://github.com/stackabletech//operator-rs.git"; - rev = "43556e8d1eb043ff9390e2652941a4a3db9f712f"; - sha256 = "14alwgih3775rijylmx5rw9hi8yc98nfam3bfpg4hsl8yhmqbdlq"; + url = "https://github.com/stackabletech/operator-rs.git"; + rev = "99ceb14e2466a8928b0075ad21c4aafeb54dcfe0"; + sha256 = "07cdivnyvrfrznqqm0hqsbvmbng00scv22p39a3wdgfanamjpjsh"; }; libName = "k8s_version"; authors = [ @@ -8549,13 +8549,13 @@ rec { }; "stackable-operator" = rec { crateName = "stackable-operator"; - version = "0.103.0"; + version = "0.104.0"; edition = "2024"; workspace_member = null; src = pkgs.fetchgit { - url = "https://github.com/stackabletech//operator-rs.git"; - rev = "43556e8d1eb043ff9390e2652941a4a3db9f712f"; - sha256 = "14alwgih3775rijylmx5rw9hi8yc98nfam3bfpg4hsl8yhmqbdlq"; + url = "https://github.com/stackabletech/operator-rs.git"; + rev = "99ceb14e2466a8928b0075ad21c4aafeb54dcfe0"; + sha256 = "07cdivnyvrfrznqqm0hqsbvmbng00scv22p39a3wdgfanamjpjsh"; }; libName = "stackable_operator"; authors = [ @@ -8722,9 +8722,9 @@ rec { edition = "2024"; workspace_member = null; src = pkgs.fetchgit { - url = "https://github.com/stackabletech//operator-rs.git"; - rev = "43556e8d1eb043ff9390e2652941a4a3db9f712f"; - sha256 = "14alwgih3775rijylmx5rw9hi8yc98nfam3bfpg4hsl8yhmqbdlq"; + url = "https://github.com/stackabletech/operator-rs.git"; + rev = "99ceb14e2466a8928b0075ad21c4aafeb54dcfe0"; + sha256 = "07cdivnyvrfrznqqm0hqsbvmbng00scv22p39a3wdgfanamjpjsh"; }; procMacro = true; libName = "stackable_operator_derive"; @@ -8757,9 +8757,9 @@ rec { edition = "2024"; workspace_member = null; src = pkgs.fetchgit { - url = "https://github.com/stackabletech//operator-rs.git"; - rev = "43556e8d1eb043ff9390e2652941a4a3db9f712f"; - sha256 = "14alwgih3775rijylmx5rw9hi8yc98nfam3bfpg4hsl8yhmqbdlq"; + url = "https://github.com/stackabletech/operator-rs.git"; + rev = "99ceb14e2466a8928b0075ad21c4aafeb54dcfe0"; + sha256 = "07cdivnyvrfrznqqm0hqsbvmbng00scv22p39a3wdgfanamjpjsh"; }; libName = "stackable_shared"; authors = [ @@ -8839,9 +8839,9 @@ rec { edition = "2024"; workspace_member = null; src = pkgs.fetchgit { - url = "https://github.com/stackabletech//operator-rs.git"; - rev = "43556e8d1eb043ff9390e2652941a4a3db9f712f"; - sha256 = "14alwgih3775rijylmx5rw9hi8yc98nfam3bfpg4hsl8yhmqbdlq"; + url = "https://github.com/stackabletech/operator-rs.git"; + rev = "99ceb14e2466a8928b0075ad21c4aafeb54dcfe0"; + sha256 = "07cdivnyvrfrznqqm0hqsbvmbng00scv22p39a3wdgfanamjpjsh"; }; libName = "stackable_telemetry"; authors = [ @@ -8949,9 +8949,9 @@ rec { edition = "2024"; workspace_member = null; src = pkgs.fetchgit { - url = "https://github.com/stackabletech//operator-rs.git"; - rev = "43556e8d1eb043ff9390e2652941a4a3db9f712f"; - sha256 = "14alwgih3775rijylmx5rw9hi8yc98nfam3bfpg4hsl8yhmqbdlq"; + url = "https://github.com/stackabletech/operator-rs.git"; + rev = "99ceb14e2466a8928b0075ad21c4aafeb54dcfe0"; + sha256 = "07cdivnyvrfrznqqm0hqsbvmbng00scv22p39a3wdgfanamjpjsh"; }; libName = "stackable_versioned"; authors = [ @@ -8993,9 +8993,9 @@ rec { edition = "2024"; workspace_member = null; src = pkgs.fetchgit { - url = "https://github.com/stackabletech//operator-rs.git"; - rev = "43556e8d1eb043ff9390e2652941a4a3db9f712f"; - sha256 = "14alwgih3775rijylmx5rw9hi8yc98nfam3bfpg4hsl8yhmqbdlq"; + url = "https://github.com/stackabletech/operator-rs.git"; + rev = "99ceb14e2466a8928b0075ad21c4aafeb54dcfe0"; + sha256 = "07cdivnyvrfrznqqm0hqsbvmbng00scv22p39a3wdgfanamjpjsh"; }; procMacro = true; libName = "stackable_versioned_macros"; diff --git a/Cargo.toml b/Cargo.toml index 8cf18446..e057e9dd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" repository = "https://github.com/stackabletech/listener-operator" [workspace.dependencies] -stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "stackable-operator-0.102.0", features = ["telemetry", "versioned"] } +stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "stackable-operator-0.104.0", features = ["telemetry", "versioned"] } anyhow = "1.0" built = { version = "0.8", features = ["chrono", "git2"] } @@ -44,4 +44,4 @@ kube = { git = "https://github.com/stackabletech/kube-rs", branch = "2.0.1-fix-s [patch."https://github.com/stackabletech/operator-rs.git"] # stackable-operator = { path = "../operator-rs/crates/stackable-operator" } -stackable-operator = { git = "https://github.com/stackabletech//operator-rs.git", branch = "feat/listener-service-overrides" } +# stackable-operator = { git = "https://github.com/stackabletech//operator-rs.git", branch = "main" } diff --git a/crate-hashes.json b/crate-hashes.json index 7572c62f..3934aee3 100644 --- a/crate-hashes.json +++ b/crate-hashes.json @@ -1,15 +1,15 @@ { - "git+https://github.com/stackabletech//operator-rs.git?branch=feat%2Flistener-service-overrides#k8s-version@0.1.3": "14alwgih3775rijylmx5rw9hi8yc98nfam3bfpg4hsl8yhmqbdlq", - "git+https://github.com/stackabletech//operator-rs.git?branch=feat%2Flistener-service-overrides#stackable-operator-derive@0.3.1": "14alwgih3775rijylmx5rw9hi8yc98nfam3bfpg4hsl8yhmqbdlq", - "git+https://github.com/stackabletech//operator-rs.git?branch=feat%2Flistener-service-overrides#stackable-operator@0.103.0": "14alwgih3775rijylmx5rw9hi8yc98nfam3bfpg4hsl8yhmqbdlq", - "git+https://github.com/stackabletech//operator-rs.git?branch=feat%2Flistener-service-overrides#stackable-shared@0.0.3": "14alwgih3775rijylmx5rw9hi8yc98nfam3bfpg4hsl8yhmqbdlq", - "git+https://github.com/stackabletech//operator-rs.git?branch=feat%2Flistener-service-overrides#stackable-telemetry@0.6.1": "14alwgih3775rijylmx5rw9hi8yc98nfam3bfpg4hsl8yhmqbdlq", - "git+https://github.com/stackabletech//operator-rs.git?branch=feat%2Flistener-service-overrides#stackable-versioned-macros@0.8.3": "14alwgih3775rijylmx5rw9hi8yc98nfam3bfpg4hsl8yhmqbdlq", - "git+https://github.com/stackabletech//operator-rs.git?branch=feat%2Flistener-service-overrides#stackable-versioned@0.8.3": "14alwgih3775rijylmx5rw9hi8yc98nfam3bfpg4hsl8yhmqbdlq", "git+https://github.com/stackabletech/kube-rs?branch=2.0.1-fix-schema-hoisting#kube-client@2.0.1": "1a7bcl0w1jg71jc4iml0vjp8dpzy71mhxl012grxcy2xp5i6xvgf", "git+https://github.com/stackabletech/kube-rs?branch=2.0.1-fix-schema-hoisting#kube-core@2.0.1": "1a7bcl0w1jg71jc4iml0vjp8dpzy71mhxl012grxcy2xp5i6xvgf", "git+https://github.com/stackabletech/kube-rs?branch=2.0.1-fix-schema-hoisting#kube-derive@2.0.1": "1a7bcl0w1jg71jc4iml0vjp8dpzy71mhxl012grxcy2xp5i6xvgf", "git+https://github.com/stackabletech/kube-rs?branch=2.0.1-fix-schema-hoisting#kube-runtime@2.0.1": "1a7bcl0w1jg71jc4iml0vjp8dpzy71mhxl012grxcy2xp5i6xvgf", "git+https://github.com/stackabletech/kube-rs?branch=2.0.1-fix-schema-hoisting#kube@2.0.1": "1a7bcl0w1jg71jc4iml0vjp8dpzy71mhxl012grxcy2xp5i6xvgf", + "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.104.0#k8s-version@0.1.3": "07cdivnyvrfrznqqm0hqsbvmbng00scv22p39a3wdgfanamjpjsh", + "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.104.0#stackable-operator-derive@0.3.1": "07cdivnyvrfrznqqm0hqsbvmbng00scv22p39a3wdgfanamjpjsh", + "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.104.0#stackable-operator@0.104.0": "07cdivnyvrfrznqqm0hqsbvmbng00scv22p39a3wdgfanamjpjsh", + "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.104.0#stackable-shared@0.0.3": "07cdivnyvrfrznqqm0hqsbvmbng00scv22p39a3wdgfanamjpjsh", + "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.104.0#stackable-telemetry@0.6.1": "07cdivnyvrfrznqqm0hqsbvmbng00scv22p39a3wdgfanamjpjsh", + "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.104.0#stackable-versioned-macros@0.8.3": "07cdivnyvrfrznqqm0hqsbvmbng00scv22p39a3wdgfanamjpjsh", + "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.104.0#stackable-versioned@0.8.3": "07cdivnyvrfrznqqm0hqsbvmbng00scv22p39a3wdgfanamjpjsh", "git+https://github.com/stackabletech/product-config.git?tag=0.8.0#product-config@0.8.0": "1dz70kapm2wdqcr7ndyjji0lhsl98bsq95gnb2lw487wf6yr7987" } \ No newline at end of file From 0a428357d48a582f87c65b22105e6628edc03f50 Mon Sep 17 00:00:00 2001 From: Sebastian Bernauer Date: Tue, 20 Jan 2026 13:38:07 +0100 Subject: [PATCH 4/4] changelog --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a8aa3c4e..6c4db551 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ All notable changes to this project will be documented in this file. - Support objectOverrides using `.spec.objectOverrides` on the `Listener`. See [objectOverrides concepts page](https://docs.stackable.tech/home/nightly/concepts/overrides/#object-overrides) for details ([#364]). -- Support serviceOverrides using `.spec.serviceOverrides` on the `ListenerClass` ([#XXX]). +- Support serviceOverrides using `.spec.serviceOverrides` on the `ListenerClass` ([#365]). ### Changed @@ -21,7 +21,7 @@ All notable changes to this project will be documented in this file. [#360]: https://github.com/stackabletech/listener-operator/pull/360 [#363]: https://github.com/stackabletech/listener-operator/pull/363 [#364]: https://github.com/stackabletech/listener-operator/pull/364 -[#XXX]: https://github.com/stackabletech/listener-operator/pull/XXX +[#365]: https://github.com/stackabletech/listener-operator/pull/365 ## [25.11.0] - 2025-11-07