Skip to content
This repository was archived by the owner on Feb 8, 2023. It is now read-only.

Commit

Permalink
Merge pull request #21 from emaildanwilson/addIstioDestinationPolicy
Browse files Browse the repository at this point in the history
add Istio destinationpolicies
  • Loading branch information
emaildanwilson authored Mar 2, 2018
2 parents b6786b6 + 67d915c commit 3c5c3b7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
12 changes: 12 additions & 0 deletions api/controllers/deploy/k8sTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@ exports.getKind = function(type) {
"containerSpec": true
};
break;
case 'destinationpolicies':
kind = {
"apiVersion": "config.istio.io/v1alpha2",
"kind": "DestinationPolicy",
"prefix": "apis",
"containerSpec": false,
"namespaced": true
};
break;
case 'horizontalpodautoscalers':
kind = {
"apiVersion": "autoscaling/v1",
Expand Down Expand Up @@ -161,6 +170,9 @@ exports.setrcjson = function (reqdata) {
}
};
break;
case 'destinationpolicies':
//nothing to do yet
break;
case 'jobs':
tmpJson.spec = {
"template": {
Expand Down
4 changes: 2 additions & 2 deletions api/controllers/deploy/validate.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,8 @@ exports.validateUpdateIndex = function (reqdata, callback) {
reqdata.type = "deployments";
}

if (!["configmaps", "daemonsets", "deployments", "egressrules", "horizontalpodautoscalers", "ingresses", "jobs", "routerules", "secrets", "services", "statefulsets"].includes(reqdata.type)) {
return callback(422, 'Type must be one of: "configmaps", "daemonsets", "deployments", "egressrules", "horizontalpodautoscalers", "ingresses", "jobs", "routerules", "secrets", "services", "statefulsets"');
if (!["configmaps", "daemonsets", "deployments", "destinationpolicies", "egressrules", "horizontalpodautoscalers", "ingresses", "jobs", "routerules", "secrets", "services", "statefulsets"].includes(reqdata.type)) {
return callback(422, 'Type must be one of: "configmaps", "daemonsets", "deployments", "destinationpolicies", "egressrules", "horizontalpodautoscalers", "ingresses", "jobs", "routerules", "secrets", "services", "statefulsets"');
}

if (reqdata.containers == null || reqdata.containers == "") {
Expand Down

0 comments on commit 3c5c3b7

Please sign in to comment.