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

"Invalid value for field 'resource.name'" if username contains "." character #39

Open
yogeek opened this issue Mar 20, 2018 · 1 comment
Assignees
Labels

Comments

@yogeek
Copy link

yogeek commented Mar 20, 2018

I had the following error when trying to use this project to create a DCOS cluster on GCP :

terraform apply -var-file desired_cluster_profile.tfvars 
[...]
 google_compute_network.default: 1 error(s) occurred:

* google_compute_network.default: Error creating network: googleapi: Error 400: Invalid value for field 'resource.name': 'guillaume.dupin-tfa0be-dcos-network'. Must be a match of regex '(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?)', invalid
[...]

It is because GCP resources are named with the username (returned by the script "whoami.sh") but if this name contains a dot ("."), it is not a valid character in a GCP resource.

Maybe a fix would be to remove dots (and any forbidden character) from the whoami result to avoid such error.

@bernadinm bernadinm self-assigned this Mar 28, 2018
@bernadinm bernadinm added the bug label Mar 28, 2018
@bernadinm
Copy link
Contributor

Thanks @yogeek for filing this. I will go ahead and add this check in GCP and related projects to ensure it provides the valid character.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants