Skip to content

Commit

Permalink
ssa: fix flaky test TestPatch/Test patch with Machine
Browse files Browse the repository at this point in the history
During the test at the additional Patch calls the defaulting webhook did always
set the .spec.infrastructureRef.namespace field.

This caused flaky behaviour because there was a chance for the resourceVersion
to getting bumped with the only change being the timestamp in managedFields.
  • Loading branch information
chrischdi committed Dec 22, 2023
1 parent 235d965 commit ec92803
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/util/ssa/patch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"time"

. "github.com/onsi/gomega"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/utils/ptr"
Expand Down Expand Up @@ -111,6 +112,9 @@ func TestPatch(t *testing.T) {
Bootstrap: clusterv1.Bootstrap{
DataSecretName: ptr.To("data-secret"),
},
InfrastructureRef: corev1.ObjectReference{
Namespace: ns.Name,
},
},
}
fieldManager := "test-manager"
Expand Down

0 comments on commit ec92803

Please sign in to comment.