diff --git a/src/cli.ts b/src/cli.ts index 9d01a05..de24f6f 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -23,8 +23,8 @@ const main = async () => { ) .parse(process.argv); - const { command } = prog.opts(); - const env = await runner(); + const { command, namespace, configMap } = prog.opts(); + const env = await runner({ namespace, configMap }); if (command) { console.log(`Running command: ${command}\n`); diff --git a/src/main.ts b/src/main.ts index f816635..ef38e9c 100644 --- a/src/main.ts +++ b/src/main.ts @@ -7,6 +7,7 @@ import { portForward } from './port-forward'; export interface RunnerArguments { namespace?: string; + configMap?: string; command?: string; } @@ -25,7 +26,7 @@ export interface RunnerArguments { export const runner = async ( args: RunnerArguments = {}, ): Promise> => { - const { namespace } = args; + const { namespace, configMap } = args; const kc = new k8s.KubeConfig(); kc.loadFromDefault(); @@ -33,7 +34,7 @@ export const runner = async ( const { body: { data }, - } = await core.readNamespacedConfigMap('service-env-config', namespace); + } = await core.readNamespacedConfigMap(configMap, namespace); invariant(data, 'service-env-config was not found'); const environment = new Map();