Skip to content
This repository has been archived by the owner on Oct 9, 2024. It is now read-only.

Commit

Permalink
INT-9220: migrate to client singleton pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
gastonyelmini committed Sep 25, 2023
1 parent 6ff9cc2 commit db2963c
Show file tree
Hide file tree
Showing 28 changed files with 613 additions and 697 deletions.
11 changes: 4 additions & 7 deletions src/getStepStartStates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,15 @@ import {
StepStartStates,
} from '@jupiterone/integration-sdk-core';
import { IntegrationConfig } from './config';
import {
AuthorizationClient,
ResourceType,
VerbType,
} from './kubernetes/clients/authorization';
import { IntegrationSteps } from './steps/constants';
import { validateInvocation } from './validator';
import getOrCreateAPIClient from './kubernetes/getOrCreateAPIClient';
import { Client, ResourceType, VerbType } from './kubernetes/client';

async function getServiceState(
resource: ResourceType,
verb: VerbType,
client: AuthorizationClient,
client: Client,
) {
const serviceAccess = await client.fetchSubjectServiceAccess(resource, verb);

Expand All @@ -29,7 +26,7 @@ export default async function getStepStartStates(
const { instance, logger } = context;
const { config } = instance;

const client = new AuthorizationClient(config);
const client = getOrCreateAPIClient(config);

try {
const [
Expand Down
Loading

0 comments on commit db2963c

Please sign in to comment.