Skip to content

Commit f43ffd2

Browse files
committed
Merge branch 'checkup-no-latest' into 'master'
Do not use "latest" for postgres-checkup + a couple of tweaks of checkup form See merge request postgres-ai/database-lab!860
2 parents be17a32 + 3207c9a commit f43ffd2

File tree

3 files changed

+20
-7
lines changed

3 files changed

+20
-7
lines changed

ui/packages/platform/src/components/CheckupAgentForm/CheckupAgentForm.tsx

+8-2
Original file line numberDiff line numberDiff line change
@@ -496,8 +496,9 @@ class CheckupAgentForm extends Component<
496496
id="hostName"
497497
className={classes.textInput}
498498
helperText={
499-
'Hostname(s) or IP address(es) divided ' +
500-
'by `;`, `,`, space or end of string'
499+
'Enter hostnames or IPs, separated by commas, spaces, or line breaks. ' +
500+
'To reach your machine\'s "localhost" from the container, use "host.docker.internal". ' +
501+
'The same approach works when using SSH port forwarding from your machine to a remote host.'
501502
}
502503
margin="normal"
503504
onChange={(e) => {
@@ -552,6 +553,11 @@ class CheckupAgentForm extends Component<
552553
variant="outlined"
553554
id="databaseUserName"
554555
className={classes.textInput}
556+
helperText={
557+
'You can create a new DB user named "pgai_observer", then grant ' +
558+
'the "pg_monitor" role to this user using the following SQL command: ' +
559+
'GRANT pg_monitor TO pgai_observer;'
560+
}
555561
margin="normal"
556562
onChange={(e) => {
557563
this.setState({

ui/packages/platform/src/components/Reports/Reports.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -309,11 +309,11 @@ class Reports extends Component<ReportsWithStylesProps, ReportsState> {
309309
onClick={() => this.props.history.push('/' + org + '/checkup-config')}
310310
title={
311311
this.props.orgPermissions?.checkupReportConfigure
312-
? 'Add Checkup agent to your server'
312+
? 'Start generating new reports for your Postgres servers'
313313
: messages.noPermission
314314
}
315315
>
316-
Add agent
316+
Generate report
317317
</ConsoleButtonWrapper>
318318
)
319319

ui/packages/platform/src/utils/cfggen.ts

+10-3
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ cat <<EOF > ${data.projectName}.yml
129129
${this.generateCheckupConfig(data)}
130130
EOF
131131
132-
# Start check health of Postgres databases
133132
`
134133

135134
if (data.password === 'inputpassword') {
@@ -140,11 +139,19 @@ EOF
140139
&& read -s -p "" DB_PWD \\
141140
&& PGPASSWORD="$\{DB_PWD}" \\
142141
&& `
142+
} else {
143+
result =
144+
result +
145+
`# Specify Postgres password
146+
export DB_PWD=****
147+
148+
`
143149
}
144150

145151
result =
146152
result +
147-
`docker run \\
153+
`# Start check health of Postgres databases
154+
docker run \\
148155
-v $(pwd)/${data.projectName}.yml:/${data.projectName}.yml \\
149156
-v $(pwd)/artifacts:/artifacts \\`
150157

@@ -162,7 +169,7 @@ EOF
162169
-e ${hostsType}="${hosts}" \\
163170
-e CHECKUP_SNAPSHOT_DISTANCE_SECONDS=${data.collectPeriod} \\
164171
-e PGPASSWORD="$\{DB_PWD}" \\
165-
registry.gitlab.com/postgres-ai/postgres-checkup:latest bash run_checkup.sh
172+
registry.gitlab.com/postgres-ai/postgres-checkup:1-5-1 bash run_checkup.sh
166173
`
167174

168175
return result

0 commit comments

Comments
 (0)