Skip to content

Commit

Permalink
Add preferred address type field to ListenerClass (#885)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>

---------

Co-authored-by: Sebastian Bernauer <[email protected]>
  • Loading branch information
nightkr and sbernauer authored Oct 16, 2024
1 parent 244eda7 commit d51e8a7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
4 changes: 3 additions & 1 deletion crates/stackable-operator/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down
11 changes: 11 additions & 0 deletions crates/stackable-operator/src/commons/listener.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,23 @@ 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.
/// By default `Hostname` is used.
#[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.
Expand Down

0 comments on commit d51e8a7

Please sign in to comment.