mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
core: fix string rendering of modules in diffs
This was assuming our old practice of a slice starting with the string "root". We'll normalize here and then stringify the result to ensure that we get a string consistent with what's used elsewhere. This is primarily aimed at fixing some of the context plan tests.
This commit is contained in:
parent
39dfc9f4e0
commit
eb54715902
@ -185,7 +185,8 @@ func (d *Diff) String() string {
|
||||
keys := make([]string, 0, len(d.Modules))
|
||||
lookup := make(map[string]*ModuleDiff)
|
||||
for _, m := range d.Modules {
|
||||
key := fmt.Sprintf("module.%s", strings.Join(m.Path[1:], "."))
|
||||
addr := normalizeModulePath(m.Path)
|
||||
key := addr.String()
|
||||
keys = append(keys, key)
|
||||
lookup[key] = m
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user