feat: enable to source customHeaders from the config file #1339
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.
📑 Description
This PR introduces the ability to read custom headers directly from the configuration file. The existing behavior is preserved: custom headers passed via the CLI are appended to those specified in the configuration file, which can be left empty.
Upon reviewing the source code, I noticed that
customHeaders
are sometimes "blanked" to prevent exposing sensitive data.k8sgpt/cmd/dump/dump.go
Line 60 in c3f4486
customHeaders
from the configuration file. However, this limitation prevents the operator from leveragingcustomHeaders
in configurations.This PR addresses the issue by enabling
customHeaders
to be defined in the configuration file, making it more flexible and useful for the operator.Please confirm if my understanding aligns with the intended behavior, and let me know if you would prefer I open an issue for tracking this change. Also, I noticed the documentation has a section regarding
customHeaders
, I'll be happy to update that one as well if this change is acceptable.✅ Checks
ℹ Additional Information
Here is an example of writing the headers in the configuration file: