PostgreSQL backup tool with Point-In-Time-Recovery and restore verification
TypeScript backupbackupsdatabasedatabase-backupdevopsdockergolangkubernetesmariadbmongodbmysqlpgpostgrespostgresqls3self-hostedsystem-administrationtoolsweb-ui
1. Read host capabilities from one docker info call
- 1.1 In
agent/verification/internal/features/container, add a pure function that translates adocker inforesponse into host capabilities: whether user-namespace remapping is on, and whether the CPU limit is supported (CPUCfsPeriodandCPUCfsQuotaboth true). Verify with table-driven unit tests covering both CFS flags true, each one false, and the userns security option present or absent. Run them withgo test -race -count=1 -run Test_ToHostCapabilities ./internal/features/container/inagent/verification. - 1.2 Replace
dockerEngine.UserNSRemapEnabledwith one engine method that callsdocker infoonce and returns those capabilities through the function from 1.1. DeleteUserNSRemapEnabled. Verify thatgrep -rnw UserNSRemapEnabled agent/verificationfinds nothing andmake buildinagent/verificationsucceeds.
2. Apply the CPU limit only when supported
- 2.1 Give
Managera boolean for CPU limit support, set to true inNewManager, and makebuildSpecsetNanoCPUsto 0 when it is false. Verify with abuildSpectest inpostgres_test.gothat assertsNanoCPUsis 0 while the memory limit, the process limit, the dropped capabilities, the minimal capability set and no-new-privileges are unchanged. Keep the existing test asserting the per-jobNanoCPUswhen support is true. Run them withgo test -race -count=1 -run Test_BuildSpec ./internal/features/container/inagent/verification. - 2.2 Update
StartupSelfCheckto use the method from 1.2. Keep the user-namespace warning. Store CPU limit support on the Manager. When support is false, log one warning that restore containers run without a CPU limit and can use every CPU core on the host. Whendocker infofails, keep the existing warning and leave the CPU limit on. Verify thatmake buildinagent/verificationsucceeds and that readingStartupSelfCheckshows each of the three outcomes.
3. Lint and review
- 3.1 Run
make lintinagent/verificationand fix every finding until it passes. - 3.2 Run the mandatory post-implementation review from
AGENTS.mdon the diff and these artifacts, and resolve everyCHANGES REQUIREDfinding.