Skip to content

Commit

Permalink
fix: prefer networking v1, if avaiable
Browse files Browse the repository at this point in the history
With the more fine-grained check, we can invert our preference and
safely test and use networking v1 instead of the v1beta1.

Signed-off-by: Lucas Roesler <roesler.lucas@gmail.com>
  • Loading branch information
LucasRoesler authored and alexellis committed Sep 8, 2021
1 parent feb0715 commit 210fe47
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,17 @@ func main() {
klog.Infof("cluster supports ingress in: %s", capabilities)

var ctrl controller
if capabilities.Has("extensions/v1beta1") {
ctrl = controllerv1beta1.NewController(
// prefer v1, if it is available, this removes any deprecation warnings
if capabilities.Has("networking.k8s.io/v1") {
ctrl = controllerv1.NewController(
kubeClient,
faasClient,
kubeInformerFactory,
faasInformerFactory,
)
} else {
ctrl = controllerv1.NewController(
// use v1beta1 by default
ctrl = controllerv1beta1.NewController(
kubeClient,
faasClient,
kubeInformerFactory,
Expand Down

0 comments on commit 210fe47

Please sign in to comment.