File tree 1 file changed +38
-0
lines changed
1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,34 @@ metadata:
7
7
name : gitpod
8
8
spec :
9
9
collectors :
10
+ - run :
11
+ collectorName : database
12
+ image : bitnami/mysql:5.7
13
+ name : database
14
+ command :
15
+ - /bin/bash
16
+ - -c
17
+ args :
18
+ - |
19
+ set -e
20
+
21
+ if [ '{{repl (ConfigOptionEquals "db_incluster" "1") }}' = "true" ]; then
22
+ # In cluster database
23
+ echo "pass"
24
+ exit 0
25
+ elif [ '{{repl and (ConfigOptionEquals "db_incluster" "0") (ConfigOptionEquals "db_cloudsql_enabled" "0") }}' = "true" ]; then
26
+ # External database - suppress CLI output
27
+ result=$(mysql \
28
+ --connect-timeout=5 \
29
+ --user="{{repl ConfigOption "db_username" }}" \
30
+ --password="{{repl ConfigOption "db_password" }}" \
31
+ --host="{{repl ConfigOption "db_host" }}" \
32
+ --port="{{repl ConfigOption "db_port" }}" \
33
+ --execute="SELECT 1 + 1")
34
+
35
+ echo "pass"
36
+ exit 0
37
+ fi
10
38
- run :
11
39
collectorName : " kernel"
12
40
image : alpine/semver
@@ -151,3 +179,13 @@ spec:
151
179
message : No default storage class found
152
180
- pass :
153
181
message : Default storage class found
182
+ - textAnalyze :
183
+ checkName : Database connection is valid
184
+ fileName : database/database.log
185
+ regex : pass
186
+ outcomes :
187
+ - pass :
188
+ when : " true"
189
+ message : Database connection is valid
190
+ - fail :
191
+ message : Database connection is invalid. Please check your settings and that the database is accessible from your cluster
You can’t perform that action at this time.
0 commit comments