From da42d20f9fca1d39406e2643333cbbdc42d38ee3 Mon Sep 17 00:00:00 2001 From: Josh De Winne Date: Mon, 25 Sep 2023 11:51:57 -0700 Subject: [PATCH] Adding wait-duration for kots install --- kots-install/action.yml | 3 +++ kots-install/src/kots.ts | 8 ++++++-- prepare-cluster/action.yml | 4 ++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/kots-install/action.yml b/kots-install/action.yml index 5f5ef60..0f08c42 100644 --- a/kots-install/action.yml +++ b/kots-install/action.yml @@ -27,6 +27,9 @@ inputs: description: 'The namespace to install the application to' default: "default" required: false + wait-duration: + description: 'Timeout to be used while waiting for individual components to be ready. must be in Go duration format (eg: 10s, 2m) (default "2m")' + required: false runs: using: 'node16' main: 'dist/index.js' diff --git a/kots-install/src/kots.ts b/kots-install/src/kots.ts index 90fc6bd..67a8427 100644 --- a/kots-install/src/kots.ts +++ b/kots-install/src/kots.ts @@ -78,6 +78,7 @@ export async function installApp(kotsPath: string, licenseFilePath: string, conf const slug = core.getInput('app-slug'); const appVersionLabel = core.getInput('app-version-label'); const namespace = core.getInput('namespace'); + const waitDuration = core.getInput('wait-duration'); // write the kubeconfig to a temp file const { fd , path: kubeconfigPath , cleanup } = await (0, tmpPromise.file)({ postfix: '.yaml' @@ -107,10 +108,13 @@ export async function installApp(kotsPath: string, licenseFilePath: string, conf params.push("--license-file", licenseFilePath) params.push("--kubeconfig", kubeconfigPath) if (configFilePath !== '') { - params.push("--config-values", configFilePath); + params.push("--config-values", configFilePath); } if (appVersionLabel) { - params.push("--app-version-label", appVersionLabel); + params.push("--app-version-label", appVersionLabel); + } + if (waitDuration) { + params.push("--wait-duration", waitDuration); } await exec.exec(kotsPath, params, installOptions); cleanup(); diff --git a/prepare-cluster/action.yml b/prepare-cluster/action.yml index 0d5eae3..b4a20b4 100644 --- a/prepare-cluster/action.yml +++ b/prepare-cluster/action.yml @@ -37,6 +37,9 @@ inputs: kots-config-values: description: 'The KOTS config values to use' required: false + kots-wait-duration: + description: 'Timeout for KOTS to be used while waiting for individual components to be ready. must be in Go duration format (eg: 10s, 2m) (default "2m")' + required: false outputs: cluster-id: # id of the cluster description: 'Contains the cluster id.' @@ -97,3 +100,4 @@ runs: license-file: ${{ steps.create-customer.outputs.license-file }} app-version-label: release__${{ steps.create-release.outputs.release-sequence }} config-values: ${{ inputs.kots-config-values }} + wait-duration: ${{ inputs.kots-wait-duration }}