Skip to content

Commit df9ae30

Browse files
committed
Update e2e tests to use keto cli to retrieve the kube admin config
1 parent 6b38016 commit df9ae30

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

bin/keto_test_e2e_exec.sh

+2-7
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,6 @@ set +e
1010
WORKINGDIR="${GOPATH}/src/github.com/UKHomeOffice/keto"
1111
KETO_ASSETS_DIR=${KETO_ASSETS_DIR:-${PWD}}
1212

13-
function generate_kube_config() {
14-
API_ADDR="https://$(aws cloudformation describe-stacks --stack-name keto-${CLUSTER_NAME}-elb --query "Stacks[0].Outputs[?OutputKey=='ELBDNS'].OutputValue" --output text)"
15-
mkdir -p ~/.kube/
16-
kubeadm alpha phase kubeconfig client-certs --client-name kubernetes-admin --organization system:masters --server ${API_ADDR} --cert-dir ${KETO_ASSETS_DIR} > ~/.kube/config
17-
}
18-
1913
function cleanup() {
2014
echo "[INFO] Attempting to delete keto cluster '${CLUSTER_NAME}'"
2115
keto --cloud ${KETO_CLOUD_PROVIDER} delete cluster ${CLUSTER_NAME}
@@ -33,7 +27,8 @@ function run_e2e_test() {
3327

3428
# TODO: Modify once Keto adds capability to auto generate config using the client cli
3529
echo "[INFO] Generating Kubernetes config"
36-
generate_kube_config || return
30+
mkdir -p ~/.kube
31+
keto get config --cloud aws --cluster ${CLUSTER_NAME} --assets-dir ${KETO_ASSETS_DIR} --output-file ~/.kube/config || return
3732

3833
echo "[INFO] Executing kuberang test to validate cluster health"
3934
${WORKINGDIR}/bin/kuberang.sh 180 || return

bin/keto_test_e2e_setup.sh

-3
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ glide install
1313
# cfssl for cert generation
1414
go get -u github.com/cloudflare/cfssl/cmd/...
1515

16-
# TODO: This can be removed when keto implements the capability to locally generate the kube config
17-
curl -LO https://bootstrap.pypa.io/get-pip.py && python get-pip.py && pip install awscli
18-
1916
# Get kubectl, kubeadm, kuberang
2017
curl -LO https://storage.googleapis.com/kubernetes-release/release/${KUBE_VERSION}/bin/linux/amd64/kubectl
2118
chmod +x kubectl && mv kubectl /usr/local/bin/kubectl && kubectl help

0 commit comments

Comments
 (0)