Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🧹 remove unused asset id #2071

Merged
merged 2 commits into from
Oct 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 = "Slack team " + conn.TeamName()
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
Loading