@@ -87,7 +87,7 @@ func TestPatch(t *testing.T) {
8787// Compute request identifier before the update, so we can later verify that the update call was not cached with this identifier.
8888modifiedUnstructured , err := prepareModified (env .Scheme (), modifiedObject )
8989g .Expect (err ).ToNot (HaveOccurred ())
90- oldRequestIdentifier , err := ComputeRequestIdentifier (env .GetScheme (), originalObject , modifiedUnstructured )
90+ oldRequestIdentifier , err := ComputeRequestIdentifier (env .GetScheme (), originalObject . GetResourceVersion () , modifiedUnstructured )
9191g .Expect (err ).ToNot (HaveOccurred ())
9292// Save a copy of modifiedUnstructured before apply to compute the new identifier later
9393modifiedUnstructuredBeforeApply := modifiedUnstructured .DeepCopy ()
@@ -101,7 +101,7 @@ func TestPatch(t *testing.T) {
101101objectAfterApply := initialObject .DeepCopy ()
102102g .Expect (env .GetAPIReader ().Get (ctx , client .ObjectKeyFromObject (objectAfterApply ), objectAfterApply )).To (Succeed ())
103103// Compute the new request identifier (after apply)
104- newRequestIdentifier , err := ComputeRequestIdentifier (env .GetScheme (), objectAfterApply , modifiedUnstructuredBeforeApply )
104+ newRequestIdentifier , err := ComputeRequestIdentifier (env .GetScheme (), objectAfterApply . GetResourceVersion () , modifiedUnstructuredBeforeApply )
105105g .Expect (err ).ToNot (HaveOccurred ())
106106// Verify that request was cached with the new identifier (after apply)
107107g .Expect (ssaCache .Has (newRequestIdentifier , initialObject .GetKind ())).To (BeTrue ())
@@ -116,7 +116,7 @@ func TestPatch(t *testing.T) {
116116// Compute request identifier, so we can later verify that the update call was cached.
117117modifiedUnstructured , err = prepareModified (env .Scheme (), modifiedObject )
118118g .Expect (err ).ToNot (HaveOccurred ())
119- requestIdentifierNoOp , err := ComputeRequestIdentifier (env .GetScheme (), originalObject , modifiedUnstructured )
119+ requestIdentifierNoOp , err := ComputeRequestIdentifier (env .GetScheme (), originalObject . GetResourceVersion () , modifiedUnstructured )
120120g .Expect (err ).ToNot (HaveOccurred ())
121121// Update the object
122122applyCallCount = 0
@@ -189,7 +189,7 @@ func TestPatch(t *testing.T) {
189189// Compute request identifier before the update, so we can later verify that the update call was not cached with this identifier.
190190modifiedUnstructured , err := prepareModified (env .Scheme (), modifiedObject )
191191g .Expect (err ).ToNot (HaveOccurred ())
192- oldRequestIdentifier , err := ComputeRequestIdentifier (env .GetScheme (), originalObject , modifiedUnstructured )
192+ oldRequestIdentifier , err := ComputeRequestIdentifier (env .GetScheme (), originalObject . GetResourceVersion () , modifiedUnstructured )
193193g .Expect (err ).ToNot (HaveOccurred ())
194194// Save a copy of modifiedUnstructured before apply to compute the new identifier later
195195modifiedUnstructuredBeforeApply := modifiedUnstructured .DeepCopy ()
@@ -209,7 +209,7 @@ func TestPatch(t *testing.T) {
209209err = env .GetScheme ().Convert (objectAfterApply , objectAfterApplyUnstructured , nil )
210210g .Expect (err ).ToNot (HaveOccurred ())
211211// Compute the new request identifier (after apply)
212- newRequestIdentifier , err := ComputeRequestIdentifier (env .GetScheme (), objectAfterApplyUnstructured , modifiedUnstructuredBeforeApply )
212+ newRequestIdentifier , err := ComputeRequestIdentifier (env .GetScheme (), objectAfterApplyUnstructured . GetResourceVersion () , modifiedUnstructuredBeforeApply )
213213g .Expect (err ).ToNot (HaveOccurred ())
214214// Verify that request was cached with the new identifier (after apply)
215215g .Expect (ssaCache .Has (newRequestIdentifier , initialObject .GetObjectKind ().GroupVersionKind ().Kind )).To (BeTrue ())
@@ -232,7 +232,7 @@ func TestPatch(t *testing.T) {
232232// Compute request identifier, so we can later verify that the update call was cached.
233233modifiedUnstructured , err = prepareModified (env .Scheme (), modifiedObject )
234234g .Expect (err ).ToNot (HaveOccurred ())
235- requestIdentifierNoOp , err := ComputeRequestIdentifier (env .GetScheme (), originalObject , modifiedUnstructured )
235+ requestIdentifierNoOp , err := ComputeRequestIdentifier (env .GetScheme (), originalObject . GetResourceVersion () , modifiedUnstructured )
236236g .Expect (err ).ToNot (HaveOccurred ())
237237// Update the object
238238applyCallCount = 0
0 commit comments