Use semantic versioning to enable ingress class support

This commit is contained in:
Kevin Pollet 2020-07-21 15:32:04 +02:00 committed by GitHub
parent dcd0cda0c6
commit a136c46148
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 40 additions and 43 deletions

View file

@ -183,7 +183,7 @@ func (p *Provider) loadConfigurationFromIngresses(ctx context.Context, client Cl
TCP: &dynamic.TCPConfiguration{},
}
major, minor, err := client.GetServerVersion()
serverVersion, err := client.GetServerVersion()
if err != nil {
log.FromContext(ctx).Errorf("Failed to get server version: %v", err)
return conf
@ -191,7 +191,7 @@ func (p *Provider) loadConfigurationFromIngresses(ctx context.Context, client Cl
var ingressClass *networkingv1beta1.IngressClass
if major >= 1 && minor >= 18 {
if supportsIngressClass(serverVersion) {
ic, err := client.GetIngressClass()
if err != nil {
log.FromContext(ctx).Errorf("Failed to find an ingress class: %v", err)