k8s: Support app ingress annotation (#2198)
This commit is contained in:
parent
b8eda91005
commit
4248db7f21
4 changed files with 4 additions and 3 deletions
|
@ -110,6 +110,7 @@ metadata:
|
|||
gethomepage.dev/description: Media Server
|
||||
gethomepage.dev/group: Media
|
||||
gethomepage.dev/icon: emby.png
|
||||
gethomepage.dev/app: emby-app # optional, may be needed if app.kubernetes.io/name != ingress metadata.name
|
||||
gethomepage.dev/name: Emby
|
||||
gethomepage.dev/widget.type: "emby"
|
||||
gethomepage.dev/widget.url: "https://emby.example.com"
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Add table
Reference in a new issue