fix(app): single delete config or secret [EE-5078] (#9069)

Co-authored-by: testa113 <testa113>
pull/9073/head
Ali 1 year ago committed by GitHub
parent 2ac70b1eb6
commit 9d3f13ac92
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -29,7 +29,7 @@ class KubernetesDaemonSetConverter {
res.MemoryLimit = KubernetesResourceReservationHelper.bytesValue(formValues.MemoryLimit);
res.Env = KubernetesApplicationHelper.generateEnvFromEnvVariables(formValues.EnvironmentVariables);
KubernetesApplicationHelper.generateVolumesFromPersistentVolumClaims(res, volumeClaims);
KubernetesApplicationHelper.generateEnvOrVolumesFromConfigurations(res, formValues.Configurations);
KubernetesApplicationHelper.generateEnvOrVolumesFromConfigurations(res, formValues.ConfigMaps, formValues.Secrets);
KubernetesApplicationHelper.generateAffinityFromPlacements(res, formValues);
return res;
}

@ -32,7 +32,7 @@ class KubernetesDeploymentConverter {
res.Env = KubernetesApplicationHelper.generateEnvFromEnvVariables(formValues.EnvironmentVariables);
res.Containers = formValues.Containers;
KubernetesApplicationHelper.generateVolumesFromPersistentVolumClaims(res, volumeClaims);
KubernetesApplicationHelper.generateEnvOrVolumesFromConfigurations(res, formValues.Configurations);
KubernetesApplicationHelper.generateEnvOrVolumesFromConfigurations(res, formValues.ConfigMaps, formValues.Secrets);
KubernetesApplicationHelper.generateAffinityFromPlacements(res, formValues);
return res;
}

@ -33,7 +33,7 @@ class KubernetesStatefulSetConverter {
res.MemoryLimit = KubernetesResourceReservationHelper.bytesValue(formValues.MemoryLimit);
res.Env = KubernetesApplicationHelper.generateEnvFromEnvVariables(formValues.EnvironmentVariables);
KubernetesApplicationHelper.generateVolumesFromPersistentVolumClaims(res, volumeClaims);
KubernetesApplicationHelper.generateEnvOrVolumesFromConfigurations(res, formValues.Configurations);
KubernetesApplicationHelper.generateEnvOrVolumesFromConfigurations(res, formValues.ConfigMaps, formValues.Secrets);
KubernetesApplicationHelper.generateAffinityFromPlacements(res, formValues);
return res;
}

@ -199,7 +199,8 @@ class KubernetesApplicationHelper {
return _.without(finalRes, undefined);
}
static generateEnvOrVolumesFromConfigurations(app, configurations) {
static generateEnvOrVolumesFromConfigurations(app, configMaps, secrets) {
const configurations = [...configMaps, ...secrets];
let finalEnv = [];
let finalVolumes = [];
let finalMounts = [];

@ -1112,7 +1112,6 @@ class KubernetesCreateApplicationController {
try {
this.formValues.ApplicationOwner = this.Authentication.getUserDetails().username;
// combine the secrets and configmap form values when submitting the form
this.formValues.Configurations = [...this.formValues.ConfigMaps, ...this.formValues.Secrets];
_.remove(this.formValues.Configurations, (item) => item.SelectedConfiguration === undefined);
await this.KubernetesApplicationService.create(this.formValues);
this.Notifications.success('Request to deploy application successfully submitted', this.formValues.Name);
@ -1136,7 +1135,6 @@ class KubernetesCreateApplicationController {
try {
this.state.actionInProgress = true;
this.formValues.Configurations = [...this.formValues.ConfigMaps, ...this.formValues.Secrets];
await this.KubernetesApplicationService.patch(this.savedFormValues, this.formValues);
this.Notifications.success('Success', 'Request to update application successfully submitted');
this.$state.go('kubernetes.applications.application', { name: this.application.Name, namespace: this.application.ResourcePool });

Loading…
Cancel
Save