mirror of
https://github.com/portainer/portainer.git
synced 2025-07-25 08:19:40 +02:00
feat(k8s/applications): add pod as new application type for apps list
This commit is contained in:
parent
ccea7cca3d
commit
3da9751c82
15 changed files with 96 additions and 35 deletions
|
@ -38,8 +38,8 @@ class KubernetesApplicationHelper {
|
|||
return !application.ApplicationOwner;
|
||||
}
|
||||
|
||||
static associatePodsAndApplication(pods, app) {
|
||||
return _.filter(pods, { Labels: app.spec.selector.matchLabels });
|
||||
static associatePodsAndApplication(pods, selector) {
|
||||
return _.filter(pods, ['metadata.labels', selector.matchLabels]);
|
||||
}
|
||||
|
||||
static associateContainerPersistedFoldersAndConfigurations(app, containers) {
|
||||
|
|
|
@ -20,7 +20,7 @@ class KubernetesApplicationRollbackHelper {
|
|||
result = KubernetesApplicationRollbackHelper._getStatefulSetPayload(application, targetRevision);
|
||||
break;
|
||||
default:
|
||||
throw new PortainerError('Unable to determine which association to use');
|
||||
throw new PortainerError('Unable to determine which association to use to convert patch');
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ class KubernetesHistoryHelper {
|
|||
[currentRevision, revisionsList] = KubernetesHistoryHelper._getStatefulSetRevisions(rawRevisions, application.Raw);
|
||||
break;
|
||||
default:
|
||||
throw new PortainerError('Unable to determine which association to use');
|
||||
throw new PortainerError('Unable to determine which association to use to get revisions');
|
||||
}
|
||||
revisionsList = _.sortBy(revisionsList, 'revision');
|
||||
return [currentRevision, revisionsList];
|
||||
|
|
|
@ -7,6 +7,9 @@ class KubernetesServiceHelper {
|
|||
}
|
||||
|
||||
static findApplicationBoundService(services, rawApp) {
|
||||
if (!rawApp.spec.template) {
|
||||
return undefined;
|
||||
}
|
||||
return _.find(services, (item) => item.spec.selector && _.isMatch(rawApp.spec.template.metadata.labels, item.spec.selector));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue