mirror of
https://github.com/game-ci/unity-builder.git
synced 2025-07-04 12:25:19 -04:00

* feat: streamline code styles * feat: spacing for comments and return statements * chore: enforce camelcase * fix: remove npm lock file * fix: add integrity test * fix: remove logfile * chore: update node in test workflow
19 lines
638 B
TypeScript
19 lines
638 B
TypeScript
import { CoreV1Api } from '@kubernetes/client-node';
|
|
import * as k8s from '@kubernetes/client-node';
|
|
|
|
class KubernetesServiceAccount {
|
|
static async createServiceAccount(serviceAccountName: string, namespace: string, kubeClient: CoreV1Api) {
|
|
const serviceAccount = new k8s.V1ServiceAccount();
|
|
serviceAccount.apiVersion = 'v1';
|
|
serviceAccount.kind = 'ServiceAccount';
|
|
serviceAccount.metadata = {
|
|
name: serviceAccountName,
|
|
};
|
|
serviceAccount.automountServiceAccountToken = false;
|
|
|
|
return kubeClient.createNamespacedServiceAccount(namespace, serviceAccount);
|
|
}
|
|
}
|
|
|
|
export default KubernetesServiceAccount;
|