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

validate logpush job name #1717

Merged
merged 2 commits into from
Jun 21, 2022

Conversation

sbfaulkner
Copy link
Contributor

when terraforming a cloudflare_logpush_job an invalid name attribute will successfully plan, but fail to apply

this PR adds validation using the appropriate regex so that it can be caught during plan instead

@sbfaulkner sbfaulkner requested a review from jacobbednarz as a code owner June 21, 2022 21:49
@github-actions
Copy link
Contributor

github-actions bot commented Jun 21, 2022

changelog detected ✅

@jacobbednarz jacobbednarz merged commit ed3e773 into cloudflare:master Jun 21, 2022
@github-actions github-actions bot added this to the v3.18.0 milestone Jun 21, 2022
@sbfaulkner sbfaulkner deleted the validate-name-upstream branch June 21, 2022 23:50
@github-actions
Copy link
Contributor

This functionality has been released in v3.18.0 of the Terraform Cloudflare Provider.

Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@ChristophShyper
Copy link
Contributor

ChristophShyper commented Jun 30, 2022

@jacobbednarz @sbfaulkner Is this correct https://github.com/cloudflare/terraform-provider-cloudflare/pull/1717/files#diff-edc89067cd072336937f133d5ec6e811e3557e0670723f455231935a12cf0e0bR33 ?
It's ^[a-zA-Z0-9.-]+$, but shoduln't it be ^[a-zA-Z0-9.-]*$?
Because the new version started failing today:

│ Error: invalid value for name (must contain only alphanumeric characters, hyphens, and periods)
│ 
│   with module.logpush.cloudflare_logpush_job.this,
│   on ../submodule-cloudflare-logpush/main.tf line 25, in resource "cloudflare_logpush_job" "this":
│   25:   name                = ""
│ 
╵

It's another time this month when new release is breaking integration...

@jacobbednarz
Copy link
Member

yep, regex should swap out those characters. if you send over a PR to address, I'll review in the morning.

@ChristophShyper
Copy link
Contributor

Sure thing, here it is #1743

@sbfaulkner
Copy link
Contributor Author

sorry about that - I didn't realize that name could be blank

@ChristophShyper
Copy link
Contributor

When you create a logpush job from console page it's created without a name.
Or at least it's behaving like that when we imported it to Terraform.

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