Skip to content

Commit

Permalink
✨ rename fleet => inventory
Browse files Browse the repository at this point in the history
This better matches the more commonly used definition. We will keep fleet working for the next  major version and then slowly deprecate it.

Signed-off-by: Dominik Richter <[email protected]>
  • Loading branch information
arlimus committed Sep 25, 2023
1 parent cdb057a commit 906341f
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 20 deletions.
2 changes: 1 addition & 1 deletion apps/cnquery/cmd/scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func init() {

// v6 should make detect-cicd and category flag public
scanCmd.Flags().Bool("detect-cicd", true, "Try to detect CI/CD environments. If detected, set the asset category to 'cicd'.")
scanCmd.Flags().String("category", "fleet", "Set the category for the assets to 'fleet|cicd'.")
scanCmd.Flags().String("category", "inventory", "Set the category for the assets to 'inventory|cicd'.")
scanCmd.Flags().MarkHidden("category")
}

Expand Down
7 changes: 5 additions & 2 deletions providers-sdk/v1/inventory/asset.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,11 @@ func NewState(state string) State {
}

var AssetCategory_schemevalue = map[string]AssetCategory{
"fleet": AssetCategory_CATEGORY_FLEET,
"cicd": AssetCategory_CATEGORY_CICD,
// FIXME: DEPRECATED, remove in v11.0 vv
"fleet": AssetCategory_CATEGORY_INVENTORY,
// ^^
"inventory": AssetCategory_CATEGORY_INVENTORY,
"cicd": AssetCategory_CATEGORY_CICD,
}

// UnmarshalJSON parses either an int or a string representation of
Expand Down
30 changes: 15 additions & 15 deletions providers-sdk/v1/inventory/inventory.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions providers-sdk/v1/inventory/inventory.proto
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ enum State {
}

enum AssetCategory {
CATEGORY_FLEET = 0;
CATEGORY_INVENTORY = 0;
CATEGORY_CICD = 1;
}

Expand Down Expand Up @@ -64,7 +64,7 @@ message Asset {
// platform id detection mechanisms
repeated string id_detector = 31;

// indicator is this is a fleet asset or a CI/CD run
// indicator is this is an inventory object or a CI/CD run
AssetCategory category = 32;

repeated Asset related_assets = 33;
Expand Down

0 comments on commit 906341f

Please sign in to comment.