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

test: Show Operator Failed Logs #843

Merged
merged 1 commit into from
Mar 25, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ spec:
file: ready-svc.yaml
- assert:
file: ready-pvc.yaml
catch:
- description: Redis Operator Logs
podLogs:
namespace: redis-operator-system
selector: control-plane=redis-operator
container: manager
tail: -1 # tail all logs

- name: Sleep for five minutes
try:
Expand Down
30 changes: 29 additions & 1 deletion tests/e2e-chainsaw/v1beta2/ha-failover/chainsaw-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ spec:
file: sentinel.yaml
- create:
file: cli-pod.yaml
catch:
- description: Redis Operator Logs
podLogs:
namespace: redis-operator-system
selector: control-plane=redis-operator
container: manager
tail: -1 # tail all logs

- name: Sleep for 3 minutes
try:
Expand All @@ -25,6 +32,13 @@ spec:
kubectl exec --namespace ${NAMESPACE} redis -- redis-cli -h redis-sentinel-sentinel.${NAMESPACE}.svc -p 26379 sentinel master myMaster | grep -A 1 'flags' | tail -n 1
check:
($stdout=='master'): true
catch:
- description: Redis Operator Logs
podLogs:
namespace: redis-operator-system
selector: control-plane=redis-operator
container: manager
tail: -1 # tail all logs

# New created cluster, the first pod is master
- name: Terminate the redis-replication-0 pod
Expand All @@ -33,6 +47,13 @@ spec:
timeout: 10s
content: |
kubectl --namespace ${NAMESPACE} delete pod redis-replication-0
catch:
- description: Redis Operator Logs
podLogs:
namespace: redis-operator-system
selector: control-plane=redis-operator
container: manager
tail: -1 # tail all logs

- name: Sleep for 3 minutes
try:
Expand All @@ -46,4 +67,11 @@ spec:
content: |
kubectl exec --namespace ${NAMESPACE} redis -- redis-cli -h redis-sentinel-sentinel.${NAMESPACE}.svc -p 26379 sentinel master myMaster | grep -A 1 'flags' | tail -n 1
check:
($stdout=='master'): true
($stdout=='master'): true
catch:
- description: Redis Operator Logs
podLogs:
namespace: redis-operator-system
selector: control-plane=redis-operator
container: manager
tail: -1 # tail all logs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ spec:
file: ready-svc.yaml
- assert:
file: ready-pvc.yaml
catch:
- description: Redis Operator Logs
podLogs:
namespace: redis-operator-system
selector: control-plane=redis-operator
container: manager
tail: -1 # tail all logs

- name: Sleep for five minutes
try:
Expand Down Expand Up @@ -127,4 +134,5 @@ spec:
content: |
kubectl exec --namespace ${NAMESPACE} --container redis-cluster-v1beta2-follower redis-cluster-v1beta2-follower-2 -- redis-cli -c -p 6379 set foo-5 bar-5
check:
($stdout=='OK'): true
($stdout=='OK'): true

Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ spec:
file: ready-svc.yaml
- assert:
file: ready-pvc.yaml
catch:
- description: Redis Operator Logs
podLogs:
namespace: redis-operator-system
selector: control-plane=redis-operator
container: manager
tail: -1 # tail all logs

- name: Ping Replicated Cluster
try:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,11 @@ spec:
- assert:
file: ready-sts.yaml
- assert:
file: ready-svc.yaml
file: ready-svc.yaml
catch:
- description: Redis Operator Logs
podLogs:
namespace: redis-operator-system
selector: control-plane=redis-operator
container: manager
tail: -1 # tail all logs
Loading