@@ -96,7 +96,7 @@ func TestPatch(t *testing.T) {
9696 // Compute request identifier before the update, so we can later verify that the update call was not cached with this identifier.
9797 modifiedUnstructured , err := prepareModified (env .Scheme (), modifiedObject )
9898 g .Expect (err ).ToNot (HaveOccurred ())
99- oldRequestIdentifier , err := ComputeRequestIdentifier (env .GetScheme (), originalObject , modifiedUnstructured )
99+ oldRequestIdentifier , err := ComputeRequestIdentifier (env .GetScheme (), originalObject . GetResourceVersion () , modifiedUnstructured )
100100 g .Expect (err ).ToNot (HaveOccurred ())
101101 // Save a copy of modifiedUnstructured before apply to compute the new identifier later
102102 modifiedUnstructuredBeforeApply := modifiedUnstructured .DeepCopy ()
@@ -110,7 +110,7 @@ func TestPatch(t *testing.T) {
110110 objectAfterApply := initialObject .DeepCopy ()
111111 g .Expect (env .GetAPIReader ().Get (ctx , client .ObjectKeyFromObject (objectAfterApply ), objectAfterApply )).To (Succeed ())
112112 // Compute the new request identifier (after apply)
113- newRequestIdentifier , err := ComputeRequestIdentifier (env .GetScheme (), objectAfterApply , modifiedUnstructuredBeforeApply )
113+ newRequestIdentifier , err := ComputeRequestIdentifier (env .GetScheme (), objectAfterApply . GetResourceVersion () , modifiedUnstructuredBeforeApply )
114114 g .Expect (err ).ToNot (HaveOccurred ())
115115 // Verify that request was cached with the new identifier (after apply)
116116 g .Expect (ssaCache .Has (newRequestIdentifier , initialObject .GetKind ())).To (BeTrue ())
@@ -125,7 +125,7 @@ func TestPatch(t *testing.T) {
125125 // Compute request identifier, so we can later verify that the update call was cached.
126126 modifiedUnstructured , err = prepareModified (env .Scheme (), modifiedObject )
127127 g .Expect (err ).ToNot (HaveOccurred ())
128- requestIdentifierNoOp , err := ComputeRequestIdentifier (env .GetScheme (), originalObject , modifiedUnstructured )
128+ requestIdentifierNoOp , err := ComputeRequestIdentifier (env .GetScheme (), originalObject . GetResourceVersion () , modifiedUnstructured )
129129 g .Expect (err ).ToNot (HaveOccurred ())
130130 // Update the object
131131 countingClient .resetCount ()
@@ -192,7 +192,7 @@ func TestPatch(t *testing.T) {
192192 // Compute request identifier before the update, so we can later verify that the update call was not cached with this identifier.
193193 modifiedUnstructured , err := prepareModified (env .Scheme (), modifiedObject )
194194 g .Expect (err ).ToNot (HaveOccurred ())
195- oldRequestIdentifier , err := ComputeRequestIdentifier (env .GetScheme (), originalObject , modifiedUnstructured )
195+ oldRequestIdentifier , err := ComputeRequestIdentifier (env .GetScheme (), originalObject . GetResourceVersion () , modifiedUnstructured )
196196 g .Expect (err ).ToNot (HaveOccurred ())
197197 // Save a copy of modifiedUnstructured before apply to compute the new identifier later
198198 modifiedUnstructuredBeforeApply := modifiedUnstructured .DeepCopy ()
@@ -212,7 +212,7 @@ func TestPatch(t *testing.T) {
212212 err = env .GetScheme ().Convert (objectAfterApply , objectAfterApplyUnstructured , nil )
213213 g .Expect (err ).ToNot (HaveOccurred ())
214214 // Compute the new request identifier (after apply)
215- newRequestIdentifier , err := ComputeRequestIdentifier (env .GetScheme (), objectAfterApplyUnstructured , modifiedUnstructuredBeforeApply )
215+ newRequestIdentifier , err := ComputeRequestIdentifier (env .GetScheme (), objectAfterApplyUnstructured . GetResourceVersion () , modifiedUnstructuredBeforeApply )
216216 g .Expect (err ).ToNot (HaveOccurred ())
217217 // Verify that request was cached with the new identifier (after apply)
218218 g .Expect (ssaCache .Has (newRequestIdentifier , initialObject .GetObjectKind ().GroupVersionKind ().Kind )).To (BeTrue ())
@@ -235,7 +235,7 @@ func TestPatch(t *testing.T) {
235235 // Compute request identifier, so we can later verify that the update call was cached.
236236 modifiedUnstructured , err = prepareModified (env .Scheme (), modifiedObject )
237237 g .Expect (err ).ToNot (HaveOccurred ())
238- requestIdentifierNoOp , err := ComputeRequestIdentifier (env .GetScheme (), originalObject , modifiedUnstructured )
238+ requestIdentifierNoOp , err := ComputeRequestIdentifier (env .GetScheme (), originalObject . GetResourceVersion () , modifiedUnstructured )
239239 g .Expect (err ).ToNot (HaveOccurred ())
240240 // Update the object
241241 countingClient .resetCount ()
0 commit comments