@@ -178,9 +178,10 @@ var _ = Describe("ServerMaintenance Controller", func() {
178178 HaveField ("Status.State" , metalv1alpha1 .ServerMaintenanceStatePending ),
179179 ))
180180
181- By ("Ensuring that the ServerClaim has the maintenance needed annotation" )
181+ By ("Ensuring that the ServerClaim has the maintenance needed label and annotation" )
182182 Eventually (Object (serverClaim )).Should (SatisfyAll (
183183 HaveField ("ObjectMeta.Annotations" , HaveKeyWithValue (metalv1alpha1 .ServerMaintenanceNeededLabelKey , "true" )),
184+ HaveField ("ObjectMeta.Labels" , HaveKeyWithValue (metalv1alpha1 .ServerMaintenanceNeededLabelKey , "true" )),
184185 ))
185186
186187 By ("Checking the Server is not in maintenance" )
@@ -193,11 +194,14 @@ var _ = Describe("ServerMaintenance Controller", func() {
193194 metautils .SetAnnotation (serverClaim , metalv1alpha1 .ServerMaintenanceApprovalKey , "true" )
194195 })).Should (Succeed ())
195196
196- maintenanceLabels := map [string ]string {
197+ maintenanceAnnotations := map [string ]string {
197198 metalv1alpha1 .ServerMaintenanceNeededLabelKey : "true" ,
198199 metalv1alpha1 .ServerMaintenanceReasonAnnotationKey : "test-maintenance" ,
199200 metalv1alpha1 .ServerMaintenanceApprovalKey : "true" ,
200201 }
202+ maintenanceLabels := map [string ]string {
203+ metalv1alpha1 .ServerMaintenanceNeededLabelKey : "true" ,
204+ }
201205 Eventually (Object (server )).Should (SatisfyAll (
202206 HaveField ("Spec.ServerMaintenanceRef.Name" , serverMaintenance .Name ),
203207 HaveField ("Spec.MaintenanceBootConfigurationRef" , Not (BeNil ())),
@@ -222,9 +226,10 @@ var _ = Describe("ServerMaintenance Controller", func() {
222226 HaveField ("Status.State" , metalv1alpha1 .ServerStateMaintenance ),
223227 ))
224228
225- By ("Checking the ServerClaim has the maintenance labels" )
229+ By ("Checking the ServerClaim has the maintenance labels and annotations " )
226230 Eventually (Object (serverClaim )).Should (SatisfyAll (
227- HaveField ("ObjectMeta.Annotations" , maintenanceLabels ),
231+ HaveField ("ObjectMeta.Annotations" , maintenanceAnnotations ),
232+ HaveField ("ObjectMeta.Labels" , maintenanceLabels ),
228233 ))
229234
230235 By ("Checking the ServerMaintenance is in maintenance" )
@@ -245,6 +250,7 @@ var _ = Describe("ServerMaintenance Controller", func() {
245250 By ("Checking the ServerClaim is cleaned up" )
246251 Eventually (Object (serverClaim )).Should (SatisfyAll (
247252 HaveField ("ObjectMeta.Annotations" , Not (HaveKey (metalv1alpha1 .ServerMaintenanceNeededLabelKey ))),
253+ HaveField ("ObjectMeta.Labels" , Not (HaveKey (metalv1alpha1 .ServerMaintenanceNeededLabelKey ))),
248254 ))
249255
250256 By ("Deleting the ServerClaim" )
0 commit comments