diff --git a/conformance/tests/gateway-observed-generation-bump.go b/conformance/tests/gateway-observed-generation-bump.go index d7b5d87bda..12f46d2358 100644 --- a/conformance/tests/gateway-observed-generation-bump.go +++ b/conformance/tests/gateway-observed-generation-bump.go @@ -23,6 +23,7 @@ import ( "github.com/stretchr/testify/require" "k8s.io/apimachinery/pkg/types" + "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/gateway-api/apis/v1beta1" "sigs.k8s.io/gateway-api/conformance/utils/kubernetes" @@ -69,8 +70,8 @@ var GatewayObservedGenerationBump = suite.ConformanceTest{ }, }) - err = s.Client.Update(ctx, mutate) - require.NoErrorf(t, err, "error updating the Gateway: %v", err) + err = s.Client.Patch(ctx, mutate, client.MergeFrom(original)) + require.NoErrorf(t, err, "error patching the Gateway: %v", err) // Ensure the generation and observedGeneration sync up kubernetes.NamespacesMustBeAccepted(t, s.Client, s.TimeoutConfig, namespaces) diff --git a/conformance/tests/gatewayclass-observed-generation-bump.go b/conformance/tests/gatewayclass-observed-generation-bump.go index 0a699ff514..e1e556b590 100644 --- a/conformance/tests/gatewayclass-observed-generation-bump.go +++ b/conformance/tests/gatewayclass-observed-generation-bump.go @@ -23,6 +23,7 @@ import ( "github.com/stretchr/testify/require" "k8s.io/apimachinery/pkg/types" + "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/gateway-api/apis/v1beta1" "sigs.k8s.io/gateway-api/conformance/utils/kubernetes" @@ -58,8 +59,8 @@ var GatewayClassObservedGenerationBump = suite.ConformanceTest{ desc := "new" mutate.Spec.Description = &desc - err = s.Client.Update(ctx, mutate) - require.NoErrorf(t, err, "error updating the GatewayClass: %v", err) + err = s.Client.Patch(ctx, mutate, client.MergeFrom(original)) + require.NoErrorf(t, err, "error patching the GatewayClass: %v", err) // Ensure the generation and observedGeneration sync up kubernetes.GWCMustHaveAcceptedConditionAny(t, s.Client, s.TimeoutConfig, gwc.Name) diff --git a/conformance/tests/httproute-observed-generation-bump.go b/conformance/tests/httproute-observed-generation-bump.go index 590dcc6fed..c7571856bc 100644 --- a/conformance/tests/httproute-observed-generation-bump.go +++ b/conformance/tests/httproute-observed-generation-bump.go @@ -24,6 +24,7 @@ import ( "github.com/stretchr/testify/require" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" + "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/gateway-api/apis/v1beta1" "sigs.k8s.io/gateway-api/conformance/utils/kubernetes" @@ -65,8 +66,8 @@ var HTTPRouteObservedGenerationBump = suite.ConformanceTest{ mutate := original.DeepCopy() mutate.Spec.Rules[0].BackendRefs[0].Name = "infra-backend-v2" - err = s.Client.Update(ctx, mutate) - require.NoErrorf(t, err, "error updating the HTTPRoute: %v", err) + err = s.Client.Patch(ctx, mutate, client.MergeFrom(original)) + require.NoErrorf(t, err, "error patching the HTTPRoute: %v", err) kubernetes.HTTPRouteMustHaveCondition(t, s.Client, s.TimeoutConfig, routeNN, gwNN, acceptedCondition)