1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-22 23:09:41 +02:00

fix(app): allow editing pod services [EE-6480] (#10875)

* fix(app): allow editing pod services [EE-6480]
* address review comment

---------

Co-authored-by: testa113 <testa113>
Co-authored-by: prabhat khera <prabhat.khera@portainer.io>
This commit is contained in:
Ali 2024-01-23 10:10:16 +13:00 committed by GitHub
parent 7cba02226e
commit 4c0049edbe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 60 additions and 11 deletions

View file

@ -315,7 +315,12 @@ class KubernetesApplicationHelper {
ports.push(svcport);
});
svc.Ports = ports;
svc.Selector = app.Raw.spec.selector.matchLabels;
// if the app is a pod (doesn't have a selector), then get the pod labels
if (app.Raw.spec.selector) {
svc.Selector = app.Raw.spec.selector.matchLabels;
} else {
svc.Selector = app.Raw.metadata.labels || { app: app.Name };
}
services.push(svc);
}
});