labels_annotations.py 308 B

1234567891011
  1. from typing import Dict, Optional
  2. managed_labels = {"gpustack.ai/managed": "true"}
  3. def match_labels(
  4. obj_labels: Optional[Dict[str, str]], expected_labels: Dict[str, str]
  5. ) -> bool:
  6. if not obj_labels:
  7. return False
  8. return all(obj_labels.get(k) == v for k, v in expected_labels.items())