Skip to content

Commit

Permalink
merge changes
Browse files Browse the repository at this point in the history
Signed-off-by: ShutingZhao <[email protected]>
  • Loading branch information
realshuting committed Oct 27, 2023
2 parents e16d558 + 862ceb0 commit 1193c6d
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 159 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ kind-deploy-kyverno: helm-add-repo helm-install-kyverno ## Deploy kyverno helm c

VUS ?= 10
ITERATIONS ?= 1000
SCRIPT ?= "kyverno-pss.js"
SCRIPT ?= kyverno-pss.js

.PHONY: kyverno-pss-block
kyverno-pss-block:
cd k6 \
cd k6 && \
./start.sh ./tests/${SCRIPT} ${VUS} ${ITERATIONS}

.PHONY: check-error
check-error:
@grep -q "level=error" "${SCRIPT}-${VUS}vu-${ITERATIONS}it-logs.txt" || (echo "Error found in the file."; exit 1)
@grep -q "level=error" "${SCRIPT}-${VUS}vu-${ITERATIONS}it-logs.txt" || (echo "Unexpected behavior during load testing, please check results."; exit 1)
56 changes: 0 additions & 56 deletions configs/kind/tracing.yaml

This file was deleted.

40 changes: 0 additions & 40 deletions configs/kind/vap-v1alpha1.yaml

This file was deleted.

41 changes: 0 additions & 41 deletions configs/kind/vap-v1beta1.yaml

This file was deleted.

3 changes: 1 addition & 2 deletions k6/job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@ spec:
spec:
serviceAccountName: load-test
containers:
- image: grafana/k6:0.45.0
- image: grafana/k6:0.47.0
resources: {}
name: k6
securityContext:
allowPrivilegeEscalation: false
runAsNonRoot: true
seccompProfile:
type: RuntimeDefault
capabilities:
Expand Down
34 changes: 17 additions & 17 deletions k6/pss-values.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,101 +5,101 @@ policyExclude:
any:
- resources:
namespaces:
- load-tests
- load-test
name: load-test*
adding-capabilities-strict:
any:
- resources:
namespaces:
- load-tests
- load-test
name: load-test*
disallow-host-namespaces:
any:
- resources:
namespaces:
- load-tests
- load-test
name: load-test*
disallow-host-path:
any:
- resources:
namespaces:
- load-tests
- load-test
name: load-test*
disallow-host-ports:
any:
- resources:
namespaces:
- load-tests
- load-test
name: load-test*
disallow-host-process:
any:
- resources:
namespaces:
- load-tests
- load-test
name: load-test*
disallow-privilege-escalation:
any:
- resources:
namespaces:
- load-tests
- load-test
name: load-test*
disallow-privileged-containers:
any:
- resources:
namespaces:
- load-tests
- load-test
name: load-test*
disallow-proc-mount:
any:
- resources:
namespaces:
- load-tests
- load-test
name: load-test*
disallow-selinux:
any:
- resources:
namespaces:
- load-tests
- load-test
name: load-test*
require-run-as-non-root-user:
any:
- resources:
namespaces:
- load-tests
- load-test
name: load-test*
require-run-as-nonroot:
any:
- resources:
namespaces:
- load-tests
- load-test
name: load-test*
restrict-apparmor-profiles:
any:
- resources:
namespaces:
- load-tests
- load-test
name: load-test*
restrict-seccomp:
any:
- resources:
namespaces:
- load-tests
- load-test
name: load-test*
restrict-seccomp-strict:
any:
- resources:
namespaces:
- load-tests
- load-test
name: load-test*
restrict-sysctls:
any:
- resources:
namespaces:
- load-tests
- load-test
name: load-test*
restrict-volume-types:
any:
- resources:
namespaces:
- load-tests
- load-test
name: load-test*
20 changes: 20 additions & 0 deletions k6/report.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env bash

set -euo pipefail

grep "level=error" "$file_path"

# Store the exit code of the grep command
exit_code=$?

# Check if the exit code is 0 (match found) or 1 (no match found)
if [ $exit_code -eq 0 ]; then
echo "Error found in the file."
exit 1
elif [ $exit_code -eq 1 ]; then
echo "No error found in the file."
exit 0
else
echo "An error occurred while searching the file."
exit 1
fi

0 comments on commit 1193c6d

Please sign in to comment.