Skip to content

Commit

Permalink
fix(canary): fix data normalization issue
Browse files Browse the repository at this point in the history
* some of the numerical data for canaries is stored as strings which
caused the UI to throw JS errors for input fields of type `number`.
added code to properly parse these values for existing canary
configurations.  new canary configurations are not affected.
  • Loading branch information
icfantv committed Mar 14, 2017
1 parent f00b6d3 commit 1710b43
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions app/scripts/modules/netflix/pipeline/stage/canary/canaryStage.js
@@ -1,5 +1,6 @@
'use strict';

import {toInteger} from 'lodash';
let angular = require('angular');

import {CLOUD_PROVIDER_REGISTRY} from 'core/cloudProvider/cloudProvider.registry';
Expand Down Expand Up @@ -137,6 +138,16 @@ module.exports = angular.module('spinnaker.netflix.pipeline.stage.canaryStage',
this.terminateUnhealthyCanaryEnabled = true;
}

// ensure string values from canary config are nubmers
const cac = cc.canaryAnalysisConfig;
cc.lifetimeHours = toInteger(cc.lifetimeHours);
cac.lookbackMins = toInteger(cac.lookbackMins);
cac.canaryAnalysisIntervalMins = toInteger(cac.canaryAnalysisIntervalMins);
if (stage.scaleUp) {
stage.scaleUp.delay = toInteger(stage.scaleUp.delay) || undefined;
stage.scaleUp.capacity = toInteger(stage.scaleUp.capacity) || undefined;
}

if (cc.canaryAnalysisConfig.useLookback) {
this.analysisType = 'SLIDING_LOOKBACK';
} else {
Expand Down

0 comments on commit 1710b43

Please sign in to comment.