Skip to content

Commit

Permalink
fix(diff): prune empty channel when old model is empty (#884)
Browse files Browse the repository at this point in the history
Fixes #883

Signed-off-by: Jennifer Power <barnabei.jennifer@gmail.com>
  • Loading branch information
jpower432 committed Dec 14, 2021
1 parent 808de07 commit 6b06649
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions alpha/declcfg/diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,15 @@ func (g *DiffGenerator) Run(oldModel, newModel model.Model) (model.Model, error)
if err := latestPruneFromOutput(); err != nil {
return nil, err
}
} else {
for _, outputPkg := range outputModel {
for _, ch := range outputPkg.Channels {
if len(ch.Bundles) == 0 {
delete(outputPkg.Channels, ch.Name)
}

}
}
}

case isInclude: // Add included objects to outputModel.
Expand Down

0 comments on commit 6b06649

Please sign in to comment.