pgadmin-org / pgadmin-org/pgadmin4

Programmatically updating servers from without overwriting them

Open
#7,426 6 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Feature
Dominant language
Python
Stars
3.8k
Forks
891
Avg merge
4d 7h
Merged PRs (30d)
8

Description

I installed pgadmin in Kubernetes and added a sidecar to auto-import servers created as configmaps in the pgadmin namespace (using https://github.com/kiwigrid/k8s-sidecar).

To get the servers into pgadmin I compile them all into one servers.json (making sure they are all Shared) and call setup.py load-servers --replace servers.json in the main pgadmin container with the admin user.

This works quite well in general. All servers are created, updated and deleted from the list for all users (the users login with Keycloak/Oauth2).

BUT: Every time something changed (server was added, changed, deleted) and the load-servers command ran, the saved passwords of all users are gone. My guess is, that the --replace deletes the reference somehow.

I already tried to use stable keys in the servers.json and removing the --replace hpoing, that this will update the existing entries. But it seems to just add new entries then.

Is there the possibility to update all servers without loosing the saved passwords for all users?

Thanks in advance!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing setup.py load-servers --replace servers.json in the Kubernetes setup and compare it with the no---replace invocation described. Done means adding, changing, or deleting a server no longer removes saved passwords for existing users.

Written by the indexing model from the issue text.

Assessment

Tech stack
kubernetes, postgresql, python
Domain
backend, databases, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.