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

formatting parameters with %t fails if the values are strings, not bool #158

Merged
merged 1 commit into from
May 11, 2022

Conversation

b-dean
Copy link
Contributor

@b-dean b-dean commented May 5, 2022

This showed up when I was trying to create an incapsula_site resource with dns domain validation. Something like this:

resource "incapsula_site" "this" {
  domain                 = var.public_domain_name
  send_site_setup_emails = false
  force_ssl              = true
  ignore_ssl             = true
  domain_validation      = "dns"
  site_ip                = var.backend_domain_name
}

It gives this error:

Error: Error from Incapsula service when updating site for siteID xxxxxx: {"res":6002,"res_message":"Invalid configuration parameter value","debug_info":{"domain_validation":"%!t(string\u003ddns)","id-info":"999999"}}

I looked at the resource_site.go and saw there was an sprintf with the format of "%t" but with strings being passed in. %t will only work with bool types. But %v seems more appropriate because it will work with strings but also will give "true" or "false" when formatting a bool, just like %t. See golang docs for fmt

@BrachaY BrachaY merged commit 4e0179a into imperva:master May 11, 2022
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