Skip to content

Commit af9f142

Browse files
Merge pull request #801 from puppetlabs/CAT-2413-2
(CAT-2413) Install tasks require version to install on MacOS/Windows
2 parents 2d9c1a7 + 8833880 commit af9f142

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

tasks/install_powershell.ps1

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,9 @@ if (($collection -like '*puppetcore*-nightly*') -And -Not ($PSBoundParameters.Co
122122
$windows_source = 'https://nightlies.puppet.com/downloads'
123123
} elseif (($collection -like '*puppetcore*') -And -Not ($PSBoundParameters.ContainsKey('windows_source'))) {
124124
$windows_source = 'https://artifacts-puppetcore.puppet.com/v1/download'
125+
if ($version -eq "" -Or !$version) {
126+
Throw "You must provide a version to install the agent from puppetcore on Windows/MacOS."
127+
}
125128
}
126129

127130
if ($absolute_source) {

tasks/install_shell.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -841,11 +841,15 @@ case $platform in
841841
arch="arm64"
842842
fi
843843
if [[ "$collection" =~ "puppetcore" ]]; then
844+
if [[ -z "$version" ]]; then
845+
critical "You must provide a version to install the agent from puppetcore on MacOS/Windows."
846+
exit 1
847+
fi
844848
dots=$(echo "${version}" | grep -o '\.' | wc -l)
845849
if (( dots >= 3 )); then
846-
download_url="${mac_source}?version=${version}&os_name=osx&os_version=${platform_version}&os_arch=${arch}&dev=true"
850+
download_url="${mac_source}?type=native&version=${version}&os_name=osx&os_version=${platform_version}&os_arch=${arch}&dev=true"
847851
else
848-
download_url="${mac_source}?version=${version}&os_name=osx&os_version=${platform_version}&os_arch=${arch}"
852+
download_url="${mac_source}?type=native&version=${version}&os_name=osx&os_version=${platform_version}&os_arch=${arch}"
849853
fi
850854
else
851855
download_url="${mac_source}/mac/${collection}/${platform_version}/${arch}/${filename}"

0 commit comments

Comments
 (0)