deislabs / hippo

The WebAssembly Platform
https://docs.hippofactory.dev
Other
415 stars 38 forks source link

Support application name with '.' #873

Open vdice opened 2 years ago

vdice commented 2 years ago

I have a Spin app with the name configured to example.com. When I attempt to deploy to Hippo, I am greeted with the following:

$ cat spin.toml | head -n1
name = "example.com"

$ spin deploy
Error: Error creating Hippo app called example.com: One or more validation errors occurred. {"Name": ["'Name' is not in the correct format."]}

Would it be possible to add support in Hippo for application names that include a '.' character?

Note: tested with spin 0.2.0 (60907c4 2022-06-10) and Hippo v0.15.1

bacongobbler commented 2 years ago

Yes. The only thing we want to ensure nothing breaks is with regards to the default domain. In Hippo, if a Channel is created with no domain name, the default domain name is channel_name.app_name.platform_domain. If you created an app with the name example.com with a platform domain of hippo.local.fermyon.link, then you could end up with a domain called staging.example.com.hippo.local.fermyon.link. Is that acceptable, or do we need to perform some santization?

Here's where the validation occurs:

https://github.com/deislabs/hippo/blob/c7d84270259598a2654ffeca2b6555c9f6e64ab6/src/Application/Apps/Commands/CreateAppCommandValidator.cs#L13

bacongobbler commented 2 years ago

Perhaps a more realistic name could be fermyon.dev. An app with a “canary” channel could have the domain canary.fermyon.dev.fermyon.dev.