Skip to content

Commit 3327515

Browse files
committed
e2e: Update gitsrv to v1.0.0
- update gitsrv deployment to v1.0.0 - download known_hosts from GitHub release - use the downloaded known_hosts in tests
1 parent e709da5 commit 3327515

File tree

5 files changed

+11
-8
lines changed

5 files changed

+11
-8
lines changed

test/e2e/fixtures/known_hosts

-4
This file was deleted.

test/e2e/fixtures/kustom/base/gitsrv/gitsrv.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ spec:
1616
name: gitsrv
1717
spec:
1818
containers:
19-
- image: stefanprodan/gitsrv:0.1.3
19+
- image: fluxcd/gitsrv:v1.0.0
2020
name: git
2121
env:
2222
- name: REPO

test/e2e/lib/env.bash

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ FLUX_ROOT_DIR=$(git rev-parse --show-toplevel)
66
export FLUX_ROOT_DIR
77
export E2E_DIR="${FLUX_ROOT_DIR}/test/e2e"
88
export FIXTURES_DIR="${E2E_DIR}/fixtures"
9-
KNOWN_HOSTS=$(cat "${FIXTURES_DIR}/known_hosts")
9+
KNOWN_HOSTS=$(cat "${FLUX_ROOT_DIR}/cache/known_hosts")
1010
export KNOWN_HOSTS
1111
GITCONFIG=$(cat "${FIXTURES_DIR}/gitconfig")
1212
export GITCONFIG

test/e2e/lib/install.bash

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ fluxctl_install_cmd="fluxctl install --git-url=ssh://git@gitsrv/git-server/repos
5252
function install_flux_with_fluxctl() {
5353
kustomization_dir=${1:-base/flux}
5454
key_values_varname=${2}
55-
kubectl -n "${FLUX_NAMESPACE}" create configmap flux-known-hosts --from-file="${E2E_DIR}/fixtures/known_hosts"
55+
kubectl -n "${FLUX_NAMESPACE}" create configmap flux-known-hosts --from-file="${FLUX_ROOT_DIR}/cache/known_hosts"
5656
local kustomtmp
5757
kustomtmp="$(mktemp -d)"
5858
defer rm -rf "'${kustomtmp}'"
@@ -87,7 +87,7 @@ function install_git_srv() {
8787
defer rm -rf "'$gen_dir'"
8888
kubectl create secret generic flux-git-deploy \
8989
--namespace="${FLUX_NAMESPACE}" \
90-
--from-file="${FIXTURES_DIR}/known_hosts" \
90+
--from-file="${FLUX_ROOT_DIR}/cache/known_hosts" \
9191
--from-file="$gen_dir/id_rsa" \
9292
--from-file=identity="$gen_dir/id_rsa" \
9393
--from-file="$gen_dir/id_rsa.pub"

test/e2e/run.bash

+7
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ CACHE_DIR="${FLUX_ROOT_DIR}/cache/$CURRENT_OS_ARCH"
1212

1313
KIND_VERSION=v0.7.0
1414
KUBE_VERSION=v1.14.10
15+
GITSRV_VERSION=v1.0.0
1516
KIND_CACHE_PATH="${CACHE_DIR}/kind-$KIND_VERSION"
1617
KIND_CLUSTER_PREFIX=flux-e2e
1718
BATS_EXTRA_ARGS=""
@@ -20,6 +21,11 @@ BATS_EXTRA_ARGS=""
2021
source "${E2E_DIR}/lib/defer.bash"
2122
trap run_deferred EXIT
2223

24+
function download_known_hosts() {
25+
mkdir -p "${FLUX_ROOT_DIR}/cache"
26+
curl -sL "https://github.com/fluxcd/gitsrv/releases/download/${GITSRV_VERSION}/known_hosts.txt" > "${FLUX_ROOT_DIR}/cache/known_hosts"
27+
}
28+
2329
function install_kind() {
2430
if [ ! -f "${KIND_CACHE_PATH}" ]; then
2531
echo '>>> Downloading Kind'
@@ -62,6 +68,7 @@ if ! kubectl version > /dev/null 2>&1; then
6268
fi
6369

6470
echo '>>> Running the tests'
71+
download_known_hosts
6572
# Run all tests by default but let users specify which ones to run, e.g. with E2E_TESTS='11_*' make e2e
6673
E2E_TESTS=${E2E_TESTS:-.}
6774
(

0 commit comments

Comments
 (0)