Skip to content

Commit

Permalink
🐛 ensure we do not return ecr image assets with no connection info fr…
Browse files Browse the repository at this point in the history
…om discovery call (#2465)
  • Loading branch information
vjeffrey authored Nov 6, 2023
1 parent 07a2eae commit fbc6412
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions providers/aws/resources/discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,6 @@ func Discover(runtime *plugin.Runtime, filters connection.DiscoveryFilters) (*in
}
in.Spec.Assets = append(in.Spec.Assets, list...)
}

return in, nil
}

Expand Down Expand Up @@ -295,7 +294,12 @@ func discover(runtime *plugin.Runtime, awsAccount *mqlAwsAccount, target string,
if !imageMatchesFilters(a, filters) {
continue
}
assetList = append(assetList, addConnectionInfoToEcrAsset(a, conn))
ecrAsset := addConnectionInfoToEcrAsset(a, conn)
if len(ecrAsset.Connections) > 0 {
assetList = append(assetList, ecrAsset)
} else {
log.Warn().Str("name", ecrAsset.Name).Msg("cannot scan ecr image with no tag")
}
}
case DiscoveryECS:
res, err := NewResource(runtime, "aws.ecs", map[string]*llx.RawData{})
Expand Down

0 comments on commit fbc6412

Please sign in to comment.