@@ -245,7 +245,7 @@ func (c *TridentCrdController) handleTridentMirrorRelationship(keyItem *KeyItem)
245245 }
246246 } else {
247247 Logx (ctx ).WithFields (logFields ).WithField ("reason" , reason ).Debug ("Invalid TridentMirrorRelationship provided." )
248- c .recorder .Eventf (mirrorRCopy , corev1 .EventTypeWarning , netappv1 .MirrorStateInvalid , reason )
248+ c .recorder .Eventf (mirrorRCopy , corev1 .EventTypeWarning , netappv1 .MirrorStateInvalid , "%s" , reason )
249249
250250 if len (mirrorRCopy .Status .Conditions ) > 0 {
251251 // For now, we only allow a single volumeMapping which should map to a single status condition
@@ -424,7 +424,7 @@ func (c *TridentCrdController) handleIndividualVolumeMapping(
424424 "Could not find volume at volume handle: %v" , localPV .Spec .CSI .VolumeHandle ,
425425 )
426426 Logx (ctx ).WithFields (logFields ).Debug (statusCondition .Message )
427- c .recorder .Eventf (relationship , corev1 .EventTypeWarning , netappv1 .MirrorStateFailed , statusCondition .Message )
427+ c .recorder .Eventf (relationship , corev1 .EventTypeWarning , netappv1 .MirrorStateFailed , "%s" , statusCondition .Message )
428428 return updateTMRConditionLocalFields (statusCondition , localPVCName , volumeMapping .RemoteVolumeHandle )
429429 }
430430
@@ -435,14 +435,14 @@ func (c *TridentCrdController) handleIndividualVolumeMapping(
435435 statusCondition .Message = "Error checking if localPVC's backend can support mirroring"
436436 Logx (ctx ).WithFields (logFields ).WithField ("PVC" , localPVCName ).WithError (err ).Error (statusCondition .Message )
437437 c .recorder .Eventf (
438- relationship , corev1 .EventTypeWarning , netappv1 .MirrorStateFailed , statusCondition .Message )
438+ relationship , corev1 .EventTypeWarning , netappv1 .MirrorStateFailed , "%s" , statusCondition .Message )
439439 return updateTMRConditionLocalFields (statusCondition , localPVCName , volumeMapping .RemoteVolumeHandle )
440440 } else if ! mirrorCapable {
441441 statusCondition .MirrorState = netappv1 .MirrorStateInvalid
442442 statusCondition .Message = "localPVC's backend does not support mirroring"
443443 Logx (ctx ).WithFields (logFields ).WithField ("PVC" , localPVCName ).Warn (statusCondition .Message )
444444 c .recorder .Eventf (
445- relationship , corev1 .EventTypeWarning , netappv1 .MirrorStateInvalid , statusCondition .Message )
445+ relationship , corev1 .EventTypeWarning , netappv1 .MirrorStateInvalid , "%s" , statusCondition .Message )
446446 return updateTMRConditionLocalFields (statusCondition , localPVCName , volumeMapping .RemoteVolumeHandle )
447447 }
448448 }
@@ -496,7 +496,7 @@ func (c *TridentCrdController) handleIndividualVolumeMapping(
496496 statusCondition .Message = "Could not establish mirror"
497497 Logx (ctx ).WithFields (logFields ).WithError (err ).Error (statusCondition .Message )
498498 c .recorder .Eventf (
499- relationship , corev1 .EventTypeWarning , netappv1 .MirrorStateFailed , statusCondition .Message ,
499+ relationship , corev1 .EventTypeWarning , netappv1 .MirrorStateFailed , "%s" , statusCondition .Message ,
500500 )
501501 } else if api .IsNotReadyError (err ) {
502502 update , _ := updateTMRConditionLocalFields (statusCondition , localPVCName ,
@@ -521,7 +521,7 @@ func (c *TridentCrdController) handleIndividualVolumeMapping(
521521 statusCondition .Message = "Could not reestablish mirror"
522522 Logx (ctx ).WithFields (logFields ).WithError (err ).Error (statusCondition .Message )
523523 c .recorder .Eventf (
524- relationship , corev1 .EventTypeWarning , netappv1 .MirrorStateFailed , statusCondition .Message ,
524+ relationship , corev1 .EventTypeWarning , netappv1 .MirrorStateFailed , "%s" , statusCondition .Message ,
525525 )
526526 } else {
527527 // If we performed an action, get new mirror state
@@ -543,7 +543,7 @@ func (c *TridentCrdController) handleIndividualVolumeMapping(
543543 statusCondition .Message = "Could not promote mirror"
544544 Logx (ctx ).WithFields (logFields ).WithError (err ).Error (statusCondition .Message )
545545 c .recorder .Eventf (
546- relationship , corev1 .EventTypeWarning , netappv1 .MirrorStateFailed , statusCondition .Message ,
546+ relationship , corev1 .EventTypeWarning , netappv1 .MirrorStateFailed , "%s" , statusCondition .Message ,
547547 )
548548 } else if api .IsNotReadyError (err ) {
549549 update , _ := updateTMRConditionLocalFields (statusCondition , localPVCName ,
@@ -566,7 +566,7 @@ func (c *TridentCrdController) handleIndividualVolumeMapping(
566566 statusCondition .MirrorState = netappv1 .MirrorStateInvalid
567567 statusCondition .Message = err .Error ()
568568 Logx (ctx ).WithFields (logFields ).WithField ("PVC" , localPVCName ).Error (err )
569- c .recorder .Eventf (relationship , corev1 .EventTypeWarning , netappv1 .MirrorStateInvalid , statusCondition .Message )
569+ c .recorder .Eventf (relationship , corev1 .EventTypeWarning , netappv1 .MirrorStateInvalid , "%s" , statusCondition .Message )
570570 return updateTMRConditionLocalFields (statusCondition , localPVCName , volumeMapping .RemoteVolumeHandle )
571571 }
572572
0 commit comments