Skip to content

Add per-connection driver properties#99

Merged
ryannedolan merged 3 commits intomainfrom
driver-properties
Feb 7, 2025
Merged

Add per-connection driver properties#99
ryannedolan merged 3 commits intomainfrom
driver-properties

Conversation

@ryannedolan
Copy link
Copy Markdown
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 ehoner and jogrogan and removed request for jogrogan February 5, 2025 22:15
Copy link
Copy Markdown
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

ryannedolan and others added 2 commits February 6, 2025 10:19
@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