Skip to content

Commit

Permalink
Cleanup events (#412)
Browse files Browse the repository at this point in the history
  • Loading branch information
olevitt authored Apr 10, 2024
1 parent f50c16c commit 0311aad
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import fr.insee.onyxia.model.project.Project;
import fr.insee.onyxia.model.region.Region;
import fr.insee.onyxia.model.service.*;
import io.fabric8.kubernetes.api.model.EventList;
import io.fabric8.kubernetes.client.KubernetesClient;
import io.fabric8.kubernetes.client.Watcher;
import io.github.inseefrlab.helmwrapper.configuration.HelmConfiguration;
Expand Down Expand Up @@ -485,34 +484,6 @@ private Service getServiceFromRelease(
})
.collect(Collectors.toList()));

EventList eventList = client.v1().events().inNamespace(release.getNamespace()).list();
List<Event> events =
eventList.getItems().stream()
.filter(
event ->
event.getInvolvedObject() != null
&& event.getInvolvedObject().getName() != null
&& event.getInvolvedObject()
.getName()
.contains(release.getName()))
.map(
event -> {
Event newEvent = new Event();
newEvent.setMessage(event.getMessage());
try {
// TODO : use kubernetes time format instead of helm
newEvent.setTimestamp(
helmDateFormat
.parse(event.getEventTime().getTime())
.getTime());
} catch (Exception e) {

}
return newEvent;
})
.collect(Collectors.toList());
service.setEvents(events);

return service;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ public class Service {
@Schema(description = "Task represents pods running. This should be re-ingeneer in v1.0")
private List<Task> tasks = new ArrayList<>();

@Schema(description = "This should be re-ingeneer in v1.0")
private List<Event> events = new ArrayList<>();

@Schema(description = "This should be removed in v1.0")
private String subtitle;

Expand Down Expand Up @@ -181,14 +178,6 @@ public void setSubtitle(String subtitle) {
this.subtitle = subtitle;
}

public List<Event> getEvents() {
return events;
}

public void setEvents(List<Event> events) {
this.events = events;
}

public List<String> getInternalUrls() {
return internalUrls;
}
Expand Down

0 comments on commit 0311aad

Please sign in to comment.