mirror of
				https://github.com/karl0ss/homepage.git
				synced 2025-11-04 00:10:57 +00:00 
			
		
		
		
	Support old traefik CRD group
This commit is contained in:
		
							parent
							
								
									fce680d981
								
							
						
					
					
						commit
						4a97fce841
					
				@ -160,9 +160,18 @@ export async function servicesFromKubernetes() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    const traefikIngressList = await crd.listClusterCustomObject("traefik.io", "v1alpha1", "ingressroutes")
 | 
					    const traefikIngressList = await crd.listClusterCustomObject("traefik.io", "v1alpha1", "ingressroutes")
 | 
				
			||||||
      .then((response) => response.body)
 | 
					      .then((response) => response.body)
 | 
				
			||||||
      .catch((error) => {
 | 
					      .catch(async (error) => {
 | 
				
			||||||
        logger.error("Error getting traefik ingresses: %d %s %s", error.statusCode, error.body, error.response);
 | 
					        logger.error("Error getting traefik ingresses from traefik.io: %d %s %s", error.statusCode, error.body, error.response);
 | 
				
			||||||
        return null;
 | 
					
 | 
				
			||||||
 | 
					        // Fallback to the old traefik CRD group
 | 
				
			||||||
 | 
					        const fallbackIngressList = await crd.listClusterCustomObject("traefik.containo.us", "v1alpha1", "ingressroutes")
 | 
				
			||||||
 | 
					          .then((response) => response.body)
 | 
				
			||||||
 | 
					          .catch((fallbackError) => {
 | 
				
			||||||
 | 
					            logger.error("Error getting traefik ingresses from traefik.containo.us: %d %s %s", fallbackError.statusCode, fallbackError.body, fallbackError.response);
 | 
				
			||||||
 | 
					            return null;
 | 
				
			||||||
 | 
					          });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        return fallbackIngressList;
 | 
				
			||||||
      });
 | 
					      });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (traefikIngressList && traefikIngressList.items.length > 0) {
 | 
					    if (traefikIngressList && traefikIngressList.items.length > 0) {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user