1
0
Fork 0

Bump to go1.24

Co-authored-by: Romain <rtribotte@users.noreply.github.com>
This commit is contained in:
Kevin Pollet 2025-06-02 10:36:05 +02:00 committed by GitHub
parent 5f35c88805
commit cd16321dd9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
88 changed files with 284 additions and 362 deletions

View file

@ -1,7 +1,6 @@
package crd
import (
"context"
"os"
"path/filepath"
"strings"
@ -1466,7 +1465,7 @@ func TestLoadIngressRouteTCPs(t *testing.T) {
}
clientMock := newClientMock(test.paths...)
conf := p.loadConfigurationFromCRD(context.Background(), clientMock)
conf := p.loadConfigurationFromCRD(t.Context(), clientMock)
assert.Equal(t, test.expected, conf)
})
}
@ -4241,7 +4240,7 @@ func TestLoadIngressRoutes(t *testing.T) {
}
clientMock := newClientMock(test.paths...)
conf := p.loadConfigurationFromCRD(context.Background(), clientMock)
conf := p.loadConfigurationFromCRD(t.Context(), clientMock)
assert.Equal(t, test.expected, conf)
})
}
@ -4721,7 +4720,7 @@ func TestLoadIngressRouteUDPs(t *testing.T) {
}
clientMock := newClientMock(test.paths...)
conf := p.loadConfigurationFromCRD(context.Background(), clientMock)
conf := p.loadConfigurationFromCRD(t.Context(), clientMock)
assert.Equal(t, test.expected, conf)
})
}
@ -6098,7 +6097,7 @@ func TestCrossNamespace(t *testing.T) {
p := Provider{AllowCrossNamespace: test.allowCrossNamespace}
conf := p.loadConfigurationFromCRD(context.Background(), client)
conf := p.loadConfigurationFromCRD(t.Context(), client)
assert.Equal(t, test.expected, conf)
})
}
@ -6387,7 +6386,7 @@ func TestExternalNameService(t *testing.T) {
p := Provider{AllowExternalNameServices: test.allowExternalNameService}
conf := p.loadConfigurationFromCRD(context.Background(), client)
conf := p.loadConfigurationFromCRD(t.Context(), client)
assert.Equal(t, test.expected, conf)
})
}
@ -6593,7 +6592,7 @@ func TestNativeLB(t *testing.T) {
p := Provider{}
conf := p.loadConfigurationFromCRD(context.Background(), client)
conf := p.loadConfigurationFromCRD(t.Context(), client)
assert.Equal(t, test.expected, conf)
})
}

View file

@ -1,7 +1,6 @@
package gateway
import (
"context"
"testing"
"github.com/stretchr/testify/assert"
@ -1481,7 +1480,7 @@ func TestLoadHTTPRoutes(t *testing.T) {
}
p := Provider{EntryPoints: test.entryPoints}
conf := p.loadConfigurationFromGateway(context.Background(), newClientMock(test.paths...))
conf := p.loadConfigurationFromGateway(t.Context(), newClientMock(test.paths...))
assert.Equal(t, test.expected, conf)
})
}
@ -2215,7 +2214,7 @@ func TestLoadTCPRoutes(t *testing.T) {
}
p := Provider{EntryPoints: test.entryPoints}
conf := p.loadConfigurationFromGateway(context.Background(), newClientMock(test.paths...))
conf := p.loadConfigurationFromGateway(t.Context(), newClientMock(test.paths...))
assert.Equal(t, test.expected, conf)
})
}
@ -3307,7 +3306,7 @@ func TestLoadTLSRoutes(t *testing.T) {
}
p := Provider{EntryPoints: test.entryPoints}
conf := p.loadConfigurationFromGateway(context.Background(), newClientMock(test.paths...))
conf := p.loadConfigurationFromGateway(t.Context(), newClientMock(test.paths...))
assert.Equal(t, test.expected, conf)
})
}
@ -4258,7 +4257,7 @@ func TestLoadMixedRoutes(t *testing.T) {
}
p := Provider{EntryPoints: test.entryPoints}
conf := p.loadConfigurationFromGateway(context.Background(), newClientMock(test.paths...))
conf := p.loadConfigurationFromGateway(t.Context(), newClientMock(test.paths...))
assert.Equal(t, test.expected, conf)
})
}

View file

@ -1,7 +1,6 @@
package ingress
import (
"context"
"errors"
"testing"
"time"
@ -243,7 +242,7 @@ func TestClientIgnoresEmptyEndpointUpdates(t *testing.T) {
assert.Fail(t, "expected to receive event for endpoints")
}
emptyEndpoint, err = kubeClient.CoreV1().Endpoints("test").Get(context.TODO(), "empty-endpoint", metav1.GetOptions{})
emptyEndpoint, err = kubeClient.CoreV1().Endpoints("test").Get(t.Context(), "empty-endpoint", metav1.GetOptions{})
assert.NoError(t, err)
// Update endpoint annotation and resource version (apparently not done by fake client itself)
@ -251,7 +250,7 @@ func TestClientIgnoresEmptyEndpointUpdates(t *testing.T) {
// This reflects the behavior of kubernetes controllers which use endpoint annotations for leader election.
emptyEndpoint.Annotations["test-annotation"] = "___"
emptyEndpoint.ResourceVersion = "1245"
_, err = kubeClient.CoreV1().Endpoints("test").Update(context.TODO(), emptyEndpoint, metav1.UpdateOptions{})
_, err = kubeClient.CoreV1().Endpoints("test").Update(t.Context(), emptyEndpoint, metav1.UpdateOptions{})
require.NoError(t, err)
select {
@ -263,12 +262,12 @@ func TestClientIgnoresEmptyEndpointUpdates(t *testing.T) {
case <-time.After(50 * time.Millisecond):
}
filledEndpoint, err = kubeClient.CoreV1().Endpoints("test").Get(context.TODO(), "filled-endpoint", metav1.GetOptions{})
filledEndpoint, err = kubeClient.CoreV1().Endpoints("test").Get(t.Context(), "filled-endpoint", metav1.GetOptions{})
assert.NoError(t, err)
filledEndpoint.Subsets[0].Addresses[0].IP = "10.13.37.2"
filledEndpoint.ResourceVersion = "1235"
_, err = kubeClient.CoreV1().Endpoints("test").Update(context.TODO(), filledEndpoint, metav1.UpdateOptions{})
_, err = kubeClient.CoreV1().Endpoints("test").Update(t.Context(), filledEndpoint, metav1.UpdateOptions{})
require.NoError(t, err)
select {

View file

@ -1,7 +1,6 @@
package ingress
import (
"context"
"errors"
"math"
"os"
@ -1658,7 +1657,7 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
clientMock := newClientMock(serverVersion, paths...)
p := Provider{IngressClass: test.ingressClass, AllowEmptyServices: test.allowEmptyServices}
conf := p.loadConfigurationFromIngresses(context.Background(), clientMock)
conf := p.loadConfigurationFromIngresses(t.Context(), clientMock)
assert.Equal(t, test.expected, conf)
})
@ -1804,7 +1803,7 @@ func TestLoadConfigurationFromIngressesWithExternalNameServices(t *testing.T) {
p := Provider{IngressClass: test.ingressClass}
p.AllowExternalNameServices = test.allowExternalNameServices
conf := p.loadConfigurationFromIngresses(context.Background(), clientMock)
conf := p.loadConfigurationFromIngresses(t.Context(), clientMock)
assert.Equal(t, test.expected, conf)
})
@ -1881,7 +1880,7 @@ func TestLoadConfigurationFromIngressesWithNativeLB(t *testing.T) {
clientMock := newClientMock(serverVersion, paths...)
p := Provider{IngressClass: test.ingressClass}
conf := p.loadConfigurationFromIngresses(context.Background(), clientMock)
conf := p.loadConfigurationFromIngresses(t.Context(), clientMock)
assert.Equal(t, test.expected, conf)
})
@ -2053,7 +2052,7 @@ func TestGetCertificates(t *testing.T) {
t.Parallel()
tlsConfigs := map[string]*tls.CertAndStores{}
err := getCertificates(context.Background(), test.ingress, test.client, tlsConfigs)
err := getCertificates(t.Context(), test.ingress, test.client, tlsConfigs)
if test.errResult != "" {
assert.EqualError(t, err, test.errResult)