Skip to content

Commit

Permalink
fix: exclude deleted when looking up by external id
Browse files Browse the repository at this point in the history
  • Loading branch information
adityathebe committed Jul 12, 2024
1 parent 460cdfd commit 9855f39
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion api/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func (t *TempCache) Find(ctx ScrapeContext, lookup v1.ExternalID) (*models.Confi
}

var result models.ConfigItem
query := ctx.DB().Limit(1).Where("type = ? and external_id @> ?", lookup.ConfigType, pq.StringArray{externalID})
query := ctx.DB().Limit(1).Where("deleted_at IS NULL").Where("type = ? and external_id @> ?", lookup.ConfigType, pq.StringArray{externalID})
if scraperID != "all" && scraperID != "" {
query = query.Where("scraper_id = ?", scraperID)
}
Expand Down
1 change: 1 addition & 0 deletions scrapers/aws/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -1473,6 +1473,7 @@ func (aws Scraper) subnets(ctx *AWSContext, config v1.AWS, results *v1.ScrapeRes
subnets, err := ctx.EC2.DescribeSubnets(ctx, &ec2.DescribeSubnetsInput{})
if err != nil {
results.Errorf(err, "failed to get subnets")
return
}

for _, subnet := range subnets.Subnets {
Expand Down

0 comments on commit 9855f39

Please sign in to comment.