Skip to content

Commit

Permalink
Merge pull request #85 from openinfradev/add_sonobuoy_test
Browse files Browse the repository at this point in the history
Add sonobuoy test
  • Loading branch information
zugwan authored May 23, 2022
2 parents 4bcbe92 + 71b5546 commit f047faf
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 3 deletions.
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

0 comments on commit f047faf

Please sign in to comment.