-
Notifications
You must be signed in to change notification settings - Fork 24
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
✨ Set asset.kind
to virtualmachine
when in cloud
#5267
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Salim Afiune Maya <[email protected]>
72cfe53
to
25e7f47
Compare
@@ -29,16 +29,25 @@ var detectors = []detectorFunc{ | |||
gcp.Detect, | |||
} | |||
|
|||
const AssetKind = "virtualmachine" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets find a better name for this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The shared kinds probably belong into the provider sdk
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets move it into platform.go
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't put it there since we will have a cyclical dependency, but I think it would be a great idea to move these constants (for the near future) into the actual inventory
package.
I think we will benefit from using them in the backend.
type detectResult struct { | ||
platformId string | ||
platformName string | ||
relatedPlatformIds []string | ||
} | ||
|
||
func Detect(conn shared.Connection, p *inventory.Platform) (PlatformID, PlatformName, []RelatedPlatformID) { | ||
type PlatformInfo struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: add comments
mgr, err := smbios.ResolveManager(conn, p) | ||
if err != nil { | ||
return "", "", nil | ||
return PlatformInfo{"", "", "", nil} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this return nil? But we need to check the error handling on the other side.
…kind/virtual_machine
Signed-off-by: Salim Afiune Maya <[email protected]>
eff89a2
to
55c17ea
Compare
Signed-off-by: Salim Afiune Maya <[email protected]>
…kind/virtual_machine
First pass to set and consolidate
asset.kind
tovirtualmachine
whenrunning in the cloud.
This needs testing and some backend changes.