mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-08 12:41:58 +00:00
Fix which salt-master
warning in Vagrant startup
The `which` command in Fedora 20 (differently from the one in Debian) prints to stderr when the binary is not found. Redirect both stdout and stderr to /dev/null to prevent messages from being printed by `which`. Check whether the binary exists or not by the exit status of `which` (non-zero means the binary does not exist) instead of checking for empty output. Tested: - Started a Vagrant cluster with `vagrant up` and confirmed these messages were gone. Checked master and minions for Kubernetes components using the systemd status commands. - Confirmed that the same error message for salt-minion is also suppressed from the output with this patch. Fixes: Issue #1079 Signed-off-by: Filipe Brandenburger <filbranden@google.com>
This commit is contained in:
@@ -61,7 +61,7 @@ MASTER_HTPASSWD=$(cat ${KUBE_TEMP}/htpasswd)
|
|||||||
echo $MASTER_HTPASSWD > /srv/salt/nginx/htpasswd
|
echo $MASTER_HTPASSWD > /srv/salt/nginx/htpasswd
|
||||||
|
|
||||||
# we will run provision to update code each time we test, so we do not want to do salt install each time
|
# we will run provision to update code each time we test, so we do not want to do salt install each time
|
||||||
if [ ! $(which salt-master) ]; then
|
if ! which salt-master >/dev/null 2>&1; then
|
||||||
|
|
||||||
# Configure the salt-api
|
# Configure the salt-api
|
||||||
cat <<EOF >/etc/salt/master.d/salt-api.conf
|
cat <<EOF >/etc/salt/master.d/salt-api.conf
|
||||||
|
@@ -41,7 +41,7 @@ grains:
|
|||||||
EOF
|
EOF
|
||||||
|
|
||||||
# we will run provision to update code each time we test, so we do not want to do salt install each time
|
# we will run provision to update code each time we test, so we do not want to do salt install each time
|
||||||
if [ ! $(which salt-minion) ]; then
|
if ! which salt-minion >/dev/null 2>&1; then
|
||||||
# Install Salt
|
# Install Salt
|
||||||
#
|
#
|
||||||
# We specify -X to avoid a race condition that can cause minion failure to
|
# We specify -X to avoid a race condition that can cause minion failure to
|
||||||
|
Reference in New Issue
Block a user