✨ Set asset.kind to virtualmachine when in cloud#5267
Merged
Conversation
Contributor
Signed-off-by: Salim Afiune Maya <afiune@mondoo.com>
72cfe53 to
25e7f47
Compare
chris-rock
reviewed
Feb 26, 2025
| gcp.Detect, | ||
| } | ||
|
|
||
| const AssetKind = "virtualmachine" |
Member
There was a problem hiding this comment.
Lets find a better name for this
Member
There was a problem hiding this comment.
The shared kinds probably belong into the provider sdk
Member
There was a problem hiding this comment.
lets move it into platform.go
Contributor
Author
There was a problem hiding this comment.
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.
| } | ||
|
|
||
| func Detect(conn shared.Connection, p *inventory.Platform) (PlatformID, PlatformName, []RelatedPlatformID) { | ||
| type PlatformInfo struct { |
| mgr, err := smbios.ResolveManager(conn, p) | ||
| if err != nil { | ||
| return "", "", nil | ||
| return PlatformInfo{"", "", "", nil} |
Member
There was a problem hiding this comment.
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 <afiune@mondoo.com>
eff89a2 to
55c17ea
Compare
Signed-off-by: Salim Afiune Maya <afiune@mondoo.com>
…kind/virtual_machine
Merged
afiune
commented
Mar 4, 2025
| Name: platformName, | ||
| Title: getTitleForPlatformName(platformName), | ||
| Kind: "aws-object", | ||
| Kind: getPlatformKind(platformName), |
Contributor
Author
There was a problem hiding this comment.
This needs to be reverted. We only want to label os scans.
Signed-off-by: Salim Afiune Maya <afiune@mondoo.com>
…kind/virtual_machine
Signed-off-by: Salim Afiune Maya <afiune@mondoo.com>
Signed-off-by: Salim Afiune Maya <afiune@mondoo.com>
vjeffrey
approved these changes
Mar 5, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change consolidates
asset.kindforvirtualmachineandbaremetal.I am proposing having a single file where we define these asset kinds so that we
can later use them in the backend (follow up PR).
We are also changing the kind of an asset if:
How to test this change
cnquery shell)asset.kindcomes back asvirtualmachineAlternatively, build the binary locally and connect to an
awsinstance via:Select and asset and check that
asset.kindcomes back asvirtualmachine