Skip to content

Commit d4dd1b8

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 c9c2a53 commit d4dd1b8

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
@@ -258,6 +258,8 @@ cd $PGADMIN_DIR
258258
log.Error(err, "PodExec failed: ")
259259
intentUsers = append(intentUsers, existingUser)
260260
continue
261+
} else if strings.Contains(strings.TrimSpace(stderr.String()), "UserWarning: pkg_resources is deprecated as an API") {
262+
log.Info(stderr.String())
261263
} else if strings.TrimSpace(stderr.String()) != "" {
262264
log.Error(errors.New(stderr.String()), fmt.Sprintf("pgAdmin setup.py error for %s: ",
263265
intentUser.Username))
@@ -292,7 +294,9 @@ cd $PGADMIN_DIR
292294
log.Error(err, "PodExec failed: ")
293295
continue
294296
}
295-
if strings.TrimSpace(stderr.String()) != "" {
297+
if strings.Contains(strings.TrimSpace(stderr.String()), "UserWarning: pkg_resources is deprecated as an API") {
298+
log.Info(stderr.String())
299+
} else if strings.TrimSpace(stderr.String()) != "" {
296300
log.Error(errors.New(stderr.String()), fmt.Sprintf("pgAdmin setup.py error for %s: ",
297301
intentUser.Username))
298302
continue

0 commit comments

Comments
 (0)