-
Notifications
You must be signed in to change notification settings - Fork 224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove language default and fix command flags #170
Conversation
Thank you for your contribution. I've just checked and your commit doesn't appear to be signed-off. |
@rgee0 this should fix the bug you'd spotted when looking at openfaas/faas#297 |
commands/deploy.go
Outdated
@@ -159,6 +159,7 @@ func runDeploy(cmd *cobra.Command, args []string) { | |||
os.Exit(1) | |||
} | |||
|
|||
fmt.Printf("GOING IN: %s, %s, %s, %s, %s\n", fprocess, gateway, functionName, image, language) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a stray debug line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I saw it come up in the git diff, but it wasn't there in the editor pane, assumed VSCode was playing up - but yep, will nuke.
I’ll try to give it a run out tomorrow |
This commit stops using `node` as a default language due to it conflicting with functions where the `fprocess` is set in the image. Given the large numbers of languages having a default makes less sense now. It also removes some of the copy-paste/redundant/irrelevant flag definitions that ended up in newly added subcommands. Signed-off-by: John McCabe <[email protected]>
Confirming this fixes the problem, thanks John! |
|
||
``` | ||
$ faas-cli build \ | ||
--image=alexellis2/node_info \ | ||
--lang= node \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have an extra space here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@johnmccabe can you push this fixed? ^ extra space between = and node
@@ -26,7 +26,7 @@ func init() { | |||
buildCmd.Flags().StringVar(&image, "image", "", "Docker image name to build") | |||
buildCmd.Flags().StringVar(&handler, "handler", "", "Directory with handler for function, e.g. handler.js") | |||
buildCmd.Flags().StringVar(&functionName, "name", "", "Name of the deployed function") | |||
buildCmd.Flags().StringVar(&language, "lang", "node", "Programming language template") | |||
buildCmd.Flags().StringVar(&language, "lang", "", "Programming language template") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good edit.
@@ -15,18 +15,15 @@ import ( | |||
) | |||
|
|||
var ( | |||
verboseInvoke bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happened to verboseInvoke?
@@ -18,12 +18,7 @@ var ( | |||
|
|||
func init() { | |||
// Setup flags that are used by multiple commands (variables defined in faas.go) | |||
listCmd.Flags().StringVar(&fprocess, "fprocess", "", "Fprocess to be run by the watchdog") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good refactor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you John. Looking forward to merging this. Just a minor nit.
Description
This PR stops using
node
as a default language due to it conflicting with functions where thefprocess
envvar is set in the image.Given the large numbers of languages having a default makes less sense now.
It also removes some of the copy-paste/redundant/irrelevant flag definitions that ended up in newly added subcommands.
Motivation and Context
node index.js
on deploy by default, ignoring the value set in images #169, also Question about using AlpineFunction sample function faas#297)How Has This Been Tested?
--fprocess
flag, function gets created with one being set as expected and correctly honours the setting in the image.Types of changes
Strictly speaking this is a breaking change, but it only impacts a very small edge case - that is where you deploy node functions via the CLI and rely on the language being set to
node
by default.As mentioned above, the growing number of function languages means that for the vast majority of users this won't be an issue and I think we're better having a single common behaviour for all users - which for the moment should include setting the language flag
--lang
.Note that the logic setting a default
fprocess
when a language is set has not changed and remains useful.Checklist:
git commit -s