mirror of
https://github.com/portainer/portainer.git
synced 2025-07-25 16:29:44 +02:00
fix(errors): display kube confgimap and secret errors [EE-5558] (#10539)
This commit is contained in:
parent
3964852fda
commit
6a5f44b5ba
2 changed files with 8 additions and 18 deletions
|
@ -10,7 +10,6 @@ import {
|
||||||
} from '@/portainer/services/notifications';
|
} from '@/portainer/services/notifications';
|
||||||
import { isFulfilled, isRejected } from '@/portainer/helpers/promise-utils';
|
import { isFulfilled, isRejected } from '@/portainer/helpers/promise-utils';
|
||||||
import { pluralize } from '@/portainer/helpers/strings';
|
import { pluralize } from '@/portainer/helpers/strings';
|
||||||
import PortainerError from '@/portainer/error';
|
|
||||||
|
|
||||||
import { parseKubernetesAxiosError } from '../axiosError';
|
import { parseKubernetesAxiosError } from '../axiosError';
|
||||||
|
|
||||||
|
@ -122,14 +121,10 @@ async function getConfigMapsForCluster(
|
||||||
environmentId: EnvironmentId,
|
environmentId: EnvironmentId,
|
||||||
namespaces: string[]
|
namespaces: string[]
|
||||||
) {
|
) {
|
||||||
try {
|
const configMaps = await Promise.all(
|
||||||
const configMaps = await Promise.all(
|
namespaces.map((namespace) => getConfigMaps(environmentId, namespace))
|
||||||
namespaces.map((namespace) => getConfigMaps(environmentId, namespace))
|
);
|
||||||
);
|
return configMaps.flat();
|
||||||
return configMaps.flat();
|
|
||||||
} catch (e) {
|
|
||||||
throw new PortainerError('Unable to retrieve ConfigMaps', e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// get all configmaps for a namespace
|
// get all configmaps for a namespace
|
||||||
|
|
|
@ -10,7 +10,6 @@ import {
|
||||||
} from '@/portainer/services/notifications';
|
} from '@/portainer/services/notifications';
|
||||||
import { isFulfilled, isRejected } from '@/portainer/helpers/promise-utils';
|
import { isFulfilled, isRejected } from '@/portainer/helpers/promise-utils';
|
||||||
import { pluralize } from '@/portainer/helpers/strings';
|
import { pluralize } from '@/portainer/helpers/strings';
|
||||||
import PortainerError from '@/portainer/error';
|
|
||||||
|
|
||||||
import { parseKubernetesAxiosError } from '../axiosError';
|
import { parseKubernetesAxiosError } from '../axiosError';
|
||||||
|
|
||||||
|
@ -118,14 +117,10 @@ async function getSecretsForCluster(
|
||||||
environmentId: EnvironmentId,
|
environmentId: EnvironmentId,
|
||||||
namespaces: string[]
|
namespaces: string[]
|
||||||
) {
|
) {
|
||||||
try {
|
const secrets = await Promise.all(
|
||||||
const secrets = await Promise.all(
|
namespaces.map((namespace) => getSecrets(environmentId, namespace))
|
||||||
namespaces.map((namespace) => getSecrets(environmentId, namespace))
|
);
|
||||||
);
|
return secrets.flat();
|
||||||
return secrets.flat();
|
|
||||||
} catch (e) {
|
|
||||||
throw new PortainerError('Unable to retrieve secrets for cluster', e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// get all secrets for a namespace
|
// get all secrets for a namespace
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue