-
Notifications
You must be signed in to change notification settings - Fork 56
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
fix object store TOML definitions, add test data #715
Conversation
This is usually the case in tests
The inconsistencies I see:
Go structure for dictionaries: type LocalServer struct {
Backends map[string]LocalBackend `toml:"backends"`
Dictionaries map[string]LocalDictionary `toml:"dictionaries,omitempty"`
ObjectStore map[string][]LocalObjectStore `toml:"object_store,omitempty"`
}
type LocalDictionary struct {
File string `toml:"file,omitempty"`
Format string `toml:"format"`
Contents map[string]string `toml:"contents,omitempty"`
} which maps to a toml like: [local_server]
[local_server.dictionaries]
[local_server.dictionaries.toml]
format = "inline-toml"
[local_server.dictionaries.toml.contents]
foo = "bar"
baz = """
qux""" Go structure for object stores: type LocalServer struct {
Backends map[string]LocalBackend `toml:"backends"`
Dictionaries map[string]LocalDictionary `toml:"dictionaries,omitempty"`
ObjectStore map[string][]LocalObjectStore `toml:"object_store,omitempty"`
}
type LocalObjectStore struct {
Key string `toml:"key"`
Path string `toml:"path,omitempty"`
Data string `toml:"data,omitempty"`
} which maps to a toml like: [local_server]
[local_server.object_store]
[[local_server.object_store.store_two]]
key = "first"
data = "This is some data"
[[local_server.object_store.store_two]]
key = "second"
path = "strings.json" or, IMO even nicer: [local_server]
[local_server.object_store]
store_one = [{key = "first", data = "This is some data"}, {key = "second", path = "strings.json"}] |
Thanks @joeshaw PRs are definitely welcomed, especially for the consistency issues which are quite frustrating from a devex perspective 👍🏻 |
ObjectStore map[string]LocalObjectStore `toml:"object_stores,omitempty"` | ||
Backends map[string]LocalBackend `toml:"backends"` | ||
Dictionaries map[string]LocalDictionary `toml:"dictionaries,omitempty"` | ||
ObjectStore map[string][]LocalObjectStore `toml:"object_store,omitempty"` |
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.
@chrispoole643 were you documenting the ObjectStore in https://developer.fastly.com/reference/compute/fastly-toml/ ? I thought I recalled you doing so but couldn't see it in there at the moment. At any rate, we'll want to ensure that's kept consistent with what's here ☝🏻
I opened fastly/Viceroy#206 to address it. If it's merged I'll adjust things here too. |
This fixes the object store configs to match the Viceroy implementation, and adds object store definitions to the test data.
I think it remains an open question as to whether we should change the Viceroy implementation to be more consistent with the existing local server definitions (backends, dictionaries).