Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
"apiVersion": "extensions/v1beta1",
"kind": "Ingress",
"metadata": {
"annotations": reqdata.annotations,
"name": reqdata.name
},
"spec": {
"rules": [
{"host": configLocation.serviceDNS,
"http": {"paths": [{"path": "/", "backend": {"serviceName": reqdata.name, "servicePort": reqdata.targetPort}}]}}
],
"tls": [{"hosts": [configLocation.serviceDNS]}]
}
};
if (reqdata.annotations["sidecar.istio.io/inject"] == "true") {
console.log(reqdata.key, "Adding istio annotation to ingress");
kubeingress.metadata.annotations["kubernetes.io/ingress.class"] = "istio";
kubeingress.spec.rules[0].http.paths[0].path = "/.*";
delete kubeingress.spec.tls;
}
k8sHelper.k8sCRUD.ensureObject(kubeingress, kubeapiParams, 'ingresses', reqdata, function (err, data) {
if (err) {
console.log(reqdata.key, "error updating ingress:", data);
return callback(err, "error updating ingress:" + reqdata.key);
} else {
data.location = configLocation.location;
data.context = configLocation.context;
reqdata.deployClusters.push(data);
return callback(null, data.message);
}