Bump Gateway API to v1.1.0
Co-authored-by: Romain <rtribotte@users.noreply.github.com>
This commit is contained in:
parent
a8a92eb2a5
commit
6d8407893d
5 changed files with 18424 additions and 11896 deletions
File diff suppressed because it is too large
Load diff
18317
integration/fixtures/k8s-conformance/00-experimental-v1.1.0.yml
Normal file
18317
integration/fixtures/k8s-conformance/00-experimental-v1.1.0.yml
Normal file
File diff suppressed because it is too large
Load diff
|
@ -4,6 +4,7 @@ import (
|
|||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/fs"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"slices"
|
||||
|
@ -18,6 +19,7 @@ import (
|
|||
"github.com/traefik/traefik/v3/integration/try"
|
||||
"github.com/traefik/traefik/v3/pkg/version"
|
||||
"gopkg.in/yaml.v3"
|
||||
apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
|
||||
"k8s.io/apimachinery/pkg/util/sets"
|
||||
kclientset "k8s.io/client-go/kubernetes"
|
||||
"k8s.io/client-go/tools/clientcmd"
|
||||
|
@ -27,10 +29,12 @@ import (
|
|||
gatev1 "sigs.k8s.io/gateway-api/apis/v1"
|
||||
gatev1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2"
|
||||
gatev1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1"
|
||||
conformanceV1alpha1 "sigs.k8s.io/gateway-api/conformance/apis/v1alpha1"
|
||||
"sigs.k8s.io/gateway-api/conformance"
|
||||
v1 "sigs.k8s.io/gateway-api/conformance/apis/v1"
|
||||
"sigs.k8s.io/gateway-api/conformance/tests"
|
||||
"sigs.k8s.io/gateway-api/conformance/utils/config"
|
||||
ksuite "sigs.k8s.io/gateway-api/conformance/utils/suite"
|
||||
"sigs.k8s.io/gateway-api/pkg/features"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -84,7 +88,7 @@ func (s *K8sConformanceSuite) SetupSuite() {
|
|||
|
||||
s.k3sContainer, err = k3s.RunContainer(ctx,
|
||||
testcontainers.WithImage(k3sImage),
|
||||
k3s.WithManifest("./fixtures/k8s-conformance/00-experimental-v1.0.0.yml"),
|
||||
k3s.WithManifest("./fixtures/k8s-conformance/00-experimental-v1.1.0.yml"),
|
||||
k3s.WithManifest("./fixtures/k8s-conformance/01-rbac.yml"),
|
||||
k3s.WithManifest("./fixtures/k8s-conformance/02-traefik.yml"),
|
||||
network.WithNetwork(nil, s.network),
|
||||
|
@ -122,15 +126,19 @@ func (s *K8sConformanceSuite) SetupSuite() {
|
|||
s.T().Fatalf("Error initializing Kubernetes REST client: %v", err)
|
||||
}
|
||||
|
||||
if err = gatev1alpha2.AddToScheme(s.kubeClient.Scheme()); err != nil {
|
||||
if err = gatev1alpha2.Install(s.kubeClient.Scheme()); err != nil {
|
||||
s.T().Fatal(err)
|
||||
}
|
||||
|
||||
if err = gatev1beta1.AddToScheme(s.kubeClient.Scheme()); err != nil {
|
||||
if err = gatev1beta1.Install(s.kubeClient.Scheme()); err != nil {
|
||||
s.T().Fatal(err)
|
||||
}
|
||||
|
||||
if err = gatev1.AddToScheme(s.kubeClient.Scheme()); err != nil {
|
||||
if err = gatev1.Install(s.kubeClient.Scheme()); err != nil {
|
||||
s.T().Fatal(err)
|
||||
}
|
||||
|
||||
if err = apiextensionsv1.AddToScheme(s.kubeClient.Scheme()); err != nil {
|
||||
s.T().Fatal(err)
|
||||
}
|
||||
}
|
||||
|
@ -169,76 +177,54 @@ func (s *K8sConformanceSuite) TestK8sGatewayAPIConformance() {
|
|||
err = try.GetRequest("http://"+k3sContainerIP+":9000/api/entrypoints", 10*time.Second, try.BodyContains(`"name":"web"`))
|
||||
require.NoError(s.T(), err)
|
||||
|
||||
opts := ksuite.Options{
|
||||
Client: s.kubeClient,
|
||||
Clientset: s.clientSet,
|
||||
GatewayClassName: "traefik",
|
||||
Debug: true,
|
||||
CleanupBaseResources: true,
|
||||
TimeoutConfig: config.TimeoutConfig{
|
||||
CreateTimeout: 5 * time.Second,
|
||||
DeleteTimeout: 5 * time.Second,
|
||||
GetTimeout: 5 * time.Second,
|
||||
GatewayMustHaveAddress: 5 * time.Second,
|
||||
GatewayMustHaveCondition: 5 * time.Second,
|
||||
GatewayStatusMustHaveListeners: 10 * time.Second,
|
||||
GatewayListenersMustHaveCondition: 5 * time.Second,
|
||||
GWCMustBeAccepted: 60 * time.Second, // Pod creation in k3s cluster can be long.
|
||||
HTTPRouteMustNotHaveParents: 5 * time.Second,
|
||||
HTTPRouteMustHaveCondition: 5 * time.Second,
|
||||
TLSRouteMustHaveCondition: 5 * time.Second,
|
||||
RouteMustHaveParents: 5 * time.Second,
|
||||
ManifestFetchTimeout: 5 * time.Second,
|
||||
MaxTimeToConsistency: 5 * time.Second,
|
||||
NamespacesMustBeReady: 60 * time.Second, // Pod creation in k3s cluster can be long.
|
||||
RequestTimeout: 5 * time.Second,
|
||||
LatestObservedGenerationSet: 5 * time.Second,
|
||||
RequiredConsecutiveSuccesses: 0,
|
||||
},
|
||||
SupportedFeatures: sets.New(ksuite.SupportGateway,
|
||||
ksuite.SupportGatewayPort8080,
|
||||
ksuite.SupportHTTPRoute,
|
||||
ksuite.SupportHTTPRouteQueryParamMatching,
|
||||
ksuite.SupportHTTPRouteMethodMatching,
|
||||
ksuite.SupportHTTPRoutePortRedirect,
|
||||
ksuite.SupportHTTPRouteSchemeRedirect,
|
||||
ksuite.SupportHTTPRouteHostRewrite,
|
||||
ksuite.SupportHTTPRoutePathRewrite,
|
||||
ksuite.SupportHTTPRoutePathRedirect,
|
||||
),
|
||||
ExemptFeatures: sets.New(
|
||||
ksuite.SupportHTTPRouteRequestTimeout,
|
||||
ksuite.SupportHTTPRouteBackendTimeout,
|
||||
ksuite.SupportHTTPRouteResponseHeaderModification,
|
||||
ksuite.SupportHTTPRouteRequestMirror,
|
||||
ksuite.SupportHTTPRouteRequestMultipleMirrors,
|
||||
),
|
||||
cSuite, err := ksuite.NewConformanceTestSuite(ksuite.ConformanceOptions{
|
||||
Client: s.kubeClient,
|
||||
Clientset: s.clientSet,
|
||||
GatewayClassName: "traefik",
|
||||
Debug: true,
|
||||
CleanupBaseResources: true,
|
||||
TimeoutConfig: config.DefaultTimeoutConfig(),
|
||||
ManifestFS: []fs.FS{&conformance.Manifests},
|
||||
EnableAllSupportedFeatures: false,
|
||||
RunTest: *k8sConformanceRunTest,
|
||||
}
|
||||
|
||||
cSuite, err := ksuite.NewExperimentalConformanceTestSuite(ksuite.ExperimentalConformanceOptions{
|
||||
Options: opts,
|
||||
Implementation: conformanceV1alpha1.Implementation{
|
||||
Implementation: v1.Implementation{
|
||||
Organization: "traefik",
|
||||
Project: "traefik",
|
||||
URL: "https://traefik.io/",
|
||||
Version: version.Version,
|
||||
Contact: []string{"@traefik/maintainers"},
|
||||
},
|
||||
ConformanceProfiles: sets.New(ksuite.HTTPConformanceProfileName),
|
||||
ConformanceProfiles: sets.New(ksuite.GatewayHTTPConformanceProfileName),
|
||||
SupportedFeatures: sets.New(
|
||||
features.SupportGateway,
|
||||
features.SupportGatewayPort8080,
|
||||
features.SupportHTTPRoute,
|
||||
features.SupportHTTPRouteQueryParamMatching,
|
||||
features.SupportHTTPRouteMethodMatching,
|
||||
features.SupportHTTPRoutePortRedirect,
|
||||
features.SupportHTTPRouteSchemeRedirect,
|
||||
features.SupportHTTPRouteHostRewrite,
|
||||
features.SupportHTTPRoutePathRewrite,
|
||||
features.SupportHTTPRoutePathRedirect,
|
||||
),
|
||||
ExemptFeatures: sets.New(
|
||||
features.SupportHTTPRouteRequestTimeout,
|
||||
features.SupportHTTPRouteBackendTimeout,
|
||||
features.SupportHTTPRouteResponseHeaderModification,
|
||||
features.SupportHTTPRouteRequestMirror,
|
||||
features.SupportHTTPRouteRequestMultipleMirrors,
|
||||
),
|
||||
})
|
||||
require.NoError(s.T(), err)
|
||||
|
||||
cSuite.Setup(s.T())
|
||||
cSuite.Setup(s.T(), tests.ConformanceTests)
|
||||
|
||||
err = cSuite.Run(s.T(), tests.ConformanceTests)
|
||||
require.NoError(s.T(), err)
|
||||
|
||||
report, err := cSuite.Report()
|
||||
require.NoError(s.T(), err, "failed generating conformance report")
|
||||
|
||||
report.GatewayAPIVersion = "1.0.0"
|
||||
|
||||
rawReport, err := yaml.Marshal(report)
|
||||
require.NoError(s.T(), err)
|
||||
s.T().Logf("Conformance report:\n%s", string(rawReport))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue