Skip to content

Commit

Permalink
🧹 remove unused asset id
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-rock committed Oct 3, 2023
1 parent 020a750 commit 3afe931
Show file tree
Hide file tree
Showing 15 changed files with 0 additions and 17 deletions.
2 changes: 0 additions & 2 deletions providers/arista/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,7 @@ func (s *Service) connect(req *plugin.ConnectReq, callback plugin.ProviderCallba
}

func (s *Service) detect(asset *inventory.Asset, conn *connection.AristaConnection) error {
asset.Id = conn.Conf.Type
asset.Name = conn.Conf.Host

version := ""
arch := ""
aristaVersion, err := conn.GetVersion()
Expand Down
1 change: 0 additions & 1 deletion providers/aws/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,6 @@ func (s *Service) detect(asset *inventory.Asset, conn plugin.Connection) error {
return nil
}
if c, ok := conn.(*connection.AwsConnection); ok {
asset.Id = c.Conf.Type + "://" + c.AccountId()
asset.Name = c.Conf.Host
asset.Platform = c.PlatformInfo()
asset.PlatformIds = []string{"//platformid.api.mondoo.app/runtime/aws/accounts" + c.AccountId()}
Expand Down
1 change: 0 additions & 1 deletion providers/equinix/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ func (s *Service) connect(req *plugin.ConnectReq, callback plugin.ProviderCallba
}

func (s *Service) detect(asset *inventory.Asset, conn *connection.EquinixConnection) error {
asset.Id = conn.Conf.Type
asset.Name = conn.Conf.Host

asset.Platform = &inventory.Platform{
Expand Down
1 change: 0 additions & 1 deletion providers/gcp/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,6 @@ func (s *Service) connect(req *plugin.ConnectReq, callback plugin.ProviderCallba
}

func (s *Service) detect(asset *inventory.Asset, conn shared.GcpConnection) error {
asset.Id = conn.Config().Type
asset.Name = conn.Config().Host

switch conn.Config().Type {
Expand Down
1 change: 0 additions & 1 deletion providers/github/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ func (s *Service) connect(req *plugin.ConnectReq, callback plugin.ProviderCallba
}

func (s *Service) detect(asset *inventory.Asset, conn *connection.GithubConnection) error {
asset.Id = conn.Conf.Type
asset.Name = conn.Conf.Host

repoOpt := conn.Conf.Options["repository"]
Expand Down
1 change: 0 additions & 1 deletion providers/google-workspace/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ func (s *Service) connect(req *plugin.ConnectReq, callback plugin.ProviderCallba
}

func (s *Service) detect(asset *inventory.Asset, conn *connection.GoogleWorkspaceConnection) error {
asset.Id = conn.Conf.Type
asset.Name = conn.Conf.Host

asset.Platform = &inventory.Platform{
Expand Down
1 change: 0 additions & 1 deletion providers/ipmi/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ func (s *Service) connect(req *plugin.ConnectReq, callback plugin.ProviderCallba
}

func (s *Service) detect(asset *inventory.Asset, conn *connection.IpmiConnection) error {
asset.Id = conn.Conf.Type
asset.Name = conn.Conf.Host

asset.Platform = &inventory.Platform{
Expand Down
1 change: 0 additions & 1 deletion providers/ms365/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ func (s *Service) connect(req *plugin.ConnectReq, callback plugin.ProviderCallba
}

func (s *Service) detect(asset *inventory.Asset, conn *connection.Ms365Connection) error {
asset.Id = conn.PlatformId()
asset.PlatformIds = append(asset.PlatformIds, conn.PlatformId())
asset.Platform = &inventory.Platform{
Name: "ms365",
Expand Down
1 change: 0 additions & 1 deletion providers/network/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ func (s *Service) detect(asset *inventory.Asset, conn *connection.HostConnection
return errors.New("a port for the network connection is required")
}

asset.Id = conn.Conf.Type + "://" + conn.Conf.Host + ":" + strconv.Itoa(int(conn.Conf.Port)) + conn.Conf.Path
asset.Name = conn.Conf.Host
asset.Platform = &inventory.Platform{
Name: "host",
Expand Down
1 change: 0 additions & 1 deletion providers/oci/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@ func (s *Service) connect(req *plugin.ConnectReq, callback plugin.ProviderCallba
}

func (s *Service) detect(asset *inventory.Asset, conn *connection.OciConnection) error {
asset.Id = conn.Conf.Type
asset.Name = conn.Conf.Host

info, err := conn.Tenant(context.Background())
Expand Down
1 change: 0 additions & 1 deletion providers/okta/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ func (s *Service) connect(req *plugin.ConnectReq, callback plugin.ProviderCallba
}

func (s *Service) detect(asset *inventory.Asset, conn *connection.OktaConnection) error {
asset.Id = conn.Conf.Type
asset.Name = "Okta Organization " + conn.OrganizationID()
asset.Platform = &inventory.Platform{
Name: "okta-org",
Expand Down
1 change: 0 additions & 1 deletion providers/opcua/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ func (s *Service) connect(req *plugin.ConnectReq, callback plugin.ProviderCallba
}

func (s *Service) detect(asset *inventory.Asset, conn *connection.OpcuaConnection) error {
asset.Id = conn.Conf.Type
asset.Name = conn.Conf.Host

asset.Platform = &inventory.Platform{
Expand Down
1 change: 0 additions & 1 deletion providers/slack/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ func (s *Service) connect(req *plugin.ConnectReq, callback plugin.ProviderCallba
}

func (s *Service) detect(asset *inventory.Asset, conn *connection.SlackConnection) error {
asset.Id = conn.Conf.Type + "://" + conn.TeamID()
asset.Name = conn.Conf.Host
asset.Platform = &inventory.Platform{
Name: "slack-team",
Expand Down
2 changes: 0 additions & 2 deletions providers/vcd/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,6 @@ func (s *Service) connect(req *plugin.ConnectReq, callback plugin.ProviderCallba
}

func (s *Service) detect(asset *inventory.Asset, conn *connection.VcdConnection) error {
// TODO: adjust asset detection
asset.Id = conn.Conf.Type
asset.Name = conn.Conf.Host

c := conn.Client()
Expand Down
1 change: 0 additions & 1 deletion providers/vsphere/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@ func (s *Service) connect(req *plugin.ConnectReq, callback plugin.ProviderCallba
}

func (s *Service) detect(asset *inventory.Asset, conn *connection.VsphereConnection) error {
asset.Id = conn.Conf.Type
asset.Name = conn.Conf.Host

vSphereInfo := conn.Info()
Expand Down

0 comments on commit 3afe931

Please sign in to comment.