From 68c2e83182aaa768224016f0e91797feee4c9c1b Mon Sep 17 00:00:00 2001 From: yehiyam Date: Tue, 23 Nov 2021 15:23:40 +0200 Subject: [PATCH] apply resources to pipeline driver (#1458) --- core/algorithm-operator/lib/jobs/jobCreator.js | 2 +- core/algorithm-operator/tests/pipeline-drivers.js | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/core/algorithm-operator/lib/jobs/jobCreator.js b/core/algorithm-operator/lib/jobs/jobCreator.js index 9d5341fe7..f3fc5023f 100644 --- a/core/algorithm-operator/lib/jobs/jobCreator.js +++ b/core/algorithm-operator/lib/jobs/jobCreator.js @@ -38,7 +38,7 @@ const createDriverJobSpec = ({ resourceRequests, image, inputEnv, clusterOptions spec = applyName(spec, CONTAINERS.PIPELINE_DRIVER); spec = applyPipelineDriverImage(spec, image); spec = applyEnvToContainer(spec, CONTAINERS.PIPELINE_DRIVER, inputEnv); - if (settings.applyResources) { + if (settings.applyResourceLimits) { spec = applyPipelineDriverResourceRequests(spec, resourceRequests); } spec = applyJaeger(spec, CONTAINERS.PIPELINE_DRIVER, options); diff --git a/core/algorithm-operator/tests/pipeline-drivers.js b/core/algorithm-operator/tests/pipeline-drivers.js index b72e4f7f7..d7d22b770 100644 --- a/core/algorithm-operator/tests/pipeline-drivers.js +++ b/core/algorithm-operator/tests/pipeline-drivers.js @@ -342,7 +342,10 @@ describe('bootstrap', () => { }); describe('createDriverJobSpec', () => { beforeEach(() => { - globalSettings.applyResources = false; + globalSettings.applyResourceLimits = false; + }); + after(() => { + globalSettings.applyResourceLimits = false; }); it('should throw if no image name', () => { expect(() => createDriverJobSpec({ options })).to.throw('Unable to create job spec. image is required'); @@ -358,7 +361,7 @@ describe('bootstrap', () => { expect(res.metadata.name).to.include(CONTAINERS.PIPELINE_DRIVER); }); it('should apply resources', () => { - globalSettings.applyResources = true; + globalSettings.applyResourceLimits = true; const res = createDriverJobSpec({ ...{ options }, image: 'myImage1',