-
Notifications
You must be signed in to change notification settings - Fork 547
feat: Enable StateClient usage under docker plugins. #18880
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
Conversation
cli/cmd/sync.go
Outdated
| managedplugin.WithTeamName(teamName), | ||
| managedplugin.WithLicenseFile(licenseFile), | ||
| } | ||
| if isThereADockerSourcePluginWithBackend { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we do this only for destinations that are used as state?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also a follow PR can be to update the logic to consider if the OS is Windows per #18039
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made the following changes:
- UseTCP is more strict; only enabling it when the destination is used as state
- I propagated the state that a source
shouldReplaceLocalhostall the way toReplaceVariables. Before, it was replacing if a source had aRegistryDocker, which is not ideal because it doesn't necessarily need to use state. I don't think it's a bug because if it doesn't use a backend it probably doesn't need any replacing, but it's more correct now. - Added tests where possible.
Regarding the Windows edge case, I'd fix it separately (in another PR, as you say)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(I re-ran the syncs in the OP; they still work)
🤖 I have created a release *beep* *boop* --- ## [6.4.0](cli-v6.3.0...cli-v6.4.0) (2024-08-13) ### Features * Enable StateClient usage under docker plugins. ([#18880](#18880)) ([2d542da](2d542da)) * Enable user to override `invocation_id` ([#18878](#18878)) ([3af7f5e](3af7f5e)) ### Bug Fixes * **deps:** Update module github.com/cloudquery/cloudquery-api-go to v1.12.7 ([#18865](#18865)) ([32a17d8](32a17d8)) * **deps:** Update module github.com/cloudquery/plugin-sdk/v4 to v4.59.0 ([#18881](#18881)) ([8f7667f](8f7667f)) * **deps:** Update module github.com/cloudquery/plugin-sdk/v4 to v4.60.0 ([#18922](#18922)) ([7626636](7626636)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
StateClients currently don't work in docker-based plugins because they cannot connect to destination sockets.This CLI change detects that a source has:
Dockerregistry settingbackend_optionssetAnd in this case it makes the following config changes:
host.docker.internalextra host to the docker create configurationAs a result, normal syncs continue to work exactly the same as before, but syncs that suffered from this config problem now work seamlessly with the new settings:
(Note that I'm using an unreleased pb-go replace)