-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add prepared logs to the logging test
- Loading branch information
1 parent
e12d2d4
commit 635d116
Showing
12 changed files
with
56 additions
and
219 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,17 @@ | ||
--- | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestStep | ||
commands: | ||
- script: | | ||
opa_pod=$(kubectl get pods \ | ||
--namespace=$NAMESPACE \ | ||
--selector=app.kubernetes.io/instance=test-opa \ | ||
--output=jsonpath='{.items[0].metadata.name}') | ||
kubectl cp ./prepared-opa-logs.json \ | ||
$NAMESPACE/$opa_pod:/stackable/log/opa/test \ | ||
--container vector | ||
kubectl cp ./prepared-bundle-builder-logs.txt \ | ||
$NAMESPACE/$opa_pod:/stackable/log/bundle-builder/test \ | ||
--container vector |
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 |
---|---|---|
@@ -1,10 +1,12 @@ | ||
--- | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestAssert | ||
commands: | ||
- script: >- | ||
kubectl exec --namespace=$NAMESPACE opa-test-runner-0 -- | ||
python /tmp/test_log_aggregation.py -n $NAMESPACE | ||
- script: >- | ||
kubectl exec --namespace=$NAMESPACE opa-test-runner-0 -- | ||
sh /tmp/test_log_aggregation.sh | ||
timeout: 300 | ||
--- | ||
apiVersion: apps/v1 | ||
kind: StatefulSet | ||
metadata: | ||
name: opa-test-runner | ||
status: | ||
readyReplicas: 1 | ||
replicas: 1 |
File renamed without changes.
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,10 @@ | ||
--- | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestAssert | ||
commands: | ||
- script: >- | ||
kubectl exec --namespace=$NAMESPACE opa-test-runner-0 -- | ||
python /tmp/test_log_aggregation.py -n $NAMESPACE | ||
- script: >- | ||
kubectl exec --namespace=$NAMESPACE opa-test-runner-0 -- | ||
sh /tmp/test_log_aggregation.sh |
File renamed without changes.
2 changes: 2 additions & 0 deletions
2
tests/templates/kuttl/logging/prepared-bundle-builder-logs.txt
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,2 @@ | ||
[2m2024-01-01T00:00:00.000000Z[0m [32m INFO[0m [2mbundle[0m[2m:[0m Valid log event | ||
Unparsable log event |
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 @@ | ||
{"level":"info","msg":"Valid server log event","name":"stackable","plugin":"bundle","time":"2024-01-01T00:00:00Z","logger":"server"} | ||
{"bundles":{"stackable":{}},"decision_id":"5b887ec2-80a0-4b44-9009-2e0cae3507c2","labels":{"id":"992b9dd5-f29e-47a7-aa3a-4408218c3825","version":"0.61.0"},"level":"info","metrics":{"counter_server_query_cache_hit":0,"timer_rego_input_parse_ns":5500,"timer_rego_query_compile_ns":143369,"timer_rego_query_eval_ns":41107,"timer_rego_query_parse_ns":95750,"timer_server_handler_ns":422100},"msg":"Valid decision log event","path":"test","req_id":3,"requested_by":"10.244.0.138:33268","time":"2024-01-01T00:00:00Z","timestamp":"2024-01-01T00:00:00.000000000Z","type":"openpolicyagent.org/decision_logs","logger":"decision"} | ||
{"level":"info","msg":"Invalid log event without a timestamp","name":"stackable","plugin":"bundle","logger":"server"} | ||
{"msg":"Invalid log event without a level","name":"stackable","plugin":"bundle","time":"2024-01-01T00:00:00Z","logger":"server"} | ||
{"level":"info","name":"stackable","plugin":"bundle","time":"2024-01-01T00:00:00Z","logger":"server"} | ||
{"level":"info","msg":"Unparsable log event",... |