#!/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 "$@"