Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add per-connection driver properties #99

Merged
merged 3 commits into from
Feb 7, 2025
Merged

Conversation

ryannedolan
Copy link
Collaborator

Summary

  • Added connectionProperties parameter to several API methods, including DeployerProvider and ConfigProvider.
  • K8sContext now constructs an ApiClient from the connectionProperties, or failing that, from kube/config.
  • Dropped defaultContext() and related singleton methods, ensuring the driver is re-entrant and can handle simultaneous connections with different configurations.

Details

Previously, we treated K8sContext as a lazy-loaded singleton, which was shared across connections. This was preventing us from productionizing the driver in a multi-tenant service, where different clients may want to use distinct namespaces, usernames, etc. To solve this problem, we now construct K8sContext dynamically from connection-level properties. This required some minor API changes, in order to thread the connection properties through to the various plugins. In particular, DeployerProvider and ConfigProvider now have access to the connection properties. K8sDeployer etc use this to construct ApiClients etc.

Testing

Verified the driver loads from the CLI, unit tests pass, and integration tests pass.

@ryannedolan ryannedolan requested review from jogrogan and ehoner and removed request for jogrogan February 5, 2025 22:15
Copy link
Collaborator

@jogrogan jogrogan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, we should probably at some point start a wiki to document some of these properties we have defined

hoptimator-jdbc/build.gradle Outdated Show resolved Hide resolved
@ryannedolan ryannedolan merged commit bada97a into main Feb 7, 2025
1 check passed
@ryannedolan ryannedolan deleted the driver-properties branch February 7, 2025 00:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants