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

[Core] Fix label validation for Kubernetes, add unit tests #3505

Merged
merged 4 commits into from
May 2, 2024

Conversation

romilbhardwaj
Copy link
Collaborator

Fixes label validation for Kubernetes, where it was not accepting the kueue.x-k8s.io/queue-name label as valid. Also added unit tests to make sure validators are tested.

Tested (run the relevant ones):

  • Code formatting: bash format.sh
  • Label smoke tests - pytest tests/test_smoke.py::test_task_labels_aws --aws, pytest tests/test_smoke.py::test_task_labels_gcp --gcp, pytest tests/test_smoke.py::test_task_labels_kubernetes --kubernetes
  • New unit tests - pytest tests/unit_tests/test_resources.py

value_regex = re.compile(
r'^[a-zA-Z0-9]([-a-zA-Z0-9_.]{0,61}[a-zA-Z0-9])?$')
r'^([a-zA-Z0-9]([-a-zA-Z0-9_.]{0,61}[a-zA-Z0-9])?)?$')
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is to allow empty keys for Kubernetes.

Copy link
Collaborator

@Michaelvll Michaelvll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @romilbhardwaj ! LGTM

@romilbhardwaj romilbhardwaj merged commit d27e0ff into master May 2, 2024
20 checks passed
@romilbhardwaj romilbhardwaj deleted the labels_tests branch May 2, 2024 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants