Skip to content

Commit

Permalink
Add conditions to Endpoints part of the EndpointSlices reflecting wad…
Browse files Browse the repository at this point in the history
…m application Service entries
  • Loading branch information
joonas committed Apr 25, 2024
1 parent 4804546 commit 8b30620
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/services.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use async_nats::{
use cloudevents::{AttributesReader, Event as CloudEvent};
use futures::StreamExt;
use k8s_openapi::api::core::v1::{Pod, Service, ServicePort, ServiceSpec};
use k8s_openapi::api::discovery::v1::{Endpoint, EndpointPort, EndpointSlice};
use k8s_openapi::api::discovery::v1::{Endpoint, EndpointConditions, EndpointPort, EndpointSlice};
use k8s_openapi::apimachinery::pkg::apis::meta::v1::OwnerReference;
use kube::{
api::{Api, DeleteParams, ListParams, Patch, PatchParams},
Expand Down Expand Up @@ -522,6 +522,11 @@ pub async fn create_or_update_service(
.filter_map(|ip| {
ip.ip.as_ref().map(|i| Endpoint {
addresses: vec![i.clone()],
conditions: Some(EndpointConditions {
ready: Some(true),
serving: Some(true),
terminating: None,
}),
hostname: None,
target_ref: None,
..Default::default()
Expand Down

0 comments on commit 8b30620

Please sign in to comment.