-
Notifications
You must be signed in to change notification settings - Fork 193
(CAT-2413) Defaults puppetcore agent version to newest if none given #798
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -830,24 +830,33 @@ case $platform in | |
"mac_os_x") | ||
info "Mac platform! Lets get you a DMG..." | ||
filetype="dmg" | ||
if test "$version" = "latest"; then | ||
filename="puppet-agent-latest.dmg" | ||
else | ||
filename="puppet-agent-${version}-1.osx${platform_version}.dmg" | ||
fi | ||
|
||
arch="x86_64" | ||
if [[ $(uname -p) == "arm" ]]; then | ||
arch="arm64" | ||
fi | ||
if [[ "$collection" =~ "puppetcore" ]]; then | ||
# Puppetcore requires a version to be specified, so we will use the latest version if not specified. | ||
# Or if the version is set to "latest". | ||
if [[ -z "$version" || "$version" == "latest" ]]; then | ||
version=$(curl -sL https://forgeapi.puppet.com/private/versions/puppet-agent | \ | ||
jq -r 'keys_unsorted | | ||
map(select(startswith("8."))) | | ||
max_by(split(".") | map(tonumber))') | ||
fi | ||
|
||
dots=$(echo "${version}" | grep -o '\.' | wc -l) | ||
if (( dots >= 3 )); then | ||
download_url="${mac_source}?version=${version}&os_name=osx&os_version=${platform_version}&os_arch=${arch}&dev=true" | ||
download_url="${mac_source}?type=native&version=${version}&os_name=osx&os_version=${platform_version}&os_arch=${arch}&dev=true" | ||
else | ||
download_url="${mac_source}?version=${version}&os_name=osx&os_version=${platform_version}&os_arch=${arch}" | ||
download_url="${mac_source}?type=native&version=${version}&os_name=osx&os_version=${platform_version}&os_arch=${arch}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. when/why did There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A while back, ever since the site started hosting the pdk I think.. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. With multiple products up, an identifier was needed |
||
fi | ||
else | ||
if test "$version" = "latest"; then | ||
filename="puppet-agent-latest.dmg" | ||
else | ||
filename="puppet-agent-${version}-1.osx${platform_version}.dmg" | ||
fi | ||
|
||
download_url="${mac_source}/mac/${collection}/${platform_version}/${arch}/${filename}" | ||
fi | ||
;; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, there's no guarantee
jq
is installed on the system where we're trying to install the agent... Since this latest business is a hack for platforms without package managers, I'm thinking we should just fail ifversion
is unset on Windows and macOS. That way the caller will know it needs to provide an explicit version. Then in CI, it should be easy to runcurl | jq
on an ubuntu worker and pass the version into the test.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is less of a priority on our end now that the nightly images are up for us to grab.
Was mainly continuing with this for the teams that don't want to use nightlies, but if they haven't commented about it yet then they either have their own solution or aren't running on Windows/Mac
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have opened a second PR which adds error messages: #801