mirror of
https://github.com/projectcapsule/capsule.git
synced 2026-08-25 16:07:24 +00:00
bug: disabling ingresses.networking.k8s.io indexers on k8s < 1.19
This commit is contained in:
@@ -22,10 +22,17 @@ import (
|
||||
networkingv1beta1 "k8s.io/api/networking/v1beta1"
|
||||
|
||||
"github.com/clastix/capsule/pkg/indexer/ingress"
|
||||
"github.com/clastix/capsule/pkg/webhook/utils"
|
||||
)
|
||||
|
||||
func init() {
|
||||
AddToIndexerFuncs = append(AddToIndexerFuncs, ingress.Hostname{Obj: &extensionsv1beta1.Ingress{}})
|
||||
AddToIndexerFuncs = append(AddToIndexerFuncs, ingress.Hostname{Obj: &networkingv1.Ingress{}})
|
||||
// ingresses.networking.k8s.io/v1 introduced by 1.19
|
||||
{
|
||||
majorVer, minorVer, _, _ := utils.GetK8sVersion()
|
||||
if majorVer == 1 && minorVer >= 19 {
|
||||
AddToIndexerFuncs = append(AddToIndexerFuncs, ingress.Hostname{Obj: &networkingv1.Ingress{}})
|
||||
}
|
||||
}
|
||||
AddToIndexerFuncs = append(AddToIndexerFuncs, ingress.Hostname{Obj: &networkingv1beta1.Ingress{}})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user