1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-21 06:19:41 +02:00

fix(apps): don't delete the 'kubernetes' service or duplicate service names [r8s-124] (#90)

This commit is contained in:
Ali 2024-11-11 08:26:56 +13:00 committed by GitHub
parent e9fc6d5598
commit cd8c6d1ce0
2 changed files with 8 additions and 12 deletions

View file

@ -341,7 +341,7 @@ func updateApplicationWithService(application *models.K8sApplication, services [
for _, service := range services {
serviceSelector := labels.SelectorFromSet(service.Spec.Selector)
if service.Namespace == application.ResourcePool && serviceSelector.Matches(labels.Set(application.MatchLabels)) {
if service.Namespace == application.ResourcePool && !serviceSelector.Empty() && serviceSelector.Matches(labels.Set(application.MatchLabels)) {
application.ServiceType = string(service.Spec.Type)
application.Services = append(application.Services, service)
}