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

[Chore] Test operator restart #3486

Merged
merged 1 commit into from
Nov 22, 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
16 changes: 16 additions & 0 deletions tests/e2e/operator-restart/assert-operator-pod.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: v1
kind: Pod
metadata:
labels:
app.kubernetes.io/name: opentelemetry-operator
control-plane: controller-manager
namespace: ($OTEL_NAMESPACE)
status:
containerStatuses:
- name: kube-rbac-proxy
ready: true
started: true
- name: manager
ready: true
started: true
phase: Running
36 changes: 36 additions & 0 deletions tests/e2e/operator-restart/chainsaw-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: Test
metadata:
name: operator-restart
spec:
# Running the test serially as its disruptive causing operator pod restart
concurrent: false
steps:
- name: Delete operator pod
try:
- command:
entrypoint: kubectl
args:
- get
- pods
- -A
- -l control-plane=controller-manager
- -l app.kubernetes.io/name=opentelemetry-operator
- -o
- jsonpath={.items[0].metadata.namespace}
outputs:
- name: OTEL_NAMESPACE
value: ($stdout)
- delete:
ref:
apiVersion: v1
kind: Pod
namespace: ($OTEL_NAMESPACE)
labels:
control-plane: controller-manager
app.kubernetes.io/name: opentelemetry-operator
# Adding 10s sleep here cause sometimes the pod will be in running state for a while but can fail later if there is any issue with the component startup.
- sleep:
duration: 10s
- assert:
file: assert-operator-pod.yaml
Loading