Skip to content
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

A set of device list cleanups #397

Merged
merged 4 commits into from
May 9, 2024
Merged

A set of device list cleanups #397

merged 4 commits into from
May 9, 2024

Commits on Apr 19, 2024

  1. Cleanup: pass device filter options as a map

    This allows to fully move an argument parsing logic from the client into the command.
    Before the change, an argument parsing logic was split between the two.
    
    Signed-off-by: Volodymyr Khoroz <[email protected]>
    vkhoroz committed Apr 19, 2024
    Configuration menu
    Copy the full SHA
    4f82f5e View commit details
    Browse the repository at this point in the history
  2. Cleanup: use name instead of name_ilike to filter device list

    A new API has a newer name argument for few months already.
    Use it instead of the obsolete name_ilike.
    
    Signed-off-by: Volodymyr Khoroz <[email protected]>
    vkhoroz committed Apr 19, 2024
    Configuration menu
    Copy the full SHA
    f35040f View commit details
    Browse the repository at this point in the history
  3. Cleanup: use net/url to escape special characters in device list

    Currently, we onlhy special-cased the URL escaping of a ? for device name pattern.
    But, other characters are not escaped, and uuid pattern is not escaped at all.
    
    Most of the time this just works, but may produce unexpected results.
    For example `fioctl devices list 'a*&'` will ignore the trailing ampersand,
    and behave just like `fioctl device list 'a*'`, matching unexpected devices.
    
    Using the `net/url` to URL escape the query makes filtering more predictable for such edge cases.
    
    Signed-off-by: Volodymyr Khoroz <[email protected]>
    vkhoroz committed Apr 19, 2024
    Configuration menu
    Copy the full SHA
    52832b0 View commit details
    Browse the repository at this point in the history
  4. Cleanup: only pass non-empty filters to device list API

    This shortens the URL, making it easier to debug.
    
    Signed-off-by: Volodymyr Khoroz <[email protected]>
    vkhoroz committed Apr 19, 2024
    Configuration menu
    Copy the full SHA
    2194b0a View commit details
    Browse the repository at this point in the history