Imported from Helm https://github.com/helm/helm/blob/c6beb169d26751efd8131a5d65abe75c81a334fb/pkg/cli/values/options.go#L108
(a, b map[string]any)
| 1778 | // Imported from Helm |
| 1779 | // https://github.com/helm/helm/blob/c6beb169d26751efd8131a5d65abe75c81a334fb/pkg/cli/values/options.go#L108 |
| 1780 | func mergeMaps(a, b map[string]any) map[string]any { |
| 1781 | out := make(map[string]any, len(a)) |
| 1782 | maps.Copy(out, a) |
| 1783 | |
| 1784 | for key, val := range b { |
| 1785 | if vm, ok := val.(map[string]any); ok { |
| 1786 | if bv, ok := out[key]; ok { |
| 1787 | if bvm, ok := bv.(map[string]any); ok { |
| 1788 | out[key] = mergeMaps(bvm, vm) |
| 1789 | |
| 1790 | continue |
| 1791 | } |
| 1792 | } |
| 1793 | } |
| 1794 | |
| 1795 | out[key] = val |
| 1796 | } |
| 1797 | |
| 1798 | return out |
| 1799 | } |
| 1800 | |
| 1801 | // isTalosConfigPatch checks if a YAML document is a Talos config patch. |
| 1802 | // Returns (isTalosPatch, parseError) - parseError is non-nil if YAML is invalid. |
no outgoing calls