Skip to content

Configuration store does not correctly handle differently cased versions of same label. #307

@davidraker

Description

@davidraker

Describe the bug
It is possible to create configuration store entries with differently cased versions of the same name (e.g., Meter.csv vs meter.csv). Most configuration store functionality assumes these labels to be case sensitive, but the handling is inconsistent and not all operations correctly lower-case the name before it is used.

To Reproduce
Steps to reproduce the behavior:

  1. Create two different configurations:
    $ echo "{This is": "Uppercase One"} > One.json
    $ echo "{This is": "lowercase one"} > one.json

  2. Store the configurations with the same name but different casing.
    $ vctl config store foo one one.json
    $ vctl config store foo One One.json

  3. Confirm that both labels appear in the list.
    $ vctl config list foo
    One
    one

  4. Retrieve the configurations and note that they both have the contents assigned to the second label stored.
    $ vctl config get foo One
    {
    "This is": "uppercase One"
    }
    $ vctl config get foo one
    {
    "This is": "uppercase One"
    }

  5. Delete the label which was stored first:
    $ vctl config delete foo one
    (does not display output)

  6. Observe that the second configuration was removed, not the one we requested be removed.
    $ vctl config list foo
    one

  7. Attempt to retrieve each configuration. Note that both labels have no contents now, despite one label remaining in the list.
    $ vctl config get foo one
    config: error: 'No configuration file "one" for VIP IDENTITY foo'
    $ vctl config get foo One
    config: error: 'No configuration file "One" for VIP IDENTITY foo'

Expected behavior
Either the configuration labels should be case sensitive or not:

  • If they are case sensitive, they should never overwrite the other-cased item.
  • If they are case insensitive, we should never have multiple labels stored, and any operation on one cased version will work the same as the other.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions