diff --git a/hack/local-up-cluster.sh b/hack/local-up-cluster.sh index 7ed359a2ec8..4952375c24e 100755 --- a/hack/local-up-cluster.sh +++ b/hack/local-up-cluster.sh @@ -148,12 +148,18 @@ function test_docker { fi } +# Test whether cfssl and cfssljson are installed. +# Sets: +# CFSSL_BIN: The path of the installed cfssl binary +# CFSSLJSON_BIN: The path of the installed cfssljson binary function test_cfssl_installed { if ! command -v cfssl &>/dev/null || ! command -v cfssljson &>/dev/null; then echo "Failed to successfully run 'cfssl', please verify that cfssl and cfssljson are in \$PATH." echo "Hint: export PATH=\$PATH:\$GOPATH/bin; go get -u github.com/cloudflare/cfssl/cmd/..." exit 1 fi + CFSSL_BIN=$(command -v cfssl) + CFSSLJSON_BIN=$(command -v cfssljson) } function test_rkt { @@ -172,12 +178,16 @@ function test_rkt { fi } +# Test whether openssl is installed. +# Sets: +# OPENSSL_BIN: The path to the openssl binary to use function test_openssl_installed { openssl version >& /dev/null if [ "$?" != "0" ]; then echo "Failed to run openssl. Please ensure openssl is installed" exit 1 fi + OPENSSL_BIN=$(command -v openssl) } # Shut down anyway if there's an error. @@ -372,7 +382,7 @@ function create_client_certkey { done ${CONTROLPLANE_SUDO} /bin/bash -e < "${CERT_DIR}/client-ca-config.json" EOF @@ -469,7 +479,7 @@ EOF # Create auth proxy client ca sudo /bin/bash -e < "${CERT_DIR}/auth-proxy-client-ca-config.json" EOF create_client_certkey auth-proxy-client-ca auth-proxy system:auth-proxy