-
Notifications
You must be signed in to change notification settings - Fork 105
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
Partial failure if the repository name contains any space #161
Comments
Hi @btlogy thanks for bringing this to our attention. The errors you see are from the provider not from the module. GitHub does not allow spaces in names and converts them to dashes. The provider does not seem to care about validation here. As we are just shifting this responsibility to the provider and they are shifting it to the API the error you see is expected. The upstream error can be tracked here: integrations/terraform-provider-github#1215 maybe you wanna upvote it there ;) The solution here is to not try to create repositories with spaces but use dashes right away as even GitHub UI adds the dashes for you: |
Hi @mariux Thank you this quick answer. Before reading your comment, I was considering to propose a PR using input-variable-validation here to avoid space in the name: terraform-github-repository/variables.tf Lines 6 to 9 in ee6001a
Should I try to do this upstream instead? |
In our case, we do not have control on the input, so we have rely on the input being validated by either the module and/or the provider. |
See mineiros-io#161 Signed-off-by: Benoit Donneaux <[email protected]>
Something like this would do for us now: While waiting for you feedback (@mariux), I'll investigate if this could/should be done in the provider instead... |
It will likely be harder for me to fix the provider, but I can try: |
Hi @mariux I've submitted my PR above for the provider. |
Nevermind: I've not seen we are still using |
I can confirm here that provider |
The module seems to allow spaces to be used in the name of the repository.
It will apparently converts them into
-
while building the plan (I've not found yet where this is done).However, it partially fails to apply the plan: the repository will be created in GitHub but Terraform will fail.
How to reproduce
terraform plan
- should give something like this:terraform apply
- should fail with this error:terrafrom apply
should fail again with this other error:(Because
archive_on_destroy
is set totrue
by default I suppose).Expected behavior
I suppose the
terraform plan
command should explicitly fail and report the presence of invalid character(s) in the name.The text was updated successfully, but these errors were encountered: