Skip to content

fix: omit empty tls-ca-cert-file to prevent fatal config error (#1715)#1716

Open
fahrimert wants to merge 1 commit intoOT-CONTAINER-KIT:mainfrom
fahrimert:fix-issue-1715
Open

fix: omit empty tls-ca-cert-file to prevent fatal config error (#1715)#1716
fahrimert wants to merge 1 commit intoOT-CONTAINER-KIT:mainfrom
fahrimert:fix-issue-1715

Conversation

@fahrimert
Copy link
Copy Markdown

This PR fixes a fatal configuration error that occurs when a Redis cluster is deployed with TLS but without a provided CA certificate (ca.crt omitted from the Secret).

In v0.24.0, if the CA cert environment variable is empty, the operator writes tls-ca-cert-file "" into the generated redis.conf. This causes the Redis configuration parser to fail with a wrong number of arguments fatal error, crashing the pod.

Changes made:

Added a conditional initialization check in internal/agent/bootstrap/redis/config.go.

Added a conditional initialization check in internal/agent/bootstrap/sentinel/config.go.
The tls-ca-cert-file directive is now only appended if the certificate value is not an empty string.

Fixes #1715

Type of change

Bug fix (non-breaking change which fixes an issue)

Checklist

[ ] Tests have been added/modified and all tests pass.

[x] Functionality/bugs have been confirmed to be unchanged or fixed.

[x] I have performed a self-review of my own code.

[ ] Documentation has been updated or added where necessary.

Additional Context

I successfully reproduced the issue locally on a K3s cluster. I verified the root cause and ensured that this logical fix prevents the empty argument from being written to the configuration file, allowing the Redis pods to start correctly without crashing into a CrashLoopBackOff state.

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 16, 2026

Codecov Report

❌ Patch coverage is 0% with 5 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@6864c09). Learn more about missing BASE report.

Files with missing lines Patch % Lines
internal/agent/bootstrap/redis/config.go 0.00% 3 Missing ⚠️
internal/agent/bootstrap/sentinel/config.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1716   +/-   ##
=======================================
  Coverage        ?   30.12%           
=======================================
  Files           ?       83           
  Lines           ?     6726           
  Branches        ?        0           
=======================================
  Hits            ?     2026           
  Misses          ?     4504           
  Partials        ?      196           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

FATAL CONFIG FILE ERROR after upgrade to v 0.24.0

1 participant