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

Allow ftl config/secret to run without the controller #1677

Closed
deniseli opened this issue Jun 6, 2024 · 0 comments · Fixed by #1695
Closed

Allow ftl config/secret to run without the controller #1677

deniseli opened this issue Jun 6, 2024 · 0 comments · Fixed by #1695
Assignees

Comments

@deniseli
Copy link
Contributor

deniseli commented Jun 6, 2024

  • Use controller if it’s running
  • If you’re in production, you don’t want to use the local config/secret setting logic; you want it to fail immediately
  • Client needs to know if a local vs prod controller is running. To do this, look at the endpoint value (e.g. ftl deploy --endpoint). If you give it a production endpoint, then it’ll talk to a production controller. We could look at the endpoint value - if it’s localhost and not running, then do local stuff. Let’s do that for now.
    • A real prod example: ftl --log-level=trace --endpoint=https://ftl.tbddev.org/ ps
    • We should rethink this approach (relying on --endpoint) at some point, but this is fine for now and we want to get the fix out quickly to avoid hurting the UX for PFI

tl;dr:

  1. Abstract the config/secret part of the service behind an interface
  2. If controller is not present AND endpoint is on localhost / 127.0.0.1 ... might need to use netip.Addr.IsLoopback() to be sure, inject an impl of that interface that operates locally, otherwise inject the existing gRPC client
@deniseli deniseli self-assigned this Jun 6, 2024
@ftl-robot ftl-robot mentioned this issue Jun 6, 2024
deniseli added a commit that referenced this issue Jun 7, 2024
…er (#1695)

Fixes #1677

Without starting a controller first, you can once again run `ftl
config/secret` commands:
```
$ ftl config list
key
echo.default
```
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.

1 participant