1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-21 22:39:41 +02:00

fix(kube): updated kube terminology for configmaps/secrets [EE-4816] (#8770)

This commit is contained in:
Matt Hook 2023-05-16 09:21:50 +12:00 committed by GitHub
parent 8fa49d47f4
commit 0743f26ab8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 38 additions and 25 deletions

View file

@ -87,6 +87,11 @@ class KubernetesConfigurationController {
// It looks like we're still doing a create/delete process but we've decided to get rid of this
// approach.
async updateConfigurationAsync() {
let kind = 'ConfigMap';
if (this.formValues.Kind === KubernetesConfigurationKinds.SECRET) {
kind = 'Secret';
}
try {
this.state.actionInProgress = true;
if (
@ -96,7 +101,7 @@ class KubernetesConfigurationController {
) {
await this.KubernetesConfigurationService.create(this.formValues);
await this.KubernetesConfigurationService.delete(this.configuration);
this.Notifications.success('Success', 'Configuration succesfully updated');
this.Notifications.success('Success', `${kind} successfully updated`);
this.$state.go(
'kubernetes.configurations.configuration',
{
@ -107,11 +112,11 @@ class KubernetesConfigurationController {
);
} else {
await this.KubernetesConfigurationService.update(this.formValues, this.configuration);
this.Notifications.success('Success', 'Configuration succesfully updated');
this.Notifications.success('Success', `${kind} successfully updated`);
this.$state.reload(this.$state.current);
}
} catch (err) {
this.Notifications.error('Failure', err, 'Unable to update configuration');
this.Notifications.error('Failure', err, `Unable to update ${kind}`);
} finally {
this.state.actionInProgress = false;
}
@ -120,8 +125,9 @@ class KubernetesConfigurationController {
updateConfiguration() {
if (this.configuration.Used) {
const plural = this.configuration.Applications.length > 1 ? 's' : '';
const thisorthese = this.configuration.Applications.length > 1 ? 'these' : 'this';
confirmUpdate(
`The changes will be propagated to ${this.configuration.Applications.length} running application${plural}. Are you sure you want to update this configuration?`,
`The changes will be propagated to ${this.configuration.Applications.length} running application${plural}. Are you sure you want to update ${thisorthese} ConfigMap${plural} or Secret${plural}?`,
(confirmed) => {
if (confirmed) {
return this.$async(this.updateConfigurationAsync);