Skip to content

Commit

Permalink
Merge pull request #2310 from dcos/ph/fix/healtcheck-validator
Browse files Browse the repository at this point in the history
fix(appValidators): Remove Healthchecks validators
  • Loading branch information
Orlando Hohmeier authored Jul 19, 2017
2 parents 836b2b5 + f1ed1ed commit bbbd887
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 82 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,6 @@ const APP_VALIDATORS = [
MarathonAppValidators.validateConstraints,
MarathonAppValidators.validateLabels,
MarathonAppValidators.mustNotContainUris,
MarathonAppValidators.mustNotContainMarathonHTTPSHealthChecks,
MarathonAppValidators.mustNotContainMarathonHTTPHealthChecks,
MarathonAppValidators.mustNotContainMarathonTCPHealthChecks,
VipLabelsValidators.mustContainPort
];

Expand Down
79 changes: 0 additions & 79 deletions plugins/services/src/js/validators/MarathonAppValidators.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import ValidatorUtil from "#SRC/js/utils/ValidatorUtil";
import { findNestedPropertyInObject } from "#SRC/js/utils/Util";
import { HTTP, HTTPS, TCP } from "../constants/HealthCheckProtocols";
import {
PROP_CONFLICT,
PROP_DEPRECATED,
Expand Down Expand Up @@ -172,84 +171,6 @@ const MarathonAppValidators = {
return [];
},

/**
* @param {Object} app - The data to validate
* @returns {Array} Returns an array with validation errors
*/
mustNotContainMarathonHTTPHealthChecks(app) {
if (
ValidatorUtil.isDefined(app.healthChecks) &&
app.healthChecks.find(function(healthCheck) {
return HTTP === healthCheck.protocol;
})
) {
const message =
"Marathon protocols `HTTP` deprecated. Please use" +
" `MESOS_HTTP instead";
const type = PROP_DEPRECATED;
const variables = {
name: "healthChecks"
};

return [{ path: ["healthChecks"], message, type, variables }];
}

// No errors
return [];
},

/**
* @param {Object} app - The data to validate
* @returns {Array} Returns an array with validation errors
*/
mustNotContainMarathonHTTPSHealthChecks(app) {
if (
ValidatorUtil.isDefined(app.healthChecks) &&
app.healthChecks.find(function(healthCheck) {
return HTTPS === healthCheck.protocol;
})
) {
const message =
"Marathon protocols `HTTPS` deprecated. Please use" +
" `MESOS_HTTPS instead";
const type = PROP_DEPRECATED;
const variables = {
name: "healthChecks"
};

return [{ path: ["healthChecks"], message, type, variables }];
}

// No errors
return [];
},

/**
* @param {Object} app - The data to validate
* @returns {Array} Returns an array with validation errors
*/
mustNotContainMarathonTCPHealthChecks(app) {
if (
ValidatorUtil.isDefined(app.healthChecks) &&
app.healthChecks.find(function(healthCheck) {
return TCP === healthCheck.protocol;
})
) {
const message =
"Marathon protocols `TCP` deprecated. Please use" +
" `MESOS_TCP instead";
const type = PROP_DEPRECATED;
const variables = {
name: "healthChecks"
};

return [{ path: ["healthChecks"], message, type, variables }];
}

// No errors
return [];
},

validateConstraints(app) {
const constraints = findNestedPropertyInObject(app, "constraints") || [];
if (constraints != null && !Array.isArray(constraints)) {
Expand Down

0 comments on commit bbbd887

Please sign in to comment.