Skip to content

Commit

Permalink
Merge pull request #422 from haiyanmeng/skip
Browse files Browse the repository at this point in the history
Skip InventoryPolicyApplyFilter for the `AdoptAll` inventory policy to improve the performance
  • Loading branch information
k8s-ci-robot authored Oct 8, 2021
2 parents 9cae550 + 97b02cd commit a1b40b5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pkg/apply/applier.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,14 +172,16 @@ func (a *Applier) Run(ctx context.Context, invInfo inventory.InventoryInfo, obje
InventoryPolicy: options.InventoryPolicy,
}
// Build list of apply validation filters.
applyFilters := []filter.ValidationFilter{
filter.InventoryPolicyApplyFilter{
applyFilters := []filter.ValidationFilter{}
if options.InventoryPolicy != inventory.AdoptAll {
applyFilters = append(applyFilters, filter.InventoryPolicyApplyFilter{
Client: client,
Mapper: mapper,
Inv: invInfo,
InvPolicy: options.InventoryPolicy,
},
})
}

// Build list of prune validation filters.
pruneFilters := []filter.ValidationFilter{
filter.PreventRemoveFilter{},
Expand Down

0 comments on commit a1b40b5

Please sign in to comment.