Skip to content

Commit

Permalink
Add preferred address type field to ListenerClass
Browse files Browse the repository at this point in the history
  • Loading branch information
nightkr committed Oct 9, 2024
1 parent 194d33e commit 91bb8d4
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 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,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.
Expand Down

0 comments on commit 91bb8d4

Please sign in to comment.