Skip to content
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

Cannot pass trigger specific flags on up in multi trigger app #2251

Closed
karthik2804 opened this issue Jan 27, 2024 · 4 comments · Fixed by #2266
Closed

Cannot pass trigger specific flags on up in multi trigger app #2251

karthik2804 opened this issue Jan 27, 2024 · 4 comments · Fixed by #2266

Comments

@karthik2804
Copy link
Contributor

I have an app that uses both a redis and a HTTP component. I was trying to set the HTTP listener to run on 3001 instead of 3000 by passing in.

spin up --listen localhost:3001

which results in an error as the redis trigger does not recognize the flag.

spinrelease up --listen localhost:3001   
error: Found argument '--listen' which wasn't expected, or isn't valid in this context

Flags that are common like --log-dir continue to work.

I am not exactly sure what the solution would be to this. One potential idea I can think of is that when multiple triggers are present spin can optionally parse arguments something along the lines of --http-trigger="--listen localhost:3001" and only pass the argument to the HTTP trigger. and anything not in those specific arguments gets passed to both?

@radu-matei
Copy link
Member

As a user, I would expect passing the --listen flag to continue to work and to apply to the HTTP trigger, but not apply to the Redis trigger.

@itowlson
Copy link
Contributor

The least worst short-term solution may be simply to have triggers ignore unknown flags, although this does run us into the problem that spin up --lsiten would now silently discard and give unexpected default behaviour. (For a nastier example, consider the TLS flags.)

Longer term we could consider some way for up to interrogate triggers about which flags they support and filter (or error) accordingly. This would also help to construct unified help text (instead of repeating the help text for each trigger).

@itowlson
Copy link
Contributor

Semi-related: at some point, we may have a disambiguation issue, e.g. websocket --listen vs HTTP --listen. (Please don't nitpick the example - I know about the relationship between web sockets and HTTP - it was just easier than making up two imaginary triggers that legitimately used the same flag name.)

@lann
Copy link
Collaborator

lann commented Jan 28, 2024

We have a parallel problem with validating trigger config. Maybe the trigger plugin "interface" should include a mechanism for trigger executor binaries to describe their own config schema and arguments.

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 a pull request may close this issue.

4 participants