Skip to content

behavior with maps #39

@kevinburkesegment

Description

@kevinburkesegment

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions