From d682667a3ef2ac3e03b9ba9e39aabd36caf89af1 Mon Sep 17 00:00:00 2001 From: Adrian Riobo Date: Fri, 29 Nov 2024 13:05:59 +0100 Subject: [PATCH] [crc-support] fix: issues evaluating params to run remote scripts on non linux envs. This commit also fix the pusher issue with the task filename Signed-off-by: Adrian Riobo --- .github/workflows/crc-support-pusher.yml | 3 +-- crc-support/oci/lib/windows/run.ps1 | 17 ++++------------- crc-support/tkn/task.yaml | 5 ++--- 3 files changed, 7 insertions(+), 18 deletions(-) diff --git a/.github/workflows/crc-support-pusher.yml b/.github/workflows/crc-support-pusher.yml index 82aaf57..a44cf49 100644 --- a/.github/workflows/crc-support-pusher.yml +++ b/.github/workflows/crc-support-pusher.yml @@ -68,7 +68,6 @@ jobs: curl -LO "https://github.com/tektoncd/cli/releases/download/v${TKN_VERSION}/tkn_${TKN_VERSION}_Linux_x86_64.tar.gz" tar xvzf "tkn_${TKN_VERSION}_Linux_x86_64.tar.gz" tkn ./tkn bundle push ${{ env.image }}-tkn \ - -f crc-support-installer.yaml \ - -f crc-support.yaml + -f task.yaml \ No newline at end of file diff --git a/crc-support/oci/lib/windows/run.ps1 b/crc-support/oci/lib/windows/run.ps1 index 65b5186..6dc268b 100644 --- a/crc-support/oci/lib/windows/run.ps1 +++ b/crc-support/oci/lib/windows/run.ps1 @@ -1,23 +1,14 @@ -aBaseURL='' -aName='' -aSHAName='sha256sum.txt' -targetPath='' -freshEnv='true' -download='true' -install='false' - - param( [Parameter(HelpMessage='download base url')] $aBaseURL, [Parameter(HelpMessage='asset name to be downloaded')] $aName, [Parameter(HelpMessage='shasumFile file name Default value: sha256sum.txt')] - $aSHAName="sha256sum.txt", + $aSHAName='sha256sum.txt', [Parameter(Mandatory,HelpMessage='target folder for download')] $targetPath, [Parameter(HelpMessage='force fresh, remove any previous existing instance for crc. Default False')] - $forceFresh='false', + $freshEnv='false', [Parameter(HelpMessage='download if False not download. Default True')] $download='true', [Parameter(HelpMessage='install after downloading if False not install. Default False')] @@ -87,10 +78,10 @@ $latestPath="$HOME\OpenshiftLocal\crc\latest" # Transform params to bool $install = If ($install -eq 'true') {$true} Else {$false} $download = If ($download -eq 'true') {$true} Else {$false} -$forceFresh = If ($forceFresh -eq 'true') {$true} Else {$false} +$freshEnv = If ($freshEnv -eq 'true') {$true} Else {$false} # FORCE FRESH -if ($forceFresh) { +if ($freshEnv) { Force-Fresh-Environment } diff --git a/crc-support/tkn/task.yaml b/crc-support/tkn/task.yaml index 27e2394..18cd0c3 100644 --- a/crc-support/tkn/task.yaml +++ b/crc-support/tkn/task.yaml @@ -104,7 +104,7 @@ spec: runner="run.ps1" fi # Path for assets on remote target - tPath='/Users/${TARGET_HOST_USERNAME}/OpenshiftLocal' + tPath="/Users/${TARGET_HOST_USERNAME}/OpenshiftLocal" if [[ $(params.os) == 'linux' ]]; then tPath="/home/${TARGET_HOST_USERNAME}/OpenshiftLocal" fi @@ -114,7 +114,7 @@ spec: nameArr=(${name//_/ }) tPath+="/bundle/${nameArr[2]}" else - tPath+='/crc/$(params.crc-version)' + tPath+="/crc/$(params.crc-version)" fi @@ -125,7 +125,6 @@ spec: cmd+="-freshEnv $(params.force-fresh) " cmd+="-download $(params.download) " cmd+="-install $(params.install) " - cmd+="-debug $(params.debug) " # Exec . entrypoint.sh "${cmd}"