|
|
@ -237,7 +237,6 @@ class KubernetesApplicationService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (service) {
|
|
|
|
if (service) {
|
|
|
|
await this.KubernetesServiceService.create(service);
|
|
|
|
|
|
|
|
if (formValues.PublishingType === KubernetesApplicationPublishingTypes.INGRESS) {
|
|
|
|
if (formValues.PublishingType === KubernetesApplicationPublishingTypes.INGRESS) {
|
|
|
|
const ingresses = KubernetesIngressConverter.applicationFormValuesToIngresses(formValues, service.Name);
|
|
|
|
const ingresses = KubernetesIngressConverter.applicationFormValuesToIngresses(formValues, service.Name);
|
|
|
|
await Promise.all(this._generateIngressPatchPromises(formValues.OriginalIngresses, ingresses));
|
|
|
|
await Promise.all(this._generateIngressPatchPromises(formValues.OriginalIngresses, ingresses));
|
|
|
@ -281,19 +280,24 @@ class KubernetesApplicationService {
|
|
|
|
* in this method should also be displayed in the summary output (getUpdatedApplicationResources)
|
|
|
|
* in this method should also be displayed in the summary output (getUpdatedApplicationResources)
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
async patchAsync(oldFormValues, newFormValues) {
|
|
|
|
async patchAsync(oldFormValues, newFormValues) {
|
|
|
|
const [oldApp, oldHeadlessService, oldServices, oldService, oldClaims] = KubernetesApplicationConverter.applicationFormValuesToApplication(oldFormValues);
|
|
|
|
const [oldApp, oldHeadlessService, oldServices, , oldClaims] = KubernetesApplicationConverter.applicationFormValuesToApplication(oldFormValues);
|
|
|
|
const [newApp, newHeadlessService, newServices, newService, newClaims] = KubernetesApplicationConverter.applicationFormValuesToApplication(newFormValues);
|
|
|
|
const [newApp, newHeadlessService, newServices, , newClaims] = KubernetesApplicationConverter.applicationFormValuesToApplication(newFormValues);
|
|
|
|
const oldApiService = this._getApplicationApiService(oldApp);
|
|
|
|
const oldApiService = this._getApplicationApiService(oldApp);
|
|
|
|
const newApiService = this._getApplicationApiService(newApp);
|
|
|
|
const newApiService = this._getApplicationApiService(newApp);
|
|
|
|
|
|
|
|
|
|
|
|
if (oldApiService !== newApiService) {
|
|
|
|
if (oldApiService !== newApiService) {
|
|
|
|
await this.delete(oldApp);
|
|
|
|
// delete services first
|
|
|
|
if (oldService) {
|
|
|
|
if (oldServices) {
|
|
|
|
await this.KubernetesServiceService.delete(oldService);
|
|
|
|
await this.KubernetesServiceService.delete(oldServices);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (newService) {
|
|
|
|
|
|
|
|
return '';
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// delete the app
|
|
|
|
|
|
|
|
await this.delete(oldApp);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// sleep for 5 seconds to allow the app/services to be deleted
|
|
|
|
|
|
|
|
await new Promise((r) => setTimeout(r, 5000));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// create the app
|
|
|
|
return await this.create(newFormValues);
|
|
|
|
return await this.create(newFormValues);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|