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

INT-7964: migrate to client singleton pattern #57

Merged
merged 2 commits into from
Oct 2, 2023
Merged
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
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
Loading