File tree Expand file tree Collapse file tree 1 file changed +5
-10
lines changed
staging/src/k8s.io/kubectl/pkg/describe Expand file tree Collapse file tree 1 file changed +5
-10
lines changed Original file line number Diff line number Diff line change @@ -3873,11 +3873,15 @@ func DescribeEvents(el *corev1.EventList, w PrefixWriter) {
3873
3873
interval = translateMicroTimestampSince (e .EventTime )
3874
3874
}
3875
3875
}
3876
+ source := e .Source .Component
3877
+ if source == "" {
3878
+ source = e .ReportingController
3879
+ }
3876
3880
w .Write (LEVEL_1 , "%v\t %v\t %s\t %v\t %v\n " ,
3877
3881
e .Type ,
3878
3882
e .Reason ,
3879
3883
interval ,
3880
- formatEventSource ( e . Source ) ,
3884
+ source ,
3881
3885
strings .TrimSpace (e .Message ),
3882
3886
)
3883
3887
}
@@ -5001,15 +5005,6 @@ func translateTimestampSince(timestamp metav1.Time) string {
5001
5005
return duration .HumanDuration (time .Since (timestamp .Time ))
5002
5006
}
5003
5007
5004
- // formatEventSource formats EventSource as a comma separated string excluding Host when empty
5005
- func formatEventSource (es corev1.EventSource ) string {
5006
- EventSourceString := []string {es .Component }
5007
- if len (es .Host ) > 0 {
5008
- EventSourceString = append (EventSourceString , es .Host )
5009
- }
5010
- return strings .Join (EventSourceString , ", " )
5011
- }
5012
-
5013
5008
// Pass ports=nil for all ports.
5014
5009
func formatEndpoints (endpoints * corev1.Endpoints , ports sets.String ) string {
5015
5010
if len (endpoints .Subsets ) == 0 {
You can’t perform that action at this time.
0 commit comments