k8s: Support app ingress annotation (#2198)

This commit is contained in:
shamoon 2023-10-18 08:57:10 -07:00 committed by GitHub
parent b8eda91005
commit 4248db7f21
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 3 deletions

View file

@ -45,7 +45,7 @@ export default async function handler(req, res) {
if (pods.length === 0) {
res.status(404).send({
error: "not found"
error: `no pods found with namespace=${namespace} and labelSelector=${labelSelector}`,
});
return;
}

View file

@ -42,7 +42,7 @@ export default async function handler(req, res) {
if (pods.length === 0) {
res.status(404).send({
error: "not found",
error: `no pods found with namespace=${namespace} and labelSelector=${labelSelector}`,
});
return;
}

View file

@ -237,7 +237,7 @@ export async function servicesFromKubernetes() {
)
.map((ingress) => {
let constructedService = {
app: ingress.metadata.name,
app: ingress.metadata.annotations[`${ANNOTATION_BASE}/app`] || ingress.metadata.name,
namespace: ingress.metadata.namespace,
href: ingress.metadata.annotations[`${ANNOTATION_BASE}/href`] || getUrlFromIngress(ingress),
name: ingress.metadata.annotations[`${ANNOTATION_BASE}/name`] || ingress.metadata.name,