1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-21 14:29:40 +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

@ -14,10 +14,12 @@ class KubernetesServiceHelper {
}
static findApplicationBoundServices(services, rawApp) {
if (!rawApp.spec.template) {
// if the app is a naked pod (doesn't have a template), then get the pod labels
const appLabels = rawApp.spec.template ? rawApp.spec.template.metadata.labels : rawApp.metadata.labels;
if (!appLabels) {
return undefined;
}
return _.filter(services, (item) => item.spec.selector && _.isMatch(rawApp.spec.template.metadata.labels, item.spec.selector));
return _.filter(services, (item) => item.spec.selector && _.isMatch(appLabels, item.spec.selector));
}
}
export default KubernetesServiceHelper;