fix(kuberenetes/deploy): use default resource pool (#4674)

pull/4834/head
Chaim Lev-Ari 2021-03-23 00:35:17 +02:00 committed by GitHub
parent 572b64b68e
commit c542964073
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 1 deletions

View File

@ -66,7 +66,17 @@ class KubernetesDeployController {
async getNamespacesAsync() {
try {
const pools = await this.KubernetesResourcePoolService.get();
this.namespaces = _.map(pools, 'Namespace');
const namespaces = _.map(pools, 'Namespace').sort((a, b) => {
if (a.Name === 'default') {
return -1;
}
if (b.Name === 'default') {
return 1;
}
return 0;
});
this.namespaces = namespaces;
this.formValues.Namespace = this.namespaces[0].Name;
} catch (err) {
this.Notifications.error('Failure', err, 'Unable to load resource pools data');