Skip to content

Commit

Permalink
clean up and fix
Browse files Browse the repository at this point in the history
  • Loading branch information
zacharyblasczyk committed Nov 27, 2024
1 parent 91f56af commit 810cc1e
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 4,865 deletions.
7 changes: 0 additions & 7 deletions apps/docs/pages/integrations/google-cloud/compute-scanner.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,3 @@ scanner.

| Environment Variable | Description | Required | Default |
| :------------------- | :---------- | -------- | ------- |

Unable to get clusters for project: wandb-ctrlplane - Missing required
permissions. Please ensure the service account has the "Service Account Token
Creator" and "GKE Cluster Viewer (Kubernetes Engine Cluster Viewer)" roles


aws sso login --profile=AWSAdministratorAccess-770934259321
9 changes: 8 additions & 1 deletion apps/event-worker/src/target-scan/eks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,14 @@ export const getEksResources = async (
)
.thru((promises) => Promise.all(promises))
.value()
.then((results) => results.flat());
.then((results) => results.flat())
.then((resources) =>
resources.map((resource) => ({
...resource,
workspaceId: workspace.id,
providerId: config.resourceProviderId,
})),
);

const resourceTypes = _.countBy(resources, (resource) =>
[resource.kind, resource.version].join("/"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import {
import {
Form,
FormControl,
FormDescription,
FormField,
FormItem,
FormLabel,
Expand All @@ -33,7 +32,6 @@ import {
} from "@ctrlplane/ui/form";
import { Input } from "@ctrlplane/ui/input";
import { Label } from "@ctrlplane/ui/label";
import { Switch } from "@ctrlplane/ui/switch";

import { api } from "~/trpc/react";

Expand All @@ -49,9 +47,6 @@ export const createAwsSchema = z.object({
),
}),
),
importEks: z.boolean().default(false),
importNamespaces: z.boolean().default(false),
importVCluster: z.boolean().default(false),
});

export const AwsDialog: React.FC<{
Expand All @@ -63,9 +58,6 @@ export const AwsDialog: React.FC<{
defaultValues: {
name: "",
awsRoleArns: [{ value: "" }],
importEks: true,
importNamespaces: false,
importVCluster: false,
},
mode: "onSubmit",
});
Expand Down Expand Up @@ -93,9 +85,6 @@ export const AwsDialog: React.FC<{
workspaceId: workspace.id,
config: {
awsRoleArns: data.awsRoleArns.map((a) => a.value),
importEks: data.importEks,
importVCluster: data.importVCluster,
importNamespaces: data.importNamespaces,
},
});
await utils.resource.provider.byWorkspaceId.invalidate();
Expand Down Expand Up @@ -181,7 +170,7 @@ export const AwsDialog: React.FC<{
render={({ field }) => (
<FormItem>
<FormLabel className={cn(index !== 0 && "sr-only")}>
AWS Account IDs
AWS Role ARNs
</FormLabel>
<FormControl>
<Input
Expand All @@ -201,32 +190,10 @@ export const AwsDialog: React.FC<{
className="mt-4"
onClick={() => append({ value: "" })}
>
Add Project
Add Role ARN
</Button>
</div>

<FormField
control={form.control}
name="importEks"
render={({ field }) => (
<FormItem className="flex flex-row items-center justify-between rounded-lg border p-4">
<div className="space-y-0.5">
<FormLabel>Import EKS Clusters</FormLabel>
<FormDescription>
Enable importing of Amazon Elastic Kubernetes Service
(EKS) clusters
</FormDescription>
</div>
<FormControl>
<Switch
checked={field.value}
onCheckedChange={field.onChange}
/>
</FormControl>
</FormItem>
)}
/>

<DialogFooter>
<Button type="submit">Create</Button>
</DialogFooter>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import {
import {
Form,
FormControl,
FormDescription,
FormField,
FormItem,
FormLabel,
Expand All @@ -33,7 +32,6 @@ import {
} from "@ctrlplane/ui/form";
import { Input } from "@ctrlplane/ui/input";
import { Label } from "@ctrlplane/ui/label";
import { Switch } from "@ctrlplane/ui/switch";

import { api } from "~/trpc/react";
import { createAwsSchema } from "./AwsDialog";
Expand Down Expand Up @@ -73,9 +71,6 @@ export const UpdateAwsProviderDialog: React.FC<{
resourceProviderId: providerId,
config: {
awsRoleArns: data.awsRoleArns.map((a) => a.value),
importEks: data.importEks,
importVCluster: data.importVCluster,
importNamespaces: data.importNamespaces,
},
repeatSeconds: data.repeatSeconds === 0 ? null : data.repeatSeconds,
});
Expand Down Expand Up @@ -227,28 +222,6 @@ export const UpdateAwsProviderDialog: React.FC<{
</Button>
</div>

<FormField
control={form.control}
name="importEks"
render={({ field }) => (
<FormItem className="flex flex-row items-center justify-between rounded-lg border p-4">
<div className="space-y-0.5">
<FormLabel>Import EKS Clusters</FormLabel>
<FormDescription>
Enable importing of Amazon Elastic Kubernetes Service
(EKS) clusters
</FormDescription>
</div>
<FormControl>
<Switch
checked={field.value}
onCheckedChange={field.onChange}
/>
</FormControl>
</FormItem>
)}
/>

<FormField
control={form.control}
name="repeatSeconds"
Expand Down
15 changes: 0 additions & 15 deletions packages/db/drizzle/0043_wild_talon.sql

This file was deleted.

Loading

0 comments on commit 810cc1e

Please sign in to comment.