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

bugfix: cf-tf adds extra space before IDs in ruleset rules block #560

Merged

Conversation

tamas-jozsa
Copy link
Contributor

@tamas-jozsa tamas-jozsa commented May 12, 2023

I was checking a customer's tf config why it was failing and noticed this:

...
action = "skip"
  action_parameters {
    rules = {
      "4814384a9e5d4991b9815dcfc25d2f1f" = "37da7855d2f94f69865365d894a556a4, 6afe6795ee6a48d6a1dfe59255395a78, 5a6f5a57cde8428ab0668ce17cdec0c8, 5e4903d6afa841c9b88b96203297003f, 2380cd409b604c2a9273042f3eb29c4e, f5aebedc99a14c8d9e8cfa2ce5f94216, edf8c37cc81747d382690b3c77e82ce4, 1129dfb383bb42e48466488cf3b37cb1"
    }
  }
...

It's not much, but if you try to apply it, you can see the JSON that is sent to rulesets:

...
"action": "skip",
"action_parameters": {
    "rules": {
        "4814384a9e5d4991b9815dcfc25d2f1f": [
            "37da7855d2f94f69865365d894a556a4",
            " 6afe6795ee6a48d6a1dfe59255395a78",
            " 5a6f5a57cde8428ab0668ce17cdec0c8",
            " 5e4903d6afa841c9b88b96203297003f",
            " 2380cd409b604c2a9273042f3eb29c4e",
            " f5aebedc99a14c8d9e8cfa2ce5f94216",
            " edf8c37cc81747d382690b3c77e82ce4",
            " 1129dfb383bb42e48466488cf3b37cb1"
        ]
    }
},
...

It could be that the old way of generating the TF trimmed the whitespace for us and in the new way, it doesn't do that anymore.

Anyway, this PR is to fix this bug.

@tamas-jozsa tamas-jozsa changed the title bugfix: cf-tf adds extra space before IDs in rules block bugfix: cf-tf adds extra space before IDs in ruleset rules block May 12, 2023
@jacobbednarz jacobbednarz merged commit ed77221 into cloudflare:master May 14, 2023
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.

3 participants