fix error when edit pod application (#6418)

pull/6432/head
Richard Wei 2022-01-20 08:21:03 +13:00 committed by GitHub
parent 50b2f789a3
commit a79aa221d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 46 additions and 42 deletions

View File

@ -279,6 +279,7 @@ class KubernetesApplicationHelper {
/* #region SERVICES -> SERVICES FORM VALUES */
static generateServicesFormValuesFromServices(app) {
let services = [];
if (app.Services) {
app.Services.forEach(function (service) {
const svc = new KubernetesService();
svc.Namespace = service.metadata.namespace;
@ -325,11 +326,14 @@ class KubernetesApplicationHelper {
return services;
}
}
/* #endregion */
static generateSelectorFromService(app) {
if (app.Raw.kind !== 'Pod') {
const selector = app.Raw.spec.selector.matchLabels;
return selector;
}
}
/* #region PUBLISHED PORTS FV <> PUBLISHED PORTS */
static generatePublishedPortsFormValuesFromPublishedPorts(serviceType, publishedPorts, ingress) {