diff --git a/cmd/list/firmware.go b/cmd/list/firmware.go index 95e570e0..4deaf7b8 100644 --- a/cmd/list/firmware.go +++ b/cmd/list/firmware.go @@ -44,12 +44,7 @@ var listFirmware = &cobra.Command{ } filterParams := fleetdbapi.ComponentFirmwareVersionListParams{ - Vendor: strings.ToLower(flagsDefinedListFirmware.vendor), - // TODO - if we really want to search using multiple models - // - // fix the the firmware search in fleetdb, its currently useless - // because fleetdb queries the data using an 'AND' instead of an 'OR' - Model: []string{strings.ToLower(flagsDefinedListFirmware.model)}, + Vendor: strings.ToLower(flagsDefinedListFirmware.vendor), Version: flagsDefinedListFirmware.version, Pagination: &fleetdbapi.PaginationParams{ Limit: flagsDefinedListFirmware.limit, @@ -57,6 +52,14 @@ var listFirmware = &cobra.Command{ }, } + if flagsDefinedListFirmware.model != "" { + // TODO - if we really want to search using multiple models + // + // fix the the firmware search in fleetdb, its currently useless + // because fleetdb queries the data using an 'AND' instead of an 'OR' + filterParams.Model = []string{strings.ToLower(flagsDefinedListFirmware.model)} + } + firmware, _, err := client.ListServerComponentFirmware(ctx, &filterParams) if err != nil { log.Fatal("fleetdb API client returned error: ", err)