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] Fix the monolithic sts test assert and max-loops test to detect the operator namespace #1087

Merged
merged 2 commits into from
Nov 7, 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 @@ -97,6 +97,9 @@ metadata:
namespace: chainsaw-awssts-mono
status:
containerStatuses:
- name: jaeger-query
ready: true
started: true
- name: oauth-proxy
ready: true
started: true
Expand Down
2 changes: 1 addition & 1 deletion tests/operator-metrics/max-loops/00-assert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v1
kind: ServiceAccount
metadata:
name: sa-assert-metrics
namespace: tempo-operator-system
namespace: ($TEMPO_NAMESPACE)
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
Expand Down
4 changes: 2 additions & 2 deletions tests/operator-metrics/max-loops/00-metrics-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v1
kind: ServiceAccount
metadata:
name: sa-assert-metrics
namespace: tempo-operator-system
namespace: ($TEMPO_NAMESPACE)
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
Expand All @@ -11,7 +11,7 @@ metadata:
subjects:
- kind: ServiceAccount
name: sa-assert-metrics
namespace: tempo-operator-system
namespace: ($TEMPO_NAMESPACE)
roleRef:
kind: ClusterRole
name: tempo-operator-metrics-reader
Expand Down
2 changes: 1 addition & 1 deletion tests/operator-metrics/max-loops/01-assert-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: batch/v1
kind: Job
metadata:
name: verify-metrics
namespace: tempo-operator-system
namespace: ($TEMPO_NAMESPACE)
status:
conditions:
- status: "True"
Expand Down
2 changes: 1 addition & 1 deletion tests/operator-metrics/max-loops/01-verify-metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: batch/v1
kind: Job
metadata:
name: verify-metrics
namespace: tempo-operator-system
namespace: ($TEMPO_NAMESPACE)
spec:
template:
spec:
Expand Down
26 changes: 26 additions & 0 deletions tests/operator-metrics/max-loops/chainsaw-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,39 @@ spec:
steps:
- name: step-00
try:
- command:
entrypoint: oc
args:
- get
- pods
- -A
- -l control-plane=controller-manager
- -l app.kubernetes.io/name=tempo-operator
- -o
- jsonpath={.items[0].metadata.namespace}
outputs:
- name: TEMPO_NAMESPACE
value: ($stdout)
- apply:
file: 00-metrics-service.yaml
- assert:
file: 00-assert.yaml

- name: step-01
try:
- command:
entrypoint: oc
args:
- get
- pods
- -A
- -l control-plane=controller-manager
- -l app.kubernetes.io/name=tempo-operator
- -o
- jsonpath={.items[0].metadata.namespace}
outputs:
- name: TEMPO_NAMESPACE
value: ($stdout)
- apply:
file: 01-verify-metrics.yaml
- assert:
Expand Down