Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Commit

Permalink
e2e: update gitsrv to v1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
hiddeco committed Mar 25, 2020
1 parent cc1fbe2 commit 3f27032
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
4 changes: 0 additions & 4 deletions test/e2e/fixtures/known_hosts

This file was deleted.

2 changes: 1 addition & 1 deletion test/e2e/fixtures/kustom/base/gitsrv/gitsrv.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ spec:
name: gitsrv
spec:
containers:
- image: stefanprodan/gitsrv:0.1.3
- image: fluxcd/gitsrv:v1.0.0
name: git
env:
- name: REPO
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/lib/env.bash
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ ROOT_DIR=$(git rev-parse --show-toplevel)
export ROOT_DIR
export E2E_DIR="${ROOT_DIR}/test/e2e"
export FIXTURES_DIR="${E2E_DIR}/fixtures"
KNOWN_HOSTS=$(cat "${FIXTURES_DIR}/known_hosts")
export KNOWN_HOSTS
GITCONFIG=$(cat "${FIXTURES_DIR}/gitconfig")
export GITCONFIG
export HELM_VERSION=${HELM_VERSION}
export GITSRV_VERSION=v1.0.0
export GITSRV_KNOWN_HOSTS="${ROOT_DIR}/cache/known_hosts_${GITSRV_VERSION}"

# Wire the test to the right cluster when tests are run in parallel
if eval [ -n '$KUBECONFIG_SLOT_'"${BATS_JOB_SLOT}" ]; then
Expand Down
13 changes: 11 additions & 2 deletions test/e2e/lib/install.bash
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ function install_helm_operator_with_helm() {
create_crds='false'
fi

[ -f "${GITSRV_KNOWN_HOSTS}" ] || download_git_srv_known_hosts

helm2 install --name helm-operator --wait \
--tiller-namespace "${E2E_NAMESPACE}" \
--namespace "${E2E_NAMESPACE}" \
Expand All @@ -40,7 +42,7 @@ function install_helm_operator_with_helm() {
--set git.config.enabled=true \
--set-string git.config.data="${GITCONFIG}" \
--set git.ssh.secretName=flux-git-deploy \
--set-string git.ssh.known_hosts="${KNOWN_HOSTS}" \
--set-string git.ssh.known_hosts="$(cat "${GITSRV_KNOWN_HOSTS}")" \
--set configureRepositories.enable=true \
--set configureRepositories.repositories[0].name="stable" \
--set configureRepositories.repositories[0].url="https://kubernetes-charts.storage.googleapis.com" \
Expand All @@ -60,6 +62,8 @@ function uninstall_helm_operator_with_helm() {
}

function install_git_srv() {
[ -f "${GITSRV_KNOWN_HOSTS}" ] || download_git_srv_known_hosts

local external_access_result_var=${1}
local kustomization_dir=${2:-base/gitsrv}
local gen_dir
Expand All @@ -68,7 +72,7 @@ function install_git_srv() {
ssh-keygen -t rsa -N "" -f "$gen_dir/id_rsa"
kubectl create secret generic flux-git-deploy \
--namespace="${E2E_NAMESPACE}" \
--from-file="${FIXTURES_DIR}/known_hosts" \
--from-file="${GITSRV_KNOWN_HOSTS}" \
--from-file="$gen_dir/id_rsa" \
--from-file=identity="$gen_dir/id_rsa" \
--from-file="$gen_dir/id_rsa.pub"
Expand All @@ -92,6 +96,11 @@ function install_git_srv() {
fi
}

function download_git_srv_known_hosts() {
mkdir -p "$(dirname "${GITSRV_KNOWN_HOSTS}")"
curl -sL "https://github.com/fluxcd/gitsrv/releases/download/${GITSRV_VERSION}/known_hosts.txt" > "${GITSRV_KNOWN_HOSTS}"
}

function uninstall_git_srv() {
local kustomization_dir=${1:-base/gitsrv}

Expand Down

0 comments on commit 3f27032

Please sign in to comment.