Skip to content

Commit d51e8a7

Browse files
nightkrsbernauer
andauthored
Add preferred address type field to ListenerClass (#885)
* Add preferred address type field to ListenerClass See stackabletech/listener-operator#139 * Changelog * Update crates/stackable-operator/src/commons/listener.rs Co-authored-by: Sebastian Bernauer <sebastian.bernauer@stackable.de> --------- Co-authored-by: Sebastian Bernauer <sebastian.bernauer@stackable.de>
1 parent 244eda7 commit d51e8a7

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

crates/stackable-operator/CHANGELOG.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ All notable changes to this project will be documented in this file.
77
### Added
88

99
- Re-export the `YamlSchema` trait and the `stackable-shared` crate as the `shared` module ([#883]).
10+
- BREAKING: Added `preferredAddressType` field to ListenerClass CRD ([#885]).
1011

1112
### Changed
1213

@@ -17,9 +18,10 @@ All notable changes to this project will be documented in this file.
1718

1819
- BREAKING: The `CustomResourceExt` trait doesn't provide a `generate_yaml_schema` function any
1920
more. Instead, use the high-level functions to write the schema to a file, write it to stdout or
20-
use it as a `String`.
21+
use it as a `String` ([#883]).
2122

2223
[#883]: https://github.com/stackabletech/operator-rs/pull/883
24+
[#885]: https://github.com/stackabletech/operator-rs/pull/885
2325

2426
## [0.78.0] - 2024-09-30
2527

crates/stackable-operator/src/commons/listener.rs

+11
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,23 @@ pub struct ListenerClassSpec {
6363
/// break Local mode (IONOS so far).
6464
#[serde(default = "ListenerClassSpec::default_service_external_traffic_policy")]
6565
pub service_external_traffic_policy: KubernetesTrafficPolicy,
66+
67+
/// Whether addresses should prefer using the IP address (`IP`) or the hostname (`Hostname`).
68+
///
69+
/// The other type will be used if the preferred type is not available.
70+
/// By default `Hostname` is used.
71+
#[serde(default = "ListenerClassSpec::default_preferred_address_type")]
72+
pub preferred_address_type: AddressType,
6673
}
6774

6875
impl ListenerClassSpec {
6976
const fn default_service_external_traffic_policy() -> KubernetesTrafficPolicy {
7077
KubernetesTrafficPolicy::Local
7178
}
79+
80+
const fn default_preferred_address_type() -> AddressType {
81+
AddressType::Hostname
82+
}
7283
}
7384

7485
/// The method used to access the services.

0 commit comments

Comments
 (0)