fixed jq config merge command

This commit is contained in:
Piyush Kumar
2022-09-22 00:48:51 +05:30
parent 2b513d5741
commit 38515866a1

View File

@@ -77,7 +77,7 @@ func clusterProvider(cluster clusterplugin.Cluster) yip.YipConfig {
}, },
}, },
Commands: []string{ Commands: []string{
fmt.Sprintf("jq -rs 'reduce .[] as $item ({}; . * $item)' %s/*.yaml > /etc/rancher/rke2/config.yaml", configurationPath), fmt.Sprintf("jq -s 'def flatten: reduce .[] as $i([]; if $i | type == \"array\" then . + ($i | flatten) else . + [$i] end); [.[] | to_entries] | flatten | reduce .[] as $dot ({}; .[$dot.key] += $dot.value)' %s/*.yaml > /etc/rancher/rke2/config.yaml", configurationPath),
}, },
}, },
{ {