mirror of
https://github.com/helmfile/helmfile.git
synced 2026-10-09 05:20:11 +02:00
This pr fixes auto-wrapping of booleans and integers into quotes when using --state-values-set by: - Adding: --state-values-set-string flag for intentional string set of boolean or integer - Changing: --state-values-set flag not wrapping now - Removing - Resolves https://github.com/roboll/helmfile/issues/1347 Signed-off-by: Tunahan Sezen <sezentunahan@outlook.com>
43 lines
802 B
Go
43 lines
802 B
Go
package config
|
|
|
|
import (
|
|
"strings"
|
|
|
|
"github.com/helmfile/helmfile/pkg/maputil"
|
|
)
|
|
|
|
func NewCLIConfigImpl(g *GlobalImpl) error {
|
|
optsSet := g.RawStateValuesSetString()
|
|
if len(optsSet) > 0 {
|
|
set := map[string]any{}
|
|
for i := range optsSet {
|
|
ops := strings.Split(optsSet[i], ",")
|
|
for j := range ops {
|
|
op := strings.SplitN(ops[j], "=", 2)
|
|
k := maputil.ParseKey(op[0])
|
|
v := op[1]
|
|
|
|
maputil.Set(set, k, v, true)
|
|
}
|
|
}
|
|
g.SetSet(set)
|
|
}
|
|
optsSet = g.RawStateValuesSet()
|
|
if len(optsSet) > 0 {
|
|
set := map[string]any{}
|
|
for i := range optsSet {
|
|
ops := strings.Split(optsSet[i], ",")
|
|
for j := range ops {
|
|
op := strings.SplitN(ops[j], "=", 2)
|
|
k := maputil.ParseKey(op[0])
|
|
v := op[1]
|
|
|
|
maputil.Set(set, k, v, false)
|
|
}
|
|
}
|
|
g.SetSet(set)
|
|
}
|
|
|
|
return nil
|
|
}
|