From 91bb8d423e877062c1cceaf0c0e5523f9ad521db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Natalie=20Klestrup=20R=C3=B6ijezon?= Date: Wed, 9 Oct 2024 13:08:06 +0200 Subject: [PATCH 1/3] Add preferred address type field to ListenerClass See https://github.com/stackabletech/listener-operator/issues/139 --- crates/stackable-operator/src/commons/listener.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/crates/stackable-operator/src/commons/listener.rs b/crates/stackable-operator/src/commons/listener.rs index 39b1704ae..7029f1e59 100644 --- a/crates/stackable-operator/src/commons/listener.rs +++ b/crates/stackable-operator/src/commons/listener.rs @@ -63,12 +63,22 @@ pub struct ListenerClassSpec { /// break Local mode (IONOS so far). #[serde(default = "ListenerClassSpec::default_service_external_traffic_policy")] pub service_external_traffic_policy: KubernetesTrafficPolicy, + + /// Whether addresses should prefer using the IP address (`IP`) or the hostname (`Hostname`). + /// + /// The other type will be used if the preferred type is not available. + #[serde(default = "ListenerClassSpec::default_preferred_address_type")] + pub preferred_address_type: AddressType, } impl ListenerClassSpec { const fn default_service_external_traffic_policy() -> KubernetesTrafficPolicy { KubernetesTrafficPolicy::Local } + + const fn default_preferred_address_type() -> AddressType { + AddressType::Hostname + } } /// The method used to access the services. From 0d5255112fa910744782bd67b2d5571d323f8e19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Natalie=20Klestrup=20R=C3=B6ijezon?= Date: Wed, 9 Oct 2024 13:53:32 +0200 Subject: [PATCH 2/3] Changelog --- crates/stackable-operator/CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/stackable-operator/CHANGELOG.md b/crates/stackable-operator/CHANGELOG.md index 7404e2561..d1f938f45 100644 --- a/crates/stackable-operator/CHANGELOG.md +++ b/crates/stackable-operator/CHANGELOG.md @@ -7,6 +7,7 @@ All notable changes to this project will be documented in this file. ### Added - Re-export the `YamlSchema` trait and the `stackable-shared` crate as the `shared` module ([#883]). +- BREAKING: Added `preferredAddressType` field to ListenerClass CRD ([#885]). ### Changed @@ -17,9 +18,10 @@ All notable changes to this project will be documented in this file. - BREAKING: The `CustomResourceExt` trait doesn't provide a `generate_yaml_schema` function any more. Instead, use the high-level functions to write the schema to a file, write it to stdout or - use it as a `String`. + use it as a `String` ([#883]). [#883]: https://github.com/stackabletech/operator-rs/pull/883 +[#885]: https://github.com/stackabletech/operator-rs/pull/885 ## [0.78.0] - 2024-09-30 From 0c26f606153b499a705f862e3bfde4b2507b4138 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Natalie=20Klestrup=20R=C3=B6ijezon?= Date: Wed, 9 Oct 2024 14:05:42 +0200 Subject: [PATCH 3/3] Update crates/stackable-operator/src/commons/listener.rs Co-authored-by: Sebastian Bernauer --- crates/stackable-operator/src/commons/listener.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/stackable-operator/src/commons/listener.rs b/crates/stackable-operator/src/commons/listener.rs index 7029f1e59..d7e590f3a 100644 --- a/crates/stackable-operator/src/commons/listener.rs +++ b/crates/stackable-operator/src/commons/listener.rs @@ -67,6 +67,7 @@ pub struct ListenerClassSpec { /// Whether addresses should prefer using the IP address (`IP`) or the hostname (`Hostname`). /// /// The other type will be used if the preferred type is not available. + /// By default `Hostname` is used. #[serde(default = "ListenerClassSpec::default_preferred_address_type")] pub preferred_address_type: AddressType, }