Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sonobuoy test #85

Merged
merged 4 commits into from
May 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file modified tks-cluster/create-aws-conf-secret.yaml
100755 → 100644
Empty file.
3 changes: 0 additions & 3 deletions tks-cluster/create-usercluster-wftpl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ spec:
value: "template-std"
- name: git_account
value: "tks-management"
# TODO: if gittoken is necessary, the following options might be tried.
# 1. Pass gittoken name (or use predefined name) and createApp reconstructs this repo URL.
# 2. Make argocd pod always use the common gittoken.
- name: manifest_repo_url
value: ""
- name: revision
Expand Down
Empty file modified tks-cluster/manage-internal-communication.yaml
100755 → 100644
Empty file.
39 changes: 39 additions & 0 deletions tks-cluster/validate-usercluster-wftpl.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
apiVersion: argoproj.io/v1alpha1
kind: WorkflowTemplate
metadata:
name: tks-validate-usercluster
namespace: argo
spec:
entrypoint: run-sonobuoy
arguments:
parameters:
- name: cluster_id
value: "011b88fa-4d53-439f-9336-67845f994051"
- name: sonobuoy_mode
value: "quick"
templates:
- name: run-sonobuoy
container:
name: sonobuoy
image: 'sktcloud/sonobuoy-worker'
command:
- /bin/bash
- '-exc'
- |
KUBECONFIG_=$(kubectl get secret -n {{workflow.parameters.cluster_id}} {{workflow.parameters.cluster_id}}-kubeconfig -o jsonpath="{.data.value}" | base64 -d)
cat <<< "$KUBECONFIG_" > /etc/kubeconfig_temp
export KUBECONFIG='/etc/kubeconfig_temp'

sonobuoy run --mode {{workflow.parameters.sonobuoy_mode}} --e2e-parallel 30 --wait
sonobuoy retrieve && mkdir ./results
tar xzf ./*.tar.gz -C ./results
cat ./results/plugins/e2e/results/global/e2e.log

status=$(sonobuoy status)

if grep -q "failed" <<< "$status"; then
echo "Sonobuoy e2e test failed!"
exit 1
fi

sonobuoy delete --all --wait