Skip to content

Commit

Permalink
🧹 remove deprecated aws-ec2 id
Browse files Browse the repository at this point in the history
  • Loading branch information
vjeffrey committed Sep 19, 2023
1 parent 7911fc4 commit a9ae4e7
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 23 deletions.
5 changes: 0 additions & 5 deletions providers/os/id/ids/ids.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,5 @@ const (
IdDetector_SshHostkey = "ssh-host-key"
IdDetector_AwsEcs = "aws-ecs"

// FIXME: DEPRECATED, remove in v9.0 vv
// this is now cloud-detect
IdDetector_AwsEc2 = "aws-ec2"
// ^^

// IdDetector_PlatformID = "transport-platform-id" // TODO: how does this work?
)
2 changes: 1 addition & 1 deletion providers/os/provider/detector.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func (s *Service) detect(asset *inventory.Asset, conn shared.Connection) error {
}
}

if hasDetector(detectors, ids.IdDetector_CloudDetect, ids.IdDetector_AwsEc2) {
if hasDetector(detectors, ids.IdDetector_CloudDetect) {
if id, name, related := aws.Detect(conn, asset.Platform); id != "" {
asset.PlatformIds = append(asset.PlatformIds, id)
asset.Platform.Name = name
Expand Down
17 changes: 0 additions & 17 deletions providers/os/provider/platform.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,23 +147,6 @@ func GatherPlatformInfo(conn shared.Connection, pf *inventory.Platform, idDetect
}, hostErr
}
return &PlatformInfo{}, nil
case idDetector == ids.IdDetector_AwsEc2:
metadata, err := awsec2.Resolve(conn, pf)
if err != nil {
return nil, err
}
ident, err := metadata.Identify()
if err != nil {
return nil, err
}
if ident.InstanceID != "" {
return &PlatformInfo{
IDs: []string{ident.InstanceID},
Name: ident.InstanceName,
RelatedPlatformIDs: []string{ident.AccountID},
}, nil
}
return &PlatformInfo{}, nil
case idDetector == ids.IdDetector_AwsEcs:
metadata, err := awsecs.Resolve(conn, pf)
if err != nil {
Expand Down

0 comments on commit a9ae4e7

Please sign in to comment.