Make app and fn name length configurable
threejeez opened this issue · 2 comments
Description
We have a need to create app and fn names that are longer than the current 30 character limit. The associated database fields are varchar(256)
, yet looking through the code, we see a const declaration of 30 characters for each and these cannot be overridden:
https://github.com/fnproject/fn/blob/master/api/models/error.go#L10
I would like to propose that we make 30 characters the default, but make them configurable at runtime.
Steps to reproduce the issue:
- Try to create a function or app with more than 30 characters
Describe the results you received:
We get an error saying that neither field can't be over 30 characters
Describe the results you expected:
We expect to be able to set an app and/or function name that is greater than 30 characters without failing
Additional information you deem important (e.g. issue happens only occasionally):
Output of fn version
(CLI command):
curl to fnserver directly:
$ curl http://localhost:8080/v2/apps -XPOST -d "{\"name\":\"thisislongerthanthirtycharactersthisislongerthanthirtycharactersthisislongerthanthirtycharactersthisislongerthanthirtycharactersthisislongerthanthirtycharacters\"}"
{"message":"App name must be 30 characters or less"}
Additional environment details (OSX, Linux, flags, etc.):
OSX
we're looking into increasing the default of this value, it may be possible to just bump it up but running some checks first.