diff --git a/src/cmd/apply-teams.ts b/src/cmd/apply-teams.ts index 073a9dadd0..643d5ed32d 100644 --- a/src/cmd/apply-teams.ts +++ b/src/cmd/apply-teams.ts @@ -8,7 +8,7 @@ const d = terminal(`cmd:${cmdName}:apply-teams`) export const applyTeams = async (): Promise => { d.info('Deploying team namespaces') - const result = await deployEssential(['team=true']) + const result = await deployEssential(['team=true'], true) if (result) { d.info('Teams applied') diff --git a/src/common/hf.ts b/src/common/hf.ts index 86b96130eb..2e96afe04c 100644 --- a/src/common/hf.ts +++ b/src/common/hf.ts @@ -11,6 +11,7 @@ import { getParsedArgs, HelmArguments } from './yargs' import { ProcessOutputTrimmed, Streams } from './zx-enhance' import { resolve } from 'path' import { existsSync, mkdirSync, writeFileSync } from 'fs' +import { applyServerSide } from './k8s' const replaceHFPaths = (output: string, envDir = env.ENV_DIR): string => output.replaceAll('../env', envDir) export const HF_DEFAULT_SYNC_ARGS = ['sync', '--concurrency=1', '--sync-args', '--disable-openapi-validation --qps=20'] @@ -191,7 +192,7 @@ export const hfTemplate = async ( return template } -export const deployEssential = async (labelOpts: string[] | null = null) => { +export const deployEssential = async (labelOpts: string[] | null = null, force: boolean = false) => { const d = terminal('common:hf:applyEssential') const dir = '/tmp/otomi/' @@ -215,7 +216,7 @@ export const deployEssential = async (labelOpts: string[] | null = null) => { } writeFileSync(templateFile, templateOutput) - await $`kubectl apply --server-side=true -f ${templateFile}` + await applyServerSide(templateFile, force) } return true diff --git a/src/common/runtime-upgrade.ts b/src/common/runtime-upgrade.ts index f876e6d998..97dcf25858 100644 --- a/src/common/runtime-upgrade.ts +++ b/src/common/runtime-upgrade.ts @@ -21,7 +21,7 @@ export async function runtimeUpgrade({ when }: RuntimeUpgradeArgs): Promise