Skip to content

Commit

Permalink
fix: Fix bug in configbind pkg
Browse files Browse the repository at this point in the history
  • Loading branch information
michaljurecko committed Jun 20, 2024
1 parent d05def1 commit 8cec13a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions internal/pkg/service/common/configmap/bind.go
Original file line number Diff line number Diff line change
Expand Up @@ -351,8 +351,10 @@ func collectValues(cfg BindConfig, flagToField FlagToFieldFn) (*orderedmap.Order

// Store
config.VisitAllRecursive(func(path orderedmap.Path, v any, parent any) {
// Copy leaf values
if _, ok := v.(*orderedmap.OrderedMap); !ok {
// Copy leaf values = value is not object AND key is map step, not slice step
_, isObject := v.(*orderedmap.OrderedMap)
_, isMapKey := path.Last().(orderedmap.MapStep)
if !isObject && isMapKey {
if err := values.SetNestedPath(path, fieldValue{Value: v, SetBy: SetByConfig}); err != nil {
errs.Append(err)
}
Expand Down

0 comments on commit 8cec13a

Please sign in to comment.