Merge pull request #90406 from joakimr-axis/joakimr-axis_pre-existing-util.sh
Fix shellcheck failures in cluster/pre-existing/util.sh
This commit is contained in:
commit
47daccb272
@ -41,22 +41,16 @@ function detect-project() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function create-certs {
|
function create-certs {
|
||||||
rm /tmp/kubeconfig
|
execute-cmd-on-pre-existing-master-with-retries 'sudo cat /etc/kubernetes/admin.conf' > /tmp/kubeconfig
|
||||||
|
|
||||||
execute-cmd-on-pre-existing-master-with-retries "sudo cat /etc/kubernetes/admin.conf" > /tmp/kubeconfig
|
# CA_CERT_BASE64, KUBELET_CERT_BASE64 and KUBELET_KEY_BASE64 might be used
|
||||||
CA_CERT_BASE64=$(cat /tmp/kubeconfig | grep certificate-authority | awk '{print $2}' | head -n 1)
|
# in test/kubemark/iks/util.sh
|
||||||
KUBELET_CERT_BASE64=$(cat /tmp/kubeconfig | grep client-certificate-data | awk '{print $2}' | head -n 1)
|
# If it becomes clear that the variables are not used anywhere, then we can
|
||||||
KUBELET_KEY_BASE64=$(cat /tmp/kubeconfig | grep client-key-data | awk '{print $2}' | head -n 1)
|
# remove them:
|
||||||
|
CA_CERT_BASE64=$(grep certificate-authority /tmp/kubeconfig | awk '{print $2}' | head -n 1)
|
||||||
# Local kubeconfig.kubemark vars
|
KUBELET_CERT_BASE64=$(grep client-certificate-data /tmp/kubeconfig | awk '{print $2}' | head -n 1)
|
||||||
KUBECFG_CERT_BASE64="${KUBELET_CERT_BASE64}"
|
KUBELET_KEY_BASE64=$(grep client-key-data /tmp/kubeconfig | awk '{print $2}' | head -n 1)
|
||||||
KUBECFG_KEY_BASE64="${KUBELET_KEY_BASE64}"
|
export CA_CERT_BASE64
|
||||||
|
export KUBELET_CERT_BASE64
|
||||||
# The pre-existing Kubernetes master already has these setup
|
export KUBELET_KEY_BASE64
|
||||||
# Set these vars but don't use them
|
|
||||||
CA_KEY_BASE64=$(dd if=/dev/urandom bs=128 count=1 2>/dev/null | base64 | tr -d "=+/" | dd bs=32 count=1 2>/dev/null)
|
|
||||||
MASTER_CERT_BASE64=$(dd if=/dev/urandom bs=128 count=1 2>/dev/null | base64 | tr -d "=+/" | dd bs=32 count=1 2>/dev/null)
|
|
||||||
MASTER_KEY_BASE64=$(dd if=/dev/urandom bs=128 count=1 2>/dev/null | base64 | tr -d "=+/" | dd bs=32 count=1 2>/dev/null)
|
|
||||||
KUBEAPISERVER_CERT_BASE64=$(dd if=/dev/urandom bs=128 count=1 2>/dev/null | base64 | tr -d "=+/" | dd bs=32 count=1 2>/dev/null)
|
|
||||||
KUBEAPISERVER_KEY_BASE64=$(dd if=/dev/urandom bs=128 count=1 2>/dev/null | base64 | tr -d "=+/" | dd bs=32 count=1 2>/dev/null)
|
|
||||||
}
|
}
|
||||||
|
@ -4,4 +4,3 @@
|
|||||||
./cluster/gce/upgrade.sh
|
./cluster/gce/upgrade.sh
|
||||||
./cluster/gce/util.sh
|
./cluster/gce/util.sh
|
||||||
./cluster/log-dump/log-dump.sh
|
./cluster/log-dump/log-dump.sh
|
||||||
./cluster/pre-existing/util.sh
|
|
||||||
|
Loading…
Reference in New Issue
Block a user