Skip to content

Commit

Permalink
[crc-support] fix: issues evaluating params to run remote scripts on …
Browse files Browse the repository at this point in the history
…non linux envs.

This commit also fix the pusher issue with the task filename

Signed-off-by: Adrian Riobo <[email protected]>
  • Loading branch information
adrianriobo committed Nov 29, 2024
1 parent a2bff80 commit d682667
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 18 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/crc-support-pusher.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
17 changes: 4 additions & 13 deletions crc-support/oci/lib/windows/run.ps1
Original file line number Diff line number Diff line change
@@ -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')]
Expand Down Expand Up @@ -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
}

Expand Down
5 changes: 2 additions & 3 deletions crc-support/tkn/task.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -114,7 +114,7 @@ spec:
nameArr=(${name//_/ })
tPath+="/bundle/${nameArr[2]}"
else
tPath+='/crc/$(params.crc-version)'
tPath+="/crc/$(params.crc-version)"
fi
Expand All @@ -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}"
Expand Down

0 comments on commit d682667

Please sign in to comment.