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

forward plugin stderr to host without hclog #2

Merged
merged 1 commit into from
Nov 6, 2023

Conversation

jan-law
Copy link
Collaborator

@jan-law jan-law commented Nov 6, 2023

To stream agent logs over grpc with the Opni CLI, I have a custom logger in rancher/opni#1774 that logs plugin grpc messages to the plugin stderr, which go-plugin forwards to the agent host process in logStderr. The logs from the agent host process are then streamed to the gateway.

By default, go-plugin takes everything written to stderr and attempts to log it as a structured hclog log. If hclog parsing fails, it casts the output as a string before forwarding to the host (l.Debug(string(line))). My grpc []byte message is casted to a string which causes undefined behaviour. Instead, I'd like to directly forward everything from the plugin stderr without the hclog parsing.

@alexandreLamarre alexandreLamarre merged commit ede0fcc into main Nov 6, 2023
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