Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cross RP parent-child dependency #505

Merged
merged 1 commit into from
Feb 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading