fix(frontend): cannnot access configuration details view containing binary data (#4503) (#4561)

Co-authored-by: Simon Meng <simon.meng@portainer.io>
pull/3937/head
cong meng 4 years ago committed by GitHub
parent 9136ba30eb
commit aa5277de2e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -24,8 +24,11 @@ class KubernetesConfigMapService {
try { try {
const params = new KubernetesCommonParams(); const params = new KubernetesCommonParams();
params.id = name; params.id = name;
const [raw, yaml] = await Promise.all([this.KubernetesConfigMaps(namespace).get(params).$promise, this.KubernetesConfigMaps(namespace).getYaml(params).$promise]); const [rawPromise, yamlPromise] = await Promise.allSettled([
const configMap = KubernetesConfigMapConverter.apiToConfigMap(raw, yaml); this.KubernetesConfigMaps(namespace).get(params).$promise,
this.KubernetesConfigMaps(namespace).getYaml(params).$promise,
]);
const configMap = KubernetesConfigMapConverter.apiToConfigMap(rawPromise.value, yamlPromise.value);
return configMap; return configMap;
} catch (err) { } catch (err) {
if (err.status === 404) { if (err.status === 404) {

Loading…
Cancel
Save