fix(errors): display kube confgimap and secret errors [EE-5558] (#10539)

pull/10529/head
Ali 1 year ago committed by GitHub
parent 3964852fda
commit 6a5f44b5ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -10,7 +10,6 @@ import {
} from '@/portainer/services/notifications';
import { isFulfilled, isRejected } from '@/portainer/helpers/promise-utils';
import { pluralize } from '@/portainer/helpers/strings';
import PortainerError from '@/portainer/error';
import { parseKubernetesAxiosError } from '../axiosError';
@ -122,14 +121,10 @@ async function getConfigMapsForCluster(
environmentId: EnvironmentId,
namespaces: string[]
) {
try {
const configMaps = await Promise.all(
namespaces.map((namespace) => getConfigMaps(environmentId, namespace))
);
return configMaps.flat();
} catch (e) {
throw new PortainerError('Unable to retrieve ConfigMaps', e);
}
const configMaps = await Promise.all(
namespaces.map((namespace) => getConfigMaps(environmentId, namespace))
);
return configMaps.flat();
}
// get all configmaps for a namespace

@ -10,7 +10,6 @@ import {
} from '@/portainer/services/notifications';
import { isFulfilled, isRejected } from '@/portainer/helpers/promise-utils';
import { pluralize } from '@/portainer/helpers/strings';
import PortainerError from '@/portainer/error';
import { parseKubernetesAxiosError } from '../axiosError';
@ -118,14 +117,10 @@ async function getSecretsForCluster(
environmentId: EnvironmentId,
namespaces: string[]
) {
try {
const secrets = await Promise.all(
namespaces.map((namespace) => getSecrets(environmentId, namespace))
);
return secrets.flat();
} catch (e) {
throw new PortainerError('Unable to retrieve secrets for cluster', e);
}
const secrets = await Promise.all(
namespaces.map((namespace) => getSecrets(environmentId, namespace))
);
return secrets.flat();
}
// get all secrets for a namespace

Loading…
Cancel
Save