feat: Enable StateClients within Docker to connect to destinations#386
Merged
kodiakhq[bot] merged 6 commits intomainfrom Aug 8, 2024
Merged
feat: Enable StateClients within Docker to connect to destinations#386kodiakhq[bot] merged 6 commits intomainfrom
kodiakhq[bot] merged 6 commits intomainfrom
Conversation
94c6cdf to
d0415a5
Compare
erezrokah
approved these changes
Aug 8, 2024
erezrokah
approved these changes
Aug 8, 2024
kodiakhq Bot
pushed a commit
that referenced
this pull request
Aug 9, 2024
🤖 I have created a release *beep* *boop* --- ## [1.22.0](v1.21.5...v1.22.0) (2024-08-08) ### Features * Enable StateClients within Docker to connect to destinations ([#386](#386)) ([da98954](da98954)) ### Bug Fixes * **deps:** Update module github.com/cloudquery/cloudquery-api-go to v1.12.7 ([#387](#387)) ([790f62e](790f62e)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
StateClients open a connection to destinations directly in order to read & persist state. This doesn't work if the source plugin is in a docker container, because docker containers cannot mount sockets (they can mount the files, but the communication doesn't work).
This PR makes two simple changes:
WithUseTCPoption to the client constructor. If it ends up usingstartLocal(as most plugins do), it will send an--addresswith a free TCP address, rather than the default of a Unix socket. Some code is updated to be consistent with this change.host.docker.internal, so that the container can address the host's destination connection. There's no good way of asking if the source plugin has a StateClient, so this minimal change will apply to all docker syncs.By itself, this PR shouldn't change anything. I'll open a minimal PR on the cli to leverage this.
I've tested a Docker sync (typeform) and a non-Docker sync (aws) with these changes and cli changes and they work fine

