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

fix: bitcoindCustomConfig parsing #3074

Merged
merged 1 commit into from
May 11, 2023
Merged

Conversation

openoms
Copy link
Contributor

@openoms openoms commented May 11, 2023

chatGPT result on why:
dbcache: 2600
is converted to:
dbcache=%!{float64=2600}
with the current config?

The error you're seeing is because you're trying to print a float64 type value with printf "%s=%s", which expects string arguments. The printf function in Go (and in this case, Go templating language which Helm uses) expects you to provide a format specifier that matches the type of the variable you're trying to print.

The %s format specifier is used for strings. When you try to print a float64 using %s, it doesn't know how to convert it and hence the output dbcache=%!{float64=2600}.

To fix this, you should use the %v format specifier, which is a generic format specifier that can print any type in its default format.

Tested with the integer values quoted and unquoted as well - results in the good bitcoin.conf format now.

@openoms openoms requested a review from krtk6160 May 11, 2023 08:13
Copy link
Member

@krtk6160 krtk6160 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@krtk6160 krtk6160 self-requested a review May 11, 2023 08:55
@openoms openoms merged commit bad80d0 into main May 11, 2023
@openoms openoms deleted the fix-bitcoindCustomConfig-parsing branch May 11, 2023 09:03
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