-
Notifications
You must be signed in to change notification settings - Fork 10
Closed
Description
In #17, helmcli pkg allows to use key=value path string to update helm values.
For example, a.b.c=v path string is to represent the following YAML value.
a:
b:
c: vLines 32 to 41 in 636d5a4
| func StringPathValuesApplier(values ...string) ValuesApplier { | |
| return func(to map[string]interface{}) error { | |
| for _, v := range values { | |
| if err := strvals.ParseInto(v, to); err != nil { | |
| return fmt.Errorf("failed to parse (%s) into values: %w", v, err) | |
| } | |
| } | |
| return nil | |
| } | |
| } |
However, StringPathValuesApplier doesn't support array value type.
For instance, for the following YAML value, we can't use key=value format to represent it.
a:
- 1
- 2
- 3So, we need to introduce new helper function: YAMLValuesApplier.
Since the helm values' type is map[string]interface{}, we need to unmarshal YAML into map[string]interface{} as well and then merge two values.
Reactions are currently unavailable