Skip to content

databases: always send tls for rsyslog logsink updates - #1223

Open
pcbeingused333 wants to merge 2 commits into
digitalocean:mainfrom
pcbeingused333:fix/update-logsink-tls-false
Open

pcbeingused333 wants to merge 2 commits into
digitalocean:mainfrom
pcbeingused333:fix/update-logsink-tls-false

Conversation

@pcbeingused333

Copy link
Copy Markdown

Follow-up to #906, which fixed this for CreateLogsink; this covers UpdateLogsink.

Root cause. DatabaseUpdateLogsinkRequest embeds DatabaseLogsinkConfig, whose TLS field is tagged json:"tls,omitempty". UpdateLogsink therefore drops an explicit TLS: false from the PUT body, although the API spec requires tls for rsyslog sinks (required: server, port, tls, format).

Fix. Add MarshalJSON on DatabaseUpdateLogsinkRequest, mirroring the create request: when the config looks like rsyslog (server/port/format set) tls is always emitted; Elasticsearch/OpenSearch configs keep omitting it.

Tests. TestDatabases_UpdateLogsink_RsyslogKeepsTLSFalse checks the request body contains "tls": false (fails before the change); TestDatabases_UpdateLogsink_OpensearchOmitsTLS checks tls is still absent for OpenSearch configs. Full go test . passes.


This change was prepared with the assistance of an AI coding tool (Claude) and submitted by a human contributor who is responsible for it.

pcbeingused333 and others added 2 commits November 11, 2026 23:22
DatabaseUpdateLogsinkRequest marshaled TLS with omitempty, so an
explicit TLS: false was dropped from the PUT body even though the API
requires tls for rsyslog sinks. Add a MarshalJSON, mirroring the one on
DatabaseCreateLogsinkRequest, that keeps tls for rsyslog configs and
still omits it for Elasticsearch/OpenSearch configs.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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.

1 participant