forked from hswaw/hscloud
Bartosz Stebel
12f176c1eb
Change-Id: I9eceaf26017e483235b97c8d08717d2750fabe25 Reviewed-on: https://gerrit.hackerspace.pl/c/hscloud/+/995 Reviewed-by: q3k <q3k@hackerspace.pl>
22 lines
763 B
Bash
Executable file
22 lines
763 B
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
# A wrapper around the real calicoctl to configure etcd access.
|
|
|
|
source tools/hscloud/lib.sh || exit 1
|
|
|
|
function main() {
|
|
local ws=$(hscloud::workspace_location)
|
|
|
|
export ETCD_ENDPOINTS="https://bc01n01.hswaw.net:2379,https://bc01n01.hswaw.net:2379,https://bc01n01.hswaw.net:2379"
|
|
export ETCD_KEY_FILE="$ws/cluster/secrets/plain/etcd-calico.key"
|
|
export ETCD_CERT_FILE="$ws/cluster/certs/etcd-calico.cert"
|
|
export ETCD_CA_CERT_FILE="$ws/cluster/certs/ca-etcd.crt"
|
|
|
|
if [ ! -f "$ETCD_KEY_FILE" ] ; then
|
|
$(hscloud::must_rlocation hscloud/tools/secretstore) decrypt "$ws/cluster/secrets/cipher/etcd-calico.key" "$ETCD_KEY_FILE"
|
|
fi
|
|
|
|
"$(hscloud::must_rlocation calicoctl_3_15/file/calicoctl)" "$@"
|
|
}
|
|
|
|
main "$@"
|