Skip to content

Commit

Permalink
fix(resource-limits-plugin): fixed zero values saving for resource qu…
Browse files Browse the repository at this point in the history
…otas (bwsw#1602)
  • Loading branch information
dron8552 committed Mar 4, 2019
1 parent bdfd7d0 commit 954bda7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/app/resource-quotas/services/resource-quota.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import { configSelectors, State } from '../../root-store';
import { switchMap } from 'rxjs/operators';
import { ResourceLimit } from '../../shared/models';

const isNumber = require('lodash/isNumber');

@Injectable()
export class ResourceQuotaService {
readonly pluginConfig$ = this.store.pipe(select(configSelectors.get('resourceLimits')));
Expand All @@ -29,10 +31,10 @@ export class ResourceQuotaService {
}[],
): Observable<ResourceQuota[]> {
const params = resourceQuotas.reduce((memo, { resourceType, minimum, maximum }) => {
if (minimum) {
if (isNumber(minimum)) {
memo[`minimum${resourceType}`] = minimum;
}
if (maximum) {
if (isNumber(maximum)) {
memo[`maximum${resourceType}`] = maximum;
}
return memo;
Expand Down

0 comments on commit 954bda7

Please sign in to comment.