Skip to content

Commit

Permalink
apply resources to pipeline driver (#1458)
Browse files Browse the repository at this point in the history
  • Loading branch information
yehiyam authored Nov 23, 2021
1 parent d341706 commit 68c2e83
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion core/algorithm-operator/lib/jobs/jobCreator.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
7 changes: 5 additions & 2 deletions core/algorithm-operator/tests/pipeline-drivers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -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',
Expand Down

0 comments on commit 68c2e83

Please sign in to comment.