Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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: accept new SLO specs using the filesystem HTTP api #914
base: main
Are you sure you want to change the base?
feat: accept new SLO specs using the filesystem HTTP api #914
Changes from 5 commits
76a20cf
7dbd5a9
93af6a9
e0b9c00
95232af
423c068
d1cef81
5b1c551
08c6f46
2338d13
411b186
8c47c99
e9bf75b
28ccec4
e7d6b87
30b5162
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
This is pretty pragmatic and should be ok for a proof-of-concept.
Quickly, this will become a foot gun where the API will accept any file and write the contents to disk.
We want to ensure the sent data is correct and has a JSON/YAML objective configuration.
A helper function to read from a file and then unmarshal and validate the content already exists with:
pyrra/filesystem.go
Lines 387 to 404 in 174b026
If we change that function to take a
io.Reader
we can pass both aos.File
(for the existing use case) or abytes.Buffer
which we would write the HTTP payload content into to that helper function.It's probably easiest to then marshal the parsed config struct back into YAML and write that to disk.
Let me know if you need any more pointers or anything else. I'm happy to help!
Check warning on line 259 in filesystem.go
GitHub Actions / lint