Compare commits

..

2 Commits

Author SHA1 Message Date
shamoon
34589f0514 reduce k8s traefik discovery log noise 2023-09-16 08:28:58 -07:00
shamoon
3cd441a45e Maybe handle no traefik ingress routes
See #1998
2023-09-16 08:06:24 -07:00

View File

@@ -168,7 +168,7 @@ export async function servicesFromKubernetes() {
.listClusterCustomObject("traefik.containo.us", "v1alpha1", "ingressroutes")
.then((response) => response.body)
.catch(async (error) => {
if (error.statusCode !== 404) {
if (error.statusCode !== 403) {
logger.error(
"Error getting traefik ingresses from traefik.containo.us: %d %s %s",
error.statusCode,
@@ -184,7 +184,7 @@ export async function servicesFromKubernetes() {
.listClusterCustomObject("traefik.io", "v1alpha1", "ingressroutes")
.then((response) => response.body)
.catch(async (error) => {
if (error.statusCode !== 404) {
if (error.statusCode !== 403) {
logger.error(
"Error getting traefik ingresses from traefik.io: %d %s %s",
error.statusCode,
@@ -198,7 +198,7 @@ export async function servicesFromKubernetes() {
const traefikIngressList = [...traefikIngressListContaino, ...traefikIngressListIo];
if (traefikIngressList && traefikIngressList.items.length > 0) {
if (traefikIngressList?.items?.length > 0) {
const traefikServices = traefikIngressList.items.filter(
(ingress) => ingress.metadata.annotations && ingress.metadata.annotations[`${ANNOTATION_BASE}/href`]
);