nebari
nebari copied to clipboard
[ENH] - Additional checks for the cli init stage
Feature description
During the qhub init
I used a projectname
that had an underscore. I believe it wasn't until I got to the deploy
stage that I saw a failure:
[terraform]: â Error: "name" can only contain lowercase letters, numbers and hyphens
[terraform]: â
[terraform]: â with module.kubernetes.google_container_cluster.main,
[terraform]: â on modules/kubernetes/main.tf line 5, in resource "google_container_cluster" "main":
[terraform]: â 5: name = var.name
[terraform]: â
[terraform]: âĩ
[terraform]: â·
[terraform]: â Error: "account_id" ("this_deployment-dev") doesn't match regexp "^[a-z](?:[-a-z0-9]{4,28}[a-z0-9])$"
[terraform]: â
[terraform]: â with module.kubernetes.google_service_account.main,
[terraform]: â on modules/kubernetes/service_account.tf line 2, in resource "google_service_account" "main":
[terraform]: â 2: account_id = var.name
[terraform]: â
[terraform]: âĩ
The error message Error: "name" can only contain lowercase letters, numbers and hyphens
is what we were hitting, but this originated from the projectname
flag passed to qhub init
so its very hard for an end user to comprehend how to resolve this.
I recommend we do the checks from the above errors ("lowercase letters, numbers and hyphens" and regexp "^a-z$") during the init stage so we can give users helpful error messages.
Value and/or benefit
Users are given clearer error messaging.
Anything else?
No response