Update service-helpers.js

This commit is contained in:
Atropos 2023-12-17 17:34:24 +00:00 committed by GitHub
parent a3fcc3ef51
commit a6b2f7fea3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -169,7 +169,8 @@ export async function checkCRD(kc, name) {
export async function servicesFromKubernetes() {
const ANNOTATION_BASE = "gethomepage.dev";
const ANNOTATION_WIDGET_BASE = `${ANNOTATION_BASE}/widget.`;
const { instanceName } = getSettings();
checkAndCopyConfig("kubernetes.yaml");
try {
@ -238,7 +239,7 @@ export async function servicesFromKubernetes() {
const services = ingressList.items
.filter(
(ingress) =>
ingress.metadata.annotations && ingress.metadata.annotations[`${ANNOTATION_BASE}/enabled`] === "true",
ingress.metadata.annotations && ingress.metadata.annotations[`${ANNOTATION_BASE}/enabled`] === "true" && (!ingress.metadata.annotations[`${ANNOTATION_BASE}/instance`] || ingress.metadata.annotations[`${ANNOTATION_BASE}/instance`] === instanceName),
)
.map((ingress) => {
let constructedService = {