Skip to content

Commit 72ce764

Browse files
authored
fixed formating of event date
1 parent 188d219 commit 72ce764

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ await new Command()
55
.name('cf-support')
66
.version('__APP_VERSION__')
77
.description('Tool to gather information for Codefresh Support')
8-
.action( function () {
8+
.action(function () {
99
this.showHelp();
1010
})
1111
.command(

src/logic/core.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export async function processData(dirPath, k8sResources) {
2424
const resources = await fetcher();
2525

2626
if (!resources) {
27-
continue
27+
continue;
2828
}
2929

3030
if (k8sType == 'pods') {
@@ -46,7 +46,9 @@ export async function processData(dirPath, k8sResources) {
4646

4747
if (k8sType == 'events.k8s.io') {
4848
const formattedEvents = resources.items.map((event) => {
49-
const lastSeen = event.metadata.creationTimestamp || 'Invalid Date';
49+
const lastSeen = event.metadata.creationTimestamp
50+
? new Date(event.metadata.creationTimestamp).toISOString()
51+
: 'Invalid Date';
5052
const type = event.type || 'Unknown';
5153
const reason = event.reason || 'Unknown';
5254
const object = `${event.involvedObject.kind}/${event.involvedObject.name}`;
@@ -63,7 +65,6 @@ export async function processData(dirPath, k8sResources) {
6365
continue;
6466
}
6567

66-
6768
resources.items.map((data) => {
6869
delete data.metadata.managedFields;
6970
writeYaml(data, `${data.metadata.name}_get`, `${dirPath}/${k8sType}`);

0 commit comments

Comments
 (0)