Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions frontend/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ module.exports = {
rules: {
'no-console': 'off',
'no-empty-pattern': 'off',
// Disable React Testing Library rules for Playwright tests
'testing-library/prefer-screen-queries': 'off',
},
},
],
Expand Down
34 changes: 34 additions & 0 deletions frontend/e2e/clients/kubernetes-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,15 @@ export default class KubernetesClient {
}
}

async patchSecret(name: string, namespace: string, patch: object[]): Promise<void> {
await this.k8sApi.patchNamespacedSecret({
name,
namespace,
body: patch,
contentType: k8s.PatchStrategy.JsonPatch,
} as any);
}

async deleteSecret(name: string, namespace: string): Promise<void> {
try {
await this.k8sApi.deleteNamespacedSecret({ name, namespace });
Expand Down Expand Up @@ -471,4 +480,29 @@ export default class KubernetesClient {
const response = await this.k8sApi.listNamespacedPod({ namespace });
return response.items || [];
}

async createProject(name: string, labels?: Record<string, string>): Promise<void> {
await this.createNamespace(name, labels);
}

async deleteProject(name: string): Promise<void> {
await this.deleteNamespace(name);
}

async createPod(pod: k8s.V1Pod): Promise<void> {
await this.k8sApi.createNamespacedPod({
namespace: pod.metadata!.namespace!,
body: pod,
});
}

async deletePod(name: string, namespace: string): Promise<void> {
try {
await this.k8sApi.deleteNamespacedPod({ name, namespace });
} catch (err) {
if (!isNotFound(err)) {
throw err;
}
}
}
}
Loading