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

behavior with maps #39

Open
kevinburkesegment opened this issue Jul 25, 2022 · 0 comments
Open

behavior with maps #39

kevinburkesegment opened this issue Jul 25, 2022 · 0 comments

Comments

@kevinburkesegment
Copy link
Contributor

I guess I expected based on the Map abstraction that you could deserialize config into either a map or a struct. One of the first tests I wrote did this:

       source := NewKubernetesConfigMapSource("./testdata/configmap")
       base := make(map[string]string)
       mp := makeNodeMap(reflect.ValueOf(base), reflect.TypeOf(base))
       if err := source.Load(mp); err != nil {
               t.Fatal(err)
       }

Which "worked" but produces a panic if you try Loader.Load.

We should maybe try to make more clear that you should only be passing structs, maybe by also panicking further down.

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

No branches or pull requests

1 participant