Skip to content
This repository has been archived by the owner on Sep 6, 2024. It is now read-only.

Commit

Permalink
Do not default disk label
Browse files Browse the repository at this point in the history
  • Loading branch information
Filbird committed Sep 12, 2018
1 parent 043511c commit 0c8349f
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,7 @@ class K8sVMExecutor extends Executor {
this.highMemory = hoek.reach(options, 'kubernetes.resources.memory.high', { default: 12 });
this.lowMemory = hoek.reach(options, 'kubernetes.resources.memory.low', { default: 2 });
this.microMemory = hoek.reach(options, 'kubernetes.resources.memory.micro', { default: 1 });
this.diskLabel = hoek.reach(options, 'kubernetes.labels.disk',
{ default: 'screwdriver.cd/disk' });
this.diskLabel = hoek.reach(options, 'kubernetes.labels.disk', { default: '' });
this.podRetryStrategy = (err, response, body) => {
const status = hoek.reach(body, 'status.phase');

Expand Down Expand Up @@ -253,13 +252,18 @@ class K8sVMExecutor extends Executor {

const podConfig = yaml.safeLoad(podTemplate);

const diskConfig = annotations[DISK_RESOURCE] || '';
const nodeSelectors = diskConfig.toUpperCase() === 'HIGH' ?
{ [this.diskLabel]: 'high' } : {};
if (this.diskLabel) {
const diskConfig = annotations[DISK_RESOURCE] || '';
const nodeSelectors = diskConfig.toUpperCase() === 'HIGH' ?
{ [this.diskLabel]: 'high' } : {};

hoek.merge(nodeSelectors, this.nodeSelectors);
hoek.merge(nodeSelectors, this.nodeSelectors);

setNodeSelector(podConfig, nodeSelectors);
} else {
setNodeSelector(podConfig, this.nodeSelectors);
}

setNodeSelector(podConfig, nodeSelectors);
setPreferredNodeSelector(podConfig, this.preferredNodeSelectors);

const options = {
Expand Down

0 comments on commit 0c8349f

Please sign in to comment.