@@ -65,6 +65,43 @@ func TestRecordReconcileReq(t *testing.T) {
6565 t .Expect (obj ).To (HaveStatusLastHandledReconcileAt ("now" ))
6666 },
6767 },
68+ {
69+ name : "empty reconcile annotation value" ,
70+ beforeFunc : func (obj client.Object ) {
71+ annotations := map [string ]string {
72+ meta .ReconcileRequestAnnotation : "" ,
73+ }
74+ obj .SetAnnotations (annotations )
75+ },
76+ afterFunc : func (t * WithT , obj client.Object ) {
77+ t .Expect (obj ).To (HaveStatusLastHandledReconcileAt ("" ))
78+ },
79+ },
80+ {
81+ name : "whitespace-only reconcile annotation value" ,
82+ beforeFunc : func (obj client.Object ) {
83+ annotations := map [string ]string {
84+ meta .ReconcileRequestAnnotation : " " ,
85+ }
86+ obj .SetAnnotations (annotations )
87+ },
88+ afterFunc : func (t * WithT , obj client.Object ) {
89+ t .Expect (obj ).To (HaveStatusLastHandledReconcileAt (" " ))
90+ },
91+ },
92+ {
93+ name : "reconcile annotation overwrites existing status value" ,
94+ beforeFunc : func (obj client.Object ) {
95+ object .SetStatusLastHandledReconcileAt (obj , "old-value" )
96+ annotations := map [string ]string {
97+ meta .ReconcileRequestAnnotation : "new-value" ,
98+ }
99+ obj .SetAnnotations (annotations )
100+ },
101+ afterFunc : func (t * WithT , obj client.Object ) {
102+ t .Expect (obj ).To (HaveStatusLastHandledReconcileAt ("new-value" ))
103+ },
104+ },
68105 }
69106
70107 for _ , tt := range tests {
0 commit comments