saltstack/salt-bootstrap

Bootstrap script recognizes commit hashes given as argument to install type git as "Post Neon Tag"

janniswarnat opened this issue · 0 comments

Description of Issue/Question

The bootstrap script recognizes commit hashes given as argument to install type git as "Post Neon Tag". It then erroneously tries to shallow clone and fails. Also the regular clone as fallback fails because a "v" has been added to the commit hash as a prefix.

Steps to Reproduce Issue

Clone the latest develop branch of salt-bootstrap (commit 156120e). Then run

sudo sh ./bootstrap-salt.sh -D git 1f72058d962733745424111315274ecf3be4048c
 *  INFO: Running version: 2022.10.04
 *  INFO: Executed by: shell pipe
 *  INFO: Command line: './bootstrap-salt.sh -D git 1f72058d962733745424111315274ecf3be4048c'
 *  WARN: Running the unstable version of bootstrap-salt.sh

 *  INFO: System Information:
 *  INFO:   CPU:          GenuineIntel
 *  INFO:   CPU Arch:     x86_64
 *  INFO:   OS Name:      Linux
 *  INFO:   OS Version:   5.10.157-139.675.amzn2.x86_64
 *  INFO:   Distribution: Amazon Linux AMI 2

 * DEBUG: Binaries will be searched using the following $PATH: /sbin:/bin:/usr/sbin:/usr/bin
 *  INFO: Installing minion
 * DEBUG: Post Neon Tag Regex Match On: v1f72058d962733745424111315274ecf3be4048c

 *  WARN: Post Neon git based installations will always install salt
 *  WARN: and its dependencies using pip which will be upgraded to
 *  WARN: at least v9.0.1, and, in case the setuptools version is also
 *  WARN: too old, it will be upgraded to at least v9.1

 *  WARN: You have 10 seconds to cancel and stop the bootstrap process...

 *  INFO: Found function install_amazon_linux_ami_2_git_deps
 * DEBUG: DEPS_INSTALL_FUNC=install_amazon_linux_ami_2_git_deps
 * DEBUG: config_amazon_linux_ami_2_git_salt not found....
 * DEBUG: config_amazon_linux_ami_2_salt not found....
 * DEBUG: config_amazon_linux_ami_git_salt not found....
 * DEBUG: config_amazon_linux_ami_salt not found....
 *  INFO: Found function config_salt
 * DEBUG: CONFIG_SALT_FUNC=config_salt
 * DEBUG: preseed_amazon_linux_ami_2_git_master not found....
 * DEBUG: preseed_amazon_linux_ami_2_master not found....
 * DEBUG: preseed_amazon_linux_ami_git_master not found....
 * DEBUG: preseed_amazon_linux_ami_master not found....
 *  INFO: Found function preseed_master
 * DEBUG: PRESEED_MASTER_FUNC=preseed_master
 * DEBUG: INSTALL_FUNC_NAMES=install_amazon_linux_ami_2_git install_amazon_linux_ami_2_git install_amazon_linux_ami_git
 *  INFO: Found function install_amazon_linux_ami_2_git
 * DEBUG: INSTALL_FUNC=install_amazon_linux_ami_2_git
 *  INFO: Found function install_amazon_linux_ami_2_git_post
 * DEBUG: POST_INSTALL_FUNC=install_amazon_linux_ami_2_git_post
 * DEBUG: install_amazon_linux_ami_2_git_restart_daemons not found....
 *  INFO: Found function install_amazon_linux_ami_2_restart_daemons
 * DEBUG: STARTDAEMONS_INSTALL_FUNC=install_amazon_linux_ami_2_restart_daemons
 * DEBUG: daemons_running_amazon_linux_ami_2_git not found....
 * DEBUG: daemons_running_amazon_linux_ami_2 not found....
 * DEBUG: daemons_running_amazon_linux_ami_git not found....
 * DEBUG: daemons_running_amazon_linux_ami not found....
 * DEBUG: daemons_running_git not found....
 *  INFO: Found function daemons_running
 * DEBUG: DAEMONS_RUNNING_FUNC=daemons_running
 * DEBUG: install_amazon_linux_ami_2_git_check_services not found....
 *  INFO: Found function install_amazon_linux_ami_2_check_services
 * DEBUG: CHECK_SERVICES_FUNC=install_amazon_linux_ami_2_check_services
 *  INFO: Running install_amazon_linux_ami_2_git_deps()
Failed to set locale, defaulting to C
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
Package ca-certificates-2021.2.50-72.amzn2.0.4.noarch already installed and latest version
Nothing to do
Failed to set locale, defaulting to C
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
Package yum-utils-1.1.31-46.amzn2.0.1.noarch already installed and latest version
Nothing to do
 * DEBUG: Installed git version: 2.38.1
 *  INFO: Git revision matches a Salt version tag, shallow cloning enabled.
 *  INFO: Attempting to shallow clone v1f72058d962733745424111315274ecf3be4048c from Salt's repository https://github.com/saltstack/salt.git
Cloning into 'salt'...
warning: Could not find remote branch v1f72058d962733745424111315274ecf3be4048c to clone.
fatal: Remote branch v1f72058d962733745424111315274ecf3be4048c not found in upstream origin
 *  WARN: Failed to shallow clone.
 *  INFO: Resuming regular git clone and remote SaltStack repository addition procedure
Cloning into 'salt'...
Updating files: 100% (6694/6694), done.
 * DEBUG: Checking out v1f72058d962733745424111315274ecf3be4048c
error: pathspec 'v1f72058d962733745424111315274ecf3be4048c' did not match any file(s) known to git
 * ERROR: Failed to run install_amazon_linux_ami_2_git_deps()!!!
 * DEBUG: Cleaning up the Salt Temporary Git Repository
 * DEBUG: Removing the logging pipe /tmp/bootstrap-salt.logpipe
 * DEBUG: Removing the temporary apt error file /tmp/apt_error.LcihID

Versions and Systems

See above