-
Notifications
You must be signed in to change notification settings - Fork 49
Open
Labels
Triage-NeededNeeds to be reviewed at next pulp-cli mtgNeeds to be reviewed at next pulp-cli mtgbugSomething isn't working (template-set)Something isn't working (template-set)
Description
Summary
Strange behavior in 'label set' command:
$ pulp python repository label set --key 'osv-dev ecosystem' --value 'test' --repository test-python
Error: {"key":["Enter a valid \"slug\" consisting of letters, numbers, underscores or hyphens."]}
$ pulp python repository label set --key 'osv_dev ecosystem' --value 'test' --repository test-python
Error: {"key":["Enter a valid \"slug\" consisting of letters, numbers, underscores or hyphens."]}
- I think pulp_labels_validator serializer considers space as valid, but this still failed:
$ pulp python repository label set --key 'osv dev ecosystem' --value 'test' --repository test-python
Error: {"key":["Enter a valid \"slug\" consisting of letters, numbers, underscores or hyphens."]}
- not sure how this passed the
pulp_labels_validatorserializer:
$ pulp python repository label set --key 'osv_dev-ecosystem' --value 'test' --repository test-python
$ pulp python repository show --name test-python |jq .pulp_labels
{
"osv_dev-ecosystem": "test"
}
Additonal context
From pulpcore code, it seems like space and underscore are allowed, but hyphens are not:
https://github.com/pulp/pulpcore/blob/9b6c47ffa88377de814c47c2ceb0cf819cf6f288/pulpcore/app/serializers/fields.py#L430
Metadata
Metadata
Assignees
Labels
Triage-NeededNeeds to be reviewed at next pulp-cli mtgNeeds to be reviewed at next pulp-cli mtgbugSomething isn't working (template-set)Something isn't working (template-set)