Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
jsbroks committed Aug 27, 2024
1 parent 54f6f83 commit 3caa1dc
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const TargetAnnotationPieChart: React.FC<{
const targets = api.target.byWorkspaceId.list.useQuery({ workspaceId });
const [showUndefined] = useState(false);
const [annotation] = useState<string | null>(
"kubernetes.io/autoscaling-enabled",
"kubernetes/autoscaling-enabled",
);

const chartData = _.chain(targets.data?.items ?? [])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export const WidgetTargetLabelCount: Widget<{
},
Component: ({ config, updateConfig, isEditMode }) => {
const countUndefined = config.countUndefined ?? false;
const label = config.label ?? "kubernetes.io/autoscaling-enabled";
const label = config.label ?? "kubernetes/autoscaling-enabled";
const { workspaceSlug } = useParams<{ workspaceSlug: string }>();
const workspace = api.workspace.bySlug.useQuery(workspaceSlug);
const targets = api.target.byWorkspaceId.list.useQuery(
Expand Down
5 changes: 3 additions & 2 deletions packages/api/src/router/target.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { SQL, Tx } from "@ctrlplane/db";
import ms from "ms";
import { targetScanQueue } from "src/dispatch";
import { isPresent } from "ts-is-present";
import { z } from "zod";

Expand Down Expand Up @@ -28,6 +27,7 @@ import {
workspace,
} from "@ctrlplane/db/schema";

import { targetScanQueue } from "../dispatch";
import { createTRPCRouter, protectedProcedure } from "../trpc";

const labelGroupRouter = createTRPCRouter({
Expand Down Expand Up @@ -158,10 +158,11 @@ const targetProviderRouter = createTRPCRouter({
.returning()
.then(takeFirst);

console.log("queueing target scan");
await targetScanQueue.add(
tg.id,
{ targetProviderId: tg.id },
{ repeat: { every: ms("5m") } },
{ repeat: { every: ms("5m"), immediately: true } },
);

return { ...tg, config: tgConfig };
Expand Down
13 changes: 0 additions & 13 deletions packages/validators/src/config-file.ts

This file was deleted.

14 changes: 13 additions & 1 deletion packages/validators/src/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,13 @@
export * from "./config-file.js";
import { z } from "zod";

export const configFile = z.object({
deployments: z.array(
z.object({
name: z.string(),
slug: z.string(),
description: z.string().optional(),
system: z.string(),
workspace: z.string(),
}),
),
});

0 comments on commit 3caa1dc

Please sign in to comment.