Skip to content

Commit

Permalink
[Chore] Fix the monolithic sts test assert and max-loops test to dete…
Browse files Browse the repository at this point in the history
…ct the operator namespace (#1087)

* Fix monolithic sts test

* Fix max-loops test to detect the operator namespace
  • Loading branch information
IshwarKanse authored Nov 7, 2024
1 parent 45b7540 commit 1fb2623
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 5 deletions.
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

0 comments on commit 1fb2623

Please sign in to comment.