diff --git a/src/main.ts b/src/main.ts index e7368ca..65792da 100644 --- a/src/main.ts +++ b/src/main.ts @@ -147,7 +147,7 @@ export async function run(): Promise { if (skaffoldFile) { cmd.push('--skaffold-file', skaffoldFile); } - if (deployParameters) { + if (deployParameters && Object.keys(deployParameters).length > 0) { cmd.push('--deploy-parameters', joinKVString(deployParameters)); } diff --git a/tests/unit/main.test.ts b/tests/unit/main.test.ts index 3cdeea7..2240e28 100644 --- a/tests/unit/main.test.ts +++ b/tests/unit/main.test.ts @@ -362,6 +362,16 @@ test('#run', { concurrency: true }, async (suite) => { ]); }); + await suite.test('does not set deploy parameters if not given', async (t) => { + const mocks = defaultMocks(t.mock); + + await run(); + + const execArguments = mocks.getExecOutput.mock.calls?.at(0)?.arguments?.at(1); + assert(execArguments); + assert(!execArguments?.includes('--deploy-parameters')); + }); + await suite.test('sets flags if given', async (t) => { const mocks = defaultMocks(t.mock, { flags: '--flag1=value1 --flag2=value2',