@@ -218,9 +218,10 @@ func (c *targetHealthController) reconcilePodCondition(ctx context.Context, cond
218
218
if cond == nil {
219
219
// new condition
220
220
targetHealthCondition := api.PodCondition {
221
- Type : conditionType ,
222
- Status : conditionStatus ,
223
- Reason : podConditionReason (targetHealth ),
221
+ Type : conditionType ,
222
+ Status : conditionStatus ,
223
+ Reason : aws .StringValue (targetHealth .Reason ),
224
+ Message : aws .StringValue (targetHealth .Description ),
224
225
}
225
226
if updateTimes {
226
227
targetHealthCondition .LastProbeTime = now
@@ -236,7 +237,8 @@ func (c *targetHealthController) reconcilePodCondition(ctx context.Context, cond
236
237
}
237
238
}
238
239
cond .Status = conditionStatus
239
- cond .Reason = podConditionReason (targetHealth )
240
+ cond .Reason = aws .StringValue (targetHealth .Reason )
241
+ cond .Message = aws .StringValue (targetHealth .Description )
240
242
pod .Status .Conditions [i ] = * cond
241
243
}
242
244
@@ -316,16 +318,6 @@ func podHasReadinessGate(pod *api.Pod, conditionType api.PodConditionType) bool
316
318
return false
317
319
}
318
320
319
- func podConditionReason (targetHealth * elbv2.TargetHealth ) string {
320
- if targetHealth .Reason != nil {
321
- if targetHealth .Description != nil {
322
- return fmt .Sprintf ("%s: %s" , aws .StringValue (targetHealth .Reason ), aws .StringValue (targetHealth .Description ))
323
- }
324
- return aws .StringValue (targetHealth .Reason )
325
- }
326
- return ""
327
- }
328
-
329
321
func podConditionForReadinessGate (pod * api.Pod , conditionType api.PodConditionType ) (int , * api.PodCondition ) {
330
322
for i , condition := range pod .Status .Conditions {
331
323
if condition .Type == conditionType {
0 commit comments