Skip to content

Commit 0c1f971

Browse files
committed
Show pod events on the agent status report page
1 parent a9180d7 commit 0c1f971

File tree

2 files changed

+36
-5
lines changed

2 files changed

+36
-5
lines changed

src/main/java/cd/go/contrib/elasticagent/model/reports/agent/KubernetesPodEvent.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ public String getLastTimestamp() {
2727
return lastTimestamp;
2828
}
2929

30-
public Integer getCount() {
31-
return count;
30+
public String getCount() {
31+
return String.valueOf(count);
3232
}
3333

3434
public String getFieldPath() {

src/main/resources/agent-status-report.template.ftlh

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,41 @@
125125
</div>
126126

127127
<div class="tab">
128-
<input name="agent-information" type="radio" id="checkbox3" class="checkboxtab">
129-
<label for="checkbox3">Tab 3</label>
128+
<input name="agent-information" type="radio" id="pod-events" class="checkboxtab pod-events">
129+
<label for="pod-events">Events</label>
130130
<dl class="content">
131-
This is the content of tab 3
131+
<table>
132+
<thead>
133+
<tr>
134+
<th>First Seen</th>
135+
<th>Last Seen</th>
136+
<th>Count</th>
137+
<th>Path</th>
138+
<th>Type</th>
139+
<th>Reason</th>
140+
<th>Message</th>
141+
</thead>
142+
</tr>
143+
<tbody>
144+
<#if events?size != 0>
145+
<#list events as event>
146+
<tr>
147+
<td>${event.firstTimestamp!}</td>
148+
<td>${event.lastTimestamp!}</td>
149+
<td>${event.count!}</td>
150+
<td>${event.fieldPath!}</td>
151+
<td>${event.type!}</td>
152+
<td>${event.reason!}</td>
153+
<td>${event.message!}</td>
154+
</tr>
155+
</#list>
156+
<#else>
157+
<tr>
158+
<td colspan="5" class="message">No events available for the current pod.</td>
159+
</tr>
160+
</#if>
161+
</tbody>
162+
</table>
132163
</dl>
133164
</div>
134165
</div>

0 commit comments

Comments
 (0)