Skip to content

feat: function name matches KService name#317

Merged
zroubalik merged 2 commits intoknative:mainfrom
zroubalik:name
Apr 26, 2021
Merged

feat: function name matches KService name#317
zroubalik merged 2 commits intoknative:mainfrom
zroubalik:name

Conversation

@zroubalik
Copy link
Contributor

Signed-off-by: Zbynek Roubalik zroubali@redhat.com

  • Error message printed before the actual creation:
$  ./func create test-                                                                                                                          
Error: Function name must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character (e.g. 'my-name',  or '123-abc', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?')
  • Interactive session and incorrect name specified at the input -> error:
$ ./func create test- -c                                                                                                                             
Error: Function name must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character (e.g. 'my-name',  or '123-abc', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?')
  • Interactive session with valid name, but with an invalid Project path later specified by user -> the prompt loops till valid name is entered:
$ ./func create test -c                                                                                                                               
Project path (/Users/zroubali/go/src/github.com/boson-project/func/test): test-
Error: Function name must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character (e.g. 'my-name',  or '123-abc', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?')
Project path (/Users/zroubali/go/src/github.com/boson-project/func/test): test
Runtime (node): 
Trigger (http): 

Fixes: #276

Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
Copy link
Contributor

@lance lance left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. I like that there are no longer two names (service and function).

Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
@zroubalik zroubalik merged commit 541e858 into knative:main Apr 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Function name should match service name

2 participants