-
Notifications
You must be signed in to change notification settings - Fork 9
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
feat: import/export of config and secrets #1982
Conversation
862ed85
to
cee8568
Compare
in.ExpectError( | ||
in.ExecWithOutput("ftl", "deploy", "notexportedverb"), | ||
"call first argument must be a function but is an unresolved reference to echo.Echo, does it need to be exported?"), | ||
in.ExecWithExpectedError("call first argument must be a function but is an unresolved reference to echo.Echo, does it need to be exported?", |
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.
Why the change? The previous function was generalisable to any Action.
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.
I went in circles a bit on this:
- When I used
ExecWithOutput
I expected to be able to use the output. It didn't indicate that it was only capturing the output in case of an error - I then tried to make
ExecWithOutput
work for both success success and error cases:- For success cases, call a func with the output (like the replacement
ExecWithOutput
action I added) - For error cases throw the error with the output (old behaviour)
- For success cases, call a func with the output (like the replacement
- It then felt a bit messy for the error case so I tried cleaning it up.
I can go back to ExecWithOutput
handling both cases. Thoughts?
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.
I think it's fine to introduce new functionality, but that doesn't seem like a reason to remove in.ExpectError()
?
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.
Yeh I see what you mean. I've moved them back into one func called ExecWithOutput
which works like before for the error case (used in conjunction with ExpectError
and an empty capture func).
What's the behaviour when restoring, I assume it will just write the values in the dump, not remove any extra keys in the target? |
FYI @AlexSzlavik |
That's right. Existing refs that aren't in the dump aren't touched. So it's less of a "restore" and more of an "import" |
093aaea
to
7d5d345
Compare
06ca81d
to
f9a77be
Compare
closes #1947 closes #1772 Creates an entry in 1Password called `<projectname>.secrets` with each secret stored in a password field called `<modulename>.<secretname>` Username is set to a warning string as that is presented at the top of the 1Password UI. This will break existing secrets stored in 1Password. Migration can be done using commands made available in: #1982
closes #1948
Usage:
Exporting
Prints json of all secrets to stdout:
ftl secret export
Exports all inline secrets to a json file
ftl secret export --inline > exported.json
Importing
Imports json from a file:
ftl secret import --inline exported.json
Migrating
Migrates inline secrets to 1Password:
ftl secret export --inline | ftl secret import --op --opvault <vauld id>
JSON Format