Skip to content

Commit

Permalink
fix(driver): additional items
Browse files Browse the repository at this point in the history
  • Loading branch information
xhofe committed Jun 26, 2022
1 parent 5783aa9 commit 3349982
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion internal/operations/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ func GetDriverItemsMap() map[string]driver.Items {
}

func registerDriverItems(config driver.Config, addition driver.Additional) {
log.Debugf("addition of %s: %+v", config.Name, addition)
tAddition := reflect.TypeOf(addition)
mainItems := getMainItems(config)
additionalItems := getAdditionalItems(tAddition)
Expand Down Expand Up @@ -93,9 +94,13 @@ func getAdditionalItems(t reflect.Type) []driver.Item {
var items []driver.Item
for i := 0; i < t.NumField(); i++ {
field := t.Field(i)
if field.Type.Kind() == reflect.Struct {
items = append(items, getAdditionalItems(field.Type)...)
continue
}
tag := field.Tag
ignore, ok := tag.Lookup("ignore")
if !ok || ignore == "false" {
if ok && ignore == "true" {
continue
}
item := driver.Item{
Expand Down

0 comments on commit 3349982

Please sign in to comment.