Skip to content

Commit

Permalink
Fix max-loops test to detect the operator namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
IshwarKanse committed Nov 7, 2024
1 parent c58d40b commit 662c29b
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 5 deletions.
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

0 comments on commit 662c29b

Please sign in to comment.