Skip to content

Commit

Permalink
Debug update app
Browse files Browse the repository at this point in the history
  • Loading branch information
adb-sh committed Jul 21, 2024
1 parent 82b392b commit 8817604
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 13 deletions.
4 changes: 0 additions & 4 deletions src/components/cloud/CreateServiceForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,6 @@ export const CreateServiceForm = () => {
<input type="radio" name="my-accordion-2" />
<div class="collapse-title text-xl font-medium">Resources</div>
<div class="collapse-content">
<label class="cursor-pointer label">
<input type="checkbox" class="toggle toggle-primary" checked />
<span class="label-text">cutomize</span>
</label>
<ResourcesInput />
</div>
</div>
Expand Down
18 changes: 17 additions & 1 deletion src/knative.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,9 @@ export class Knative {
}

async updateService(name: string, service: Service, namespace: string) {
const { body } = await this.customObjectsApi.patchNamespacedCustomObject(
const currentService = await this.getService(name, namespace);

const { body } = await this.customObjectsApi.replaceNamespacedCustomObject(
"serving.knative.dev",
"v1",
namespace,
Expand All @@ -175,6 +177,17 @@ export class Knative {
{
apiVersion: "serving.knative.dev/v1",
kind: "Service",
metadata: {
name: service.name,
namespace: namespace,
labels: {
"app.kubernetes.io/managed-by": "deploycat",
},
annotations: {
...currentService.raw.metadata.annotations,
},
resourceVersion: currentService.raw.metadata.resourceVersion,
},
spec: {
template: {
metadata: {
Expand All @@ -190,6 +203,7 @@ export class Knative {
},
},
spec: {
containerConcurrency: 0,
containers: [
{
image: service.image,
Expand Down Expand Up @@ -222,6 +236,8 @@ export class Knative {
})),
},
],
enableServiceLinks: false,
timeoutSeconds: 300,
},
},
},
Expand Down
15 changes: 7 additions & 8 deletions src/routes/cloud/apps/[app].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,21 +117,20 @@ export default (props: RouteSectionProps) => {
<form action={updateServiceAction} method="post">
<div class="flex flex-wrap flex-row gap-2 my-2">
<div class="collapse collapse-arrow bg-base-200 w-96 max-w-lg grow">
<input type="checkbox" />
<input type="checkbox" checked />
{/* <input type="radio" name="my-accordion-2" checked={true} /> */}
<div class="collapse-title text-xl font-medium">General</div>
<div class="collapse-content">
<label class="form-control w-full">
<div class="label">
{/* <div class="label">
<span class="label-text">Name</span>
</div>
</div> */}
<input
type="text"
type="hidden"
name="name"
required
value={service()?.name}
class="input input-bordered w-full"
disabled
/>
</label>
<label class="form-control w-full">
Expand Down Expand Up @@ -161,7 +160,7 @@ export default (props: RouteSectionProps) => {
</div>
</div>
<div class="collapse collapse-arrow bg-base-200 w-96 max-w-lg grow">
<input type="checkbox" />
<input type="checkbox" checked />
{/* <input type="radio" name="my-accordion-2" /> */}
<div class="collapse-title text-xl font-medium">
Environment
Expand All @@ -172,15 +171,15 @@ export default (props: RouteSectionProps) => {
</div>
<div class="collapse collapse-arrow bg-base-200 w-96 max-w-lg grow">
{/* <input type="radio" name="my-accordion-2" /> */}
<input type="checkbox" />
<input type="checkbox" checked />
<div class="collapse-title text-xl font-medium">Resources</div>
<div class="collapse-content">
<ResourcesInput data={service()?.resources} />
</div>
</div>
<div class="collapse collapse-arrow bg-base-200 w-96 max-w-lg grow">
{/* <input type="radio" name="my-accordion-2" /> */}
<input type="checkbox" />
<input type="checkbox" checked />
<div class="collapse-title text-xl font-medium">Scaling</div>
<div class="collapse-content">
<ScalingInput data={service()?.scaling} />
Expand Down

0 comments on commit 8817604

Please sign in to comment.