Commit Graph
1 Commits
Author SHA1 Message Date
Krzysztof Skrzętnicki 8a8537355b Database objects periodic import (#43790)
* Add periodic import of database objects from supported databases.

A single implementation is included: for Postgres, along with necessary changes.

Also refactors SQLAdminClient interface to accept cert expiry instead of pulling that information from `tlsca.Identity`.

* fix logging, imports

* add missing license

* review feedback
- several minor changes
- apply import rules for all registered object fetchers using wrapper type
- refactor DAC to use object fetcher
- adjust tests

* add comment and missing log call

* support config overrides through unstable env vars, including disabling the service entirely

* refactoring and minor changes

- be more specific about required API for ObjectFetcherConfig
- measure scan time
- bump default scan interval
- call StopImporter from stopDatabase to fix issue with dynamic db resource updates
- add comments

* Refactor `connectAsAdmin`, add `withDefaultDatabase()` method for clarity of implementation.

* Reduce surface area for fetcher config

* make the not-implemented case less noisy by skipping the error

* lint fix

* decrease verbosity of reporting for unsupported configurations

* make `reason` field private

* move `unregisterObjectFetcher` to tests

* avoid exceedingly long lines with log calls

* correct formatting leftover from slog conversion

* tighten logic around disabled importer

if the scan interval is zero or less, the importer becomes disabled, which avoids panic from interval.New().

add some tests and comments for clarity.

* drop unused method
2024-07-25 18:47:56 +00:00