Skip to content

Commit

Permalink
fix: problems after last change
Browse files Browse the repository at this point in the history
  • Loading branch information
simenandre committed Aug 9, 2021
1 parent c3ef34a commit ad5b3a4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`);
Expand Down
5 changes: 3 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { portForward } from './port-forward';

export interface RunnerArguments {
namespace?: string;
configMap?: string;
command?: string;
}

Expand All @@ -25,15 +26,15 @@ export interface RunnerArguments {
export const runner = async (
args: RunnerArguments = {},
): Promise<Record<string, string>> => {
const { namespace } = args;
const { namespace, configMap } = args;

const kc = new k8s.KubeConfig();
kc.loadFromDefault();
const core = kc.makeApiClient(k8s.CoreV1Api);

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();
Expand Down

0 comments on commit ad5b3a4

Please sign in to comment.