Skip to content

Commit

Permalink
Fallback to extensions/v1beta1 for ingress APIs in case of fake CLI (
Browse files Browse the repository at this point in the history
…#1156)

* Return early from NewManager if fakeCLI is passed

* Nil check instead of len check of slice

* Default to extensions/v1beta1 in newManager

* Default to extensions/v1beta1 groupVersion for ingresses if fake CLI is used

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
viveksinghggits and mergify[bot] committed Dec 15, 2021
1 parent 0416308 commit 4e65d7d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/kube/ingress/ingressmgr.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,8 @@ func NewManager(ctx context.Context, kubeCli kubernetes.Interface) (Manager, err
if exists {
return NewNetworkingV1beta1(kubeCli), nil
}
return nil, errors.New("Ingress resources are not available")

// We were not able to figure out which groupVersion, resource is available in.
// Most probably its because fake CLI was used, fallback to extensions/v1beta1
return NewExtensionsV1beta1(kubeCli), nil
}

0 comments on commit 4e65d7d

Please sign in to comment.