Skip to content

Commit

Permalink
Merge pull request #9916 from k8s-infra-cherrypick-robot/cherry-pick-…
Browse files Browse the repository at this point in the history
…9914-to-release-1.5

[release-1.5] 🐛 ssa: fix flaky test TestPatch/Test patch with Machine
  • Loading branch information
k8s-ci-robot authored Dec 28, 2023
2 parents 8c12f98 + 0f02ee4 commit 1f3d6cd
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 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/pointer"
Expand Down Expand Up @@ -111,6 +112,11 @@ func TestPatch(t *testing.T) {
Bootstrap: clusterv1.Bootstrap{
DataSecretName: pointer.String("data-secret"),
},
InfrastructureRef: corev1.ObjectReference{
// The namespace needs to get set here. Otherwise the defaulting webhook always sets this field again
// which would lead to an resourceVersion bump at the 3rd step and to a flaky test.
Namespace: ns.Name,
},
},
}
fieldManager := "test-manager"
Expand Down

0 comments on commit 1f3d6cd

Please sign in to comment.