mirror of
https://github.com/portainer/portainer.git
synced 2025-08-04 21:35:23 +02:00
refactor(app): migrate app summary section [EE-6239] (#10910)
Some checks are pending
ci / build_images (map[arch:amd64 platform:linux]) (push) Waiting to run
ci / build_images (map[arch:amd64 platform:windows version:1809]) (push) Waiting to run
ci / build_images (map[arch:amd64 platform:windows version:ltsc2022]) (push) Waiting to run
ci / build_images (map[arch:arm64 platform:linux]) (push) Waiting to run
ci / build_manifests (push) Blocked by required conditions
/ triage (push) Waiting to run
Lint / Run linters (push) Waiting to run
Test / test-client (push) Waiting to run
Test / test-server (map[arch:amd64 platform:linux]) (push) Waiting to run
Test / test-server (map[arch:amd64 platform:windows version:1809]) (push) Waiting to run
Test / test-server (map[arch:amd64 platform:windows version:ltsc2022]) (push) Waiting to run
Test / test-server (map[arch:arm64 platform:linux]) (push) Waiting to run
Some checks are pending
ci / build_images (map[arch:amd64 platform:linux]) (push) Waiting to run
ci / build_images (map[arch:amd64 platform:windows version:1809]) (push) Waiting to run
ci / build_images (map[arch:amd64 platform:windows version:ltsc2022]) (push) Waiting to run
ci / build_images (map[arch:arm64 platform:linux]) (push) Waiting to run
ci / build_manifests (push) Blocked by required conditions
/ triage (push) Waiting to run
Lint / Run linters (push) Waiting to run
Test / test-client (push) Waiting to run
Test / test-server (map[arch:amd64 platform:linux]) (push) Waiting to run
Test / test-server (map[arch:amd64 platform:windows version:1809]) (push) Waiting to run
Test / test-server (map[arch:amd64 platform:windows version:ltsc2022]) (push) Waiting to run
Test / test-server (map[arch:arm64 platform:linux]) (push) Waiting to run
This commit is contained in:
parent
7a4314032a
commit
abf517de28
61 changed files with 1461 additions and 661 deletions
|
@ -3,7 +3,6 @@ import * as JsonPatch from 'fast-json-patch';
|
|||
|
||||
import { KubernetesServiceCreatePayload } from 'Kubernetes/models/service/payloads';
|
||||
import {
|
||||
KubernetesApplicationPublishingTypes,
|
||||
KubernetesPortainerApplicationNameLabel,
|
||||
KubernetesPortainerApplicationOwnerLabel,
|
||||
KubernetesPortainerApplicationStackNameLabel,
|
||||
|
@ -42,11 +41,7 @@ class KubernetesServiceConverter {
|
|||
res.StackName = formValues.StackName ? formValues.StackName : formValues.Name;
|
||||
res.ApplicationOwner = formValues.ApplicationOwner;
|
||||
res.ApplicationName = formValues.Name;
|
||||
if (formValues.PublishingType === KubernetesApplicationPublishingTypes.NODE_PORT) {
|
||||
res.Type = KubernetesServiceTypes.NODE_PORT;
|
||||
} else if (formValues.PublishingType === KubernetesApplicationPublishingTypes.LOAD_BALANCER) {
|
||||
res.Type = KubernetesServiceTypes.LOAD_BALANCER;
|
||||
}
|
||||
res.Type = formValues.PublishingType;
|
||||
const ports = _.map(formValues.PublishedPorts, (item) => _publishedPortToServicePort(formValues, item, res.Type));
|
||||
res.Ports = _.uniqBy(_.without(ports, undefined), (p) => p.targetPort + p.protocol);
|
||||
return res;
|
||||
|
@ -61,13 +56,7 @@ class KubernetesServiceConverter {
|
|||
res.StackName = formValues.StackName ? formValues.StackName : formValues.Name;
|
||||
res.ApplicationOwner = formValues.ApplicationOwner;
|
||||
res.ApplicationName = formValues.Name;
|
||||
if (service.Type === KubernetesApplicationPublishingTypes.NODE_PORT) {
|
||||
res.Type = KubernetesServiceTypes.NODE_PORT;
|
||||
} else if (service.Type === KubernetesApplicationPublishingTypes.LOAD_BALANCER) {
|
||||
res.Type = KubernetesServiceTypes.LOAD_BALANCER;
|
||||
} else if (service.Type === KubernetesApplicationPublishingTypes.CLUSTER_IP) {
|
||||
res.Type = KubernetesServiceTypes.CLUSTER_IP;
|
||||
}
|
||||
res.Type = service.Type;
|
||||
res.Ingress = service.Ingress;
|
||||
|
||||
if (service.Selector !== undefined) {
|
||||
|
@ -120,18 +109,7 @@ class KubernetesServiceConverter {
|
|||
payload.metadata.labels[KubernetesPortainerApplicationNameLabel] = service.ApplicationName;
|
||||
payload.metadata.labels[KubernetesPortainerApplicationOwnerLabel] = service.ApplicationOwner;
|
||||
|
||||
const ports = [];
|
||||
service.Ports.forEach((port) => {
|
||||
const p = {};
|
||||
p.name = port.name;
|
||||
p.port = port.port;
|
||||
p.nodePort = port.nodePort;
|
||||
p.protocol = port.protocol;
|
||||
p.targetPort = port.targetPort;
|
||||
ports.push(p);
|
||||
});
|
||||
payload.spec.ports = ports;
|
||||
|
||||
payload.spec.ports = service.Ports;
|
||||
payload.spec.selector = service.Selector;
|
||||
if (service.Headless) {
|
||||
payload.spec.clusterIP = KubernetesServiceHeadlessClusterIP;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue