nebari icon indicating copy to clipboard operation
nebari copied to clipboard

[ENH] - Improved checks on projectname during init stage

Open kcpevey opened this issue 2 years ago â€Ē 4 comments

Feature description

My qhub projectname that I used when I ran qhub init included an underscore. This was the error that was generated when I went on to qhub deploy:

[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]: â•ĩ
  1. the error comes from a subsequent step in the project (init vs deploy)
  2. the error mentions name but the variable that I set was projectname

These things make it misleading for users to debug.

I recommend that the init stage have a check to ensure that it passes the required restrictions and provides reasonable feedback when it doesn't

Value and/or benefit

users who are not confused at failures.

Anything else?

No response

kcpevey avatar Aug 23 '22 16:08 kcpevey

Related: https://github.com/Quansight/qhub/issues/1267

kcpevey avatar Aug 23 '22 16:08 kcpevey

@iameskild and @asmijafar20 this should be good to implement in the CLI work

trallard avatar Aug 31 '22 10:08 trallard

Hi @trallard, this check has now be incorporated into the init command 🙌

iameskild avatar Sep 22 '22 16:09 iameskild

This issue is a subset of the items that need to be validated when initializing the qhub-config.yaml.

See this issue for more details: https://github.com/Quansight/qhub/issues/1267

iameskild avatar Sep 22 '22 17:09 iameskild

Completed as part of new Nebari CLI ðŸĪ˜

iameskild avatar Nov 01 '22 08:11 iameskild