Skip to content

Commit

Permalink
only use application workload-kind nodes for resources (#3768)
Browse files Browse the repository at this point in the history
  • Loading branch information
Feroze Mohideen authored Oct 9, 2023
1 parent 7f337b6 commit fa083a2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions dashboard/src/lib/hooks/useClusterResourceLimits.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import api from "shared/api";
const clusterDataValidator = z.object({
labels: z.object({
"beta.kubernetes.io/instance-type": z.string().nullish(),
"porter.run/workload-kind": z.string().nullish(),
}).optional(),
}).transform((data) => {
const defaultResources = {
Expand All @@ -17,6 +18,10 @@ const clusterDataValidator = z.object({
if (!data.labels) {
return defaultResources;
}
const workloadKind = data.labels["porter.run/workload-kind"];
if (!workloadKind || workloadKind !== "application") {
return defaultResources;
}
const instanceType = data.labels["beta.kubernetes.io/instance-type"];
const res = z.tuple([z.string(), z.string()]).safeParse(instanceType?.split("."))
if (!res.success) {
Expand Down

0 comments on commit fa083a2

Please sign in to comment.