Skip to content

Commit

Permalink
Fix cross RP parent-child dependency (#505)
Browse files Browse the repository at this point in the history
  • Loading branch information
magodo committed Feb 27, 2024
1 parent 9f26a4d commit d2f4390
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/meta/config_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ func (cfgs ConfigInfos) AddDependency() error {
func (cfgs ConfigInfos) addParentChildDependency() {
for i, cfg := range cfgs {
parentId := cfg.AzureResourceID.Parent()

// This resource is either a root scope or a root scoped resource
if parentId == nil {
// Root scope: ignore as it has no parent
Expand All @@ -121,6 +122,9 @@ func (cfgs ConfigInfos) addParentChildDependency() {
}
// Root scoped resource: use its parent scope as its parent
parentId = cfg.AzureResourceID.ParentScope()
} else if parentId.Parent() == nil {
// The cfg reosurce is the RP 1st level resource, we regard its parent scope as its parent
parentId = cfg.AzureResourceID.ParentScope()
}

// Adding the direct parent resource as its dependency
Expand Down

0 comments on commit d2f4390

Please sign in to comment.