Skip to content

Commit 3757a8e

Browse files
committed
Handle pgAdmin UserWarning
Capture the an expected user warning for pgAdmin9.8 using python3.11 and log as an INFO message rather than an ERROR which short-circuits user creation and updating.
1 parent 47f283c commit 3757a8e

File tree

1 file changed

+5
-1
lines changed
  • internal/controller/standalone_pgadmin

1 file changed

+5
-1
lines changed

internal/controller/standalone_pgadmin/users.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,8 @@ cd $PGADMIN_DIR
257257
log.Error(err, "PodExec failed: ")
258258
intentUsers = append(intentUsers, existingUser)
259259
continue
260+
} else if strings.Contains(strings.TrimSpace(stderr.String()), "UserWarning: pkg_resources is deprecated as an API") {
261+
log.Info(stderr.String())
260262
} else if strings.TrimSpace(stderr.String()) != "" {
261263
log.Error(errors.New(stderr.String()), fmt.Sprintf("pgAdmin setup.py error for %s: ",
262264
intentUser.Username))
@@ -291,7 +293,9 @@ cd $PGADMIN_DIR
291293
log.Error(err, "PodExec failed: ")
292294
continue
293295
}
294-
if strings.TrimSpace(stderr.String()) != "" {
296+
if strings.Contains(strings.TrimSpace(stderr.String()), "UserWarning: pkg_resources is deprecated as an API") {
297+
log.Info(stderr.String())
298+
} else if strings.TrimSpace(stderr.String()) != "" {
295299
log.Error(errors.New(stderr.String()), fmt.Sprintf("pgAdmin setup.py error for %s: ",
296300
intentUser.Username))
297301
continue

0 commit comments

Comments
 (0)