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:
parent
7cba02226e
commit
4c0049edbe
5 changed files with 60 additions and 11 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue