Skip to content

Commit

Permalink
Joshd/kots wait duration (#28)
Browse files Browse the repository at this point in the history
* Adding wait-duration for kots install
---------

Co-authored-by: jdewinne <[email protected]>
  • Loading branch information
jdewinne and jdewinne authored Sep 25, 2023
1 parent f7aca7c commit 28730d6
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 4 deletions.
2 changes: 2 additions & 0 deletions kots-install/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ shared_password ---> kots_install
license_file ---> kots_install
config_values ---> kots_install
namespace ---> kots_install
wait_duration ---> kots_install
```
## Inputs
| Name | Default | Required | Description |
Expand All @@ -26,6 +27,7 @@ namespace ---> kots_install
| license-file | | True | A license.yaml to use |
| config-values | | False | The config values to use |
| namespace | default | False | The namespace to install the application to |
| wait-duration | | False | Timeout to be used while waiting for individual components to be ready. must be in Go duration format (eg: 10s, 2m) (default "2m") |

## Outputs
| Name | Description |
Expand Down
3 changes: 3 additions & 0 deletions kots-install/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
4 changes: 4 additions & 0 deletions kots-install/dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion kots-install/dist/index.js.map

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions kots-install/src/kots.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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();
Expand Down
2 changes: 2 additions & 0 deletions prepare-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ helm_values ---> prepare_cluster
helm_chart_name ---> prepare_cluster
helm_run_preflights ---> prepare_cluster
kots_config_values ---> prepare_cluster
kots_wait_duration ---> prepare_cluster
prepare_cluster ---> cluster_id
prepare_cluster ---> cluster_kubeconfig
```
Expand All @@ -34,6 +35,7 @@ prepare_cluster ---> cluster_kubeconfig
| helm-chart-name | | False | The name of the Helm chart to use |
| helm-run-preflights | true | False | Run preflight checks (true/false) |
| kots-config-values | | False | The KOTS config values to use |
| kots-wait-duration | | False | 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") |

## Outputs
| Name | Description |
Expand Down
6 changes: 5 additions & 1 deletion prepare-cluster/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.'
Expand Down Expand Up @@ -90,10 +93,11 @@ runs:
run-preflights: ${{ inputs.helm-run-preflights }}
- name: Deploy the app with KOTS
if: ${{ inputs.yaml-dir != '' }}
uses: replicatedhq/compatibility-actions/kots-install@v1
uses: replicatedhq/compatibility-actions/kots-install@v1
with:
kubeconfig: ${{ steps.create-cluster.outputs.cluster-kubeconfig }}
app-slug: ${{ inputs.app-slug }}/test-channel
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 }}

0 comments on commit 28730d6

Please sign in to comment.