@@ -2877,6 +2877,29 @@ var _ = Describe("Fake client", func() {
28772877 Expect (len (cms .Items )).To (BeEquivalentTo (1 ))
28782878 })
28792879
2880+ It ("sets resourceVersion on SSA create" , func (ctx SpecContext ) {
2881+ obj := corev1applyconfigurations .
2882+ ConfigMap ("foo" , "default" ).
2883+ WithData (map [string ]string {"some" : "data" })
2884+
2885+ cl := NewClientBuilder ().Build ()
2886+ Expect (cl .Apply (ctx , obj , client .FieldOwner ("foo" ))).NotTo (HaveOccurred ())
2887+ // Ideally we should only test for it to not be empty, realistically we will
2888+ // break ppl if we ever start setting a different value.
2889+ Expect (obj .ResourceVersion ).To (BeEquivalentTo (ptr .To ("1" )))
2890+ })
2891+
2892+ It ("ignores a passed resourceVersion on SSA create" , func (ctx SpecContext ) {
2893+ obj := corev1applyconfigurations .
2894+ ConfigMap ("foo" , "default" ).
2895+ WithData (map [string ]string {"some" : "data" }).
2896+ WithResourceVersion ("1234" )
2897+
2898+ cl := NewClientBuilder ().Build ()
2899+ Expect (cl .Apply (ctx , obj , client .FieldOwner ("foo" ))).NotTo (HaveOccurred ())
2900+ Expect (obj .ResourceVersion ).To (BeEquivalentTo (ptr .To ("1" )))
2901+ })
2902+
28802903 It ("allows to set deletionTimestamp on an object during SSA create" , func (ctx SpecContext ) {
28812904 now := metav1.Time {Time : time .Now ().Round (time .Second )}
28822905 obj := corev1applyconfigurations .
0 commit comments