Skip to content

Commit

Permalink
Add support for new API group and keep support on old one
Browse files Browse the repository at this point in the history
  • Loading branch information
2mas committed Nov 3, 2023
1 parent 5482f45 commit 0655571
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions controller/cache/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ func populateNodeInfo(un *unstructured.Unstructured, res *ResourceInfo, customLa
populateIngressInfo(un, res)
}
case "traefik.containo.us":
fallthrough
case "traefik.io":
switch gvk.Kind {
case "IngressRoute":
populateTraefikIngressRouteInfo(un, res)
Expand Down Expand Up @@ -122,6 +124,8 @@ func getServiceName(backend map[string]interface{}, gvk schema.GroupVersionKind)
}
}
case "traefik.containo.us":
fallthrough
case "traefik.io":
switch gvk.Version {
case "v1alpha1":
return fmt.Sprintf("%s", backend["name"]), nil
Expand Down
4 changes: 2 additions & 2 deletions controller/cache/info_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ spec:
host: service`)

testTraefikIngressRoute = strToUnstructured(`
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: traefik-ingress
Expand All @@ -262,7 +262,7 @@ spec:
port: 80`)

testTraefikIngressRouteWithNamespacedService = strToUnstructured(`
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: traefik-ingress
Expand Down

0 comments on commit 0655571

Please sign in to comment.