This repository has been archived by the owner on Nov 1, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/usr/bin/env bats | ||
|
||
function setup() { | ||
load lib/env | ||
load lib/install | ||
load lib/poll | ||
load lib/defer | ||
|
||
kubectl create namespace "$FLUX_NAMESPACE" | ||
|
||
local -A template_values | ||
# shellcheck disable=SC2034 | ||
template_values['FLUX_NAMESPACE']="$FLUX_NAMESPACE" | ||
install_flux_with_fluxctl "21_ssh_key_generation" 'template_values' | ||
} | ||
|
||
@test "SSH key is generated" { | ||
run fluxctl identity --k8s-fwd-ns "$FLUX_NAMESPACE" | ||
[ "$status" -eq 0 ] | ||
[ "$output" != "" ] | ||
} | ||
|
||
function teardown() { | ||
run_deferred | ||
# Although the namespace delete below takes care of removing most Flux | ||
# elements, the global resources will not be removed without this. | ||
uninstall_flux_with_fluxctl "21_ssh_key_generation" | ||
# Removing the namespace also takes care of removing Flux and gitsrv. | ||
kubectl delete namespace "$FLUX_NAMESPACE" | ||
} |
3 changes: 3 additions & 0 deletions
3
test/e2e/fixtures/kustom/21_ssh_key_generation/generation_patch.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
- op: add | ||
path: /spec/template/spec/containers/0/args/- | ||
value: --k8s-secret-name=flux-git-deploy-generated |
6 changes: 6 additions & 0 deletions
6
test/e2e/fixtures/kustom/21_ssh_key_generation/generation_secret.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: flux-git-deploy-generated | ||
namespace: $FLUX_NAMESPACE | ||
type: Opaque |
14 changes: 14 additions & 0 deletions
14
test/e2e/fixtures/kustom/21_ssh_key_generation/kustomization.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
bases: | ||
- "../base/flux" | ||
resources: | ||
- generation_secret.yaml | ||
patchesJson6902: | ||
## this patch is for test-specific patches; supply a filename to | ||
## install_flux_with_fluxctl and it will use that rather than the | ||
## (empty) default. | ||
- target: | ||
group: apps | ||
version: v1 | ||
kind: Deployment | ||
name: flux | ||
path: generation_patch.yaml |