• Mike Lang's avatar
    api_topologies: Change semantics of blank or omitted option values · 9e1666cb
    Mike Lang authored
    Instead of value being "" or omitted meaning "use group.Default", we now allow the empty value
    to go through. This was done to allow multi-value options to be able to encode 'no options selected'.
    This is important as the alternative is very confusing, as 'nothing selected' would generally mean
    'match everything', not 'select default' (which in the k8s namespace example, means the "default" namespace).
    
    Since the UI is the only user of this API, and it already sends the default value always, this does not affect
    any existing usage.
    
    Since the UI still wants to show a 'match all' button to prevent confusion, but it's not a normal option
    (if it were a normal option, it could be combined with others, which isn't meaningful), we add a new key
    NoneLabel that indicates the name that should be displayed on this extra button.
    
    Finally, we implement these changes for the k8s namespace button, ie.
    - Get rid of All Namespaces option
    - Add "All Namespaces" as the NoneLabel
    - Default to "" when "default" namespace not present, which is equivalent to the old "all" option.
    9e1666cb