Skip to content

Commit

Permalink
fix: improve app name detection
Browse files Browse the repository at this point in the history
  • Loading branch information
achauve committed Dec 18, 2023
1 parent 5d73b2c commit 49ec717
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/lib/kube/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ export const deploymentSchema = z.object({
application: z.optional(z.string()),
app: z.optional(z.string()),
component: z.optional(z.string()),
"app.kubernetes.io/name": z.optional(z.string()),
})
),
}),
Expand Down Expand Up @@ -261,6 +262,7 @@ export const cronjobSchema = z.object({
application: z.optional(z.string()),
app: z.optional(z.string()),
component: z.optional(z.string()),
"app.kubernetes.io/name": z.optional(z.string()),
})
),
}),
Expand Down Expand Up @@ -477,6 +479,7 @@ export function getAppLabel(workload: RawDeployment | RawCronjob): string {
meta.labels?.component ||
meta.labels?.application ||
meta.labels?.app ||
meta.labels?.["app.kubernetes.io/name"] ||
meta.name
return appLabel
}

0 comments on commit 49ec717

Please sign in to comment.