Skip to content

Commit fa7a235

Browse files
committed
Fix bug in perses deployment and add e2e test
This PR fixes the logic of when we deploy the Perses dashboards and datasource and add e2e test for checking they are deplyed only when the perses CRD exists. Signed-off-by: Shirly Radco <sradco@redhat.com>
1 parent ecae78c commit fa7a235

File tree

4 files changed

+698
-0
lines changed

4 files changed

+698
-0
lines changed
Lines changed: 271 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,271 @@
1+
apiVersion: apiextensions.k8s.io/v1
2+
kind: CustomResourceDefinition
3+
metadata:
4+
annotations:
5+
controller-gen.kubebuilder.io/version: v0.16.2
6+
observability.openshift.io/api-support: DevPreview
7+
operatorframework.io/installed-alongside-36062ba172442a9a: openshift-cluster-observability-operator/cluster-observability-operator.v1.3.1
8+
labels:
9+
olm.managed: "true"
10+
operators.coreos.com/cluster-observability-operator.openshift-cluster-observability: ""
11+
name: persesdashboards.perses.dev
12+
spec:
13+
conversion:
14+
strategy: None
15+
group: perses.dev
16+
names:
17+
kind: PersesDashboard
18+
listKind: PersesDashboardList
19+
plural: persesdashboards
20+
shortNames:
21+
- perdb
22+
singular: persesdashboard
23+
scope: Namespaced
24+
versions:
25+
- name: v1alpha1
26+
schema:
27+
openAPIV3Schema:
28+
description: PersesDashboard is the Schema for the persesdashboards API
29+
properties:
30+
apiVersion:
31+
description: |-
32+
APIVersion defines the versioned schema of this representation of an object.
33+
Servers should convert recognized schemas to the latest internal value, and
34+
may reject unrecognized values.
35+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
36+
type: string
37+
kind:
38+
description: |-
39+
Kind is a string value representing the REST resource this object represents.
40+
Servers may infer this from the endpoint the client submits requests to.
41+
Cannot be updated.
42+
In CamelCase.
43+
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
44+
type: string
45+
metadata:
46+
type: object
47+
spec:
48+
properties:
49+
datasources:
50+
additionalProperties:
51+
properties:
52+
default:
53+
type: boolean
54+
display:
55+
properties:
56+
description:
57+
type: string
58+
name:
59+
type: string
60+
type: object
61+
plugin:
62+
description: |-
63+
Plugin will contain the datasource configuration.
64+
The data typed is available in Cue.
65+
properties:
66+
kind:
67+
type: string
68+
spec:
69+
x-kubernetes-preserve-unknown-fields: true
70+
required:
71+
- kind
72+
- spec
73+
type: object
74+
required:
75+
- default
76+
- plugin
77+
type: object
78+
description: Datasources is an optional list of datasource definition.
79+
type: object
80+
display:
81+
properties:
82+
description:
83+
type: string
84+
name:
85+
type: string
86+
type: object
87+
duration:
88+
description: Duration is the default time range to use when getting
89+
data to fill the dashboard
90+
format: duration
91+
pattern: ^(([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?$
92+
type: string
93+
layouts:
94+
items:
95+
properties:
96+
kind:
97+
type: string
98+
spec:
99+
x-kubernetes-preserve-unknown-fields: true
100+
required:
101+
- kind
102+
- spec
103+
type: object
104+
type: array
105+
panels:
106+
additionalProperties:
107+
properties:
108+
kind:
109+
type: string
110+
spec:
111+
properties:
112+
display:
113+
properties:
114+
description:
115+
type: string
116+
name:
117+
type: string
118+
required:
119+
- name
120+
type: object
121+
links:
122+
items:
123+
properties:
124+
name:
125+
type: string
126+
renderVariables:
127+
type: boolean
128+
targetBlank:
129+
type: boolean
130+
tooltip:
131+
type: string
132+
url:
133+
type: string
134+
required:
135+
- url
136+
type: object
137+
type: array
138+
plugin:
139+
properties:
140+
kind:
141+
type: string
142+
spec:
143+
x-kubernetes-preserve-unknown-fields: true
144+
required:
145+
- kind
146+
- spec
147+
type: object
148+
queries:
149+
items:
150+
properties:
151+
kind:
152+
type: string
153+
spec:
154+
properties:
155+
plugin:
156+
properties:
157+
kind:
158+
type: string
159+
spec:
160+
x-kubernetes-preserve-unknown-fields: true
161+
required:
162+
- kind
163+
- spec
164+
type: object
165+
required:
166+
- plugin
167+
type: object
168+
required:
169+
- kind
170+
- spec
171+
type: object
172+
type: array
173+
required:
174+
- display
175+
- plugin
176+
type: object
177+
required:
178+
- kind
179+
- spec
180+
type: object
181+
type: object
182+
refreshInterval:
183+
description: RefreshInterval is the default refresh interval to use
184+
when landing on the dashboard
185+
format: duration
186+
pattern: ^(([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?$
187+
type: string
188+
variables:
189+
items:
190+
properties:
191+
kind:
192+
description: Kind is the type of the variable. Depending on
193+
the value of Kind, it will change the content of Spec.
194+
type: string
195+
spec:
196+
x-kubernetes-preserve-unknown-fields: true
197+
required:
198+
- kind
199+
- spec
200+
type: object
201+
type: array
202+
required:
203+
- duration
204+
- layouts
205+
- panels
206+
type: object
207+
status:
208+
description: PersesDashboardStatus defines the observed state of PersesDashboard
209+
properties:
210+
conditions:
211+
items:
212+
description: Condition contains details for one aspect of the current
213+
state of this API Resource.
214+
properties:
215+
lastTransitionTime:
216+
description: |-
217+
lastTransitionTime is the last time the condition transitioned from one status to another.
218+
This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
219+
format: date-time
220+
type: string
221+
message:
222+
description: |-
223+
message is a human readable message indicating details about the transition.
224+
This may be an empty string.
225+
maxLength: 32768
226+
type: string
227+
observedGeneration:
228+
description: |-
229+
observedGeneration represents the .metadata.generation that the condition was set based upon.
230+
For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
231+
with respect to the current state of the instance.
232+
format: int64
233+
minimum: 0
234+
type: integer
235+
reason:
236+
description: |-
237+
reason contains a programmatic identifier indicating the reason for the condition's last transition.
238+
Producers of specific condition types may define expected values and meanings for this field,
239+
and whether the values are considered a guaranteed API.
240+
The value should be a CamelCase string.
241+
This field may not be empty.
242+
maxLength: 1024
243+
minLength: 1
244+
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
245+
type: string
246+
status:
247+
description: status of the condition, one of True, False, Unknown.
248+
enum:
249+
- "True"
250+
- "False"
251+
- Unknown
252+
type: string
253+
type:
254+
description: type of condition in CamelCase or in foo.example.com/CamelCase.
255+
maxLength: 316
256+
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
257+
type: string
258+
required:
259+
- lastTransitionTime
260+
- message
261+
- reason
262+
- status
263+
- type
264+
type: object
265+
type: array
266+
type: object
267+
type: object
268+
served: true
269+
storage: true
270+
subresources:
271+
status: {}

0 commit comments

Comments
 (0)