update comments

This commit is contained in:
James Bardin 2017-10-17 19:02:10 -04:00
parent 4ab70ba09d
commit b0163e69d1
1 changed files with 9 additions and 9 deletions

View File

@ -309,17 +309,17 @@ func (t *Tree) Load(s getter.Storage, mode GetMode) error {
return nil return nil
} }
// Once the tree is loaded, we can resolve all provider config inheritance. // inheritProviderConfig resolves all provider config inheritance after the
// tree is loaded.
// //
// This moves the full responsibility of inheritance to the config loader, // If there is a provider block without a config, look in the parent's Module
// simplifying locating provider configuration during graph evaluation. // block for a provider, and fetch that provider's configuration. If that
// The algorithm is much simpler now too. If there is a provider block without // doesn't exist, assume a default empty config. Implicit providers can still
// a config, we look in the parent's Module block for a provider, and fetch // inherit their config all the way up from the root, so walk up the tree and
// that provider's configuration. If that doesn't exist, we assume a default // copy the first matching provider into the module.
// empty config. Implicit providers can still inherit their config all the way
// up from the root, so we walk up the tree and copy the first matching
// provider into the module.
func (t *Tree) inheritProviderConfigs(stack []*Tree) { func (t *Tree) inheritProviderConfigs(stack []*Tree) {
// the recursive calls only append, so we don't need to worry about copying
// this slice.
stack = append(stack, t) stack = append(stack, t)
for _, c := range t.children { for _, c := range t.children {
c.inheritProviderConfigs(stack) c.inheritProviderConfigs(stack)