LabelSelectorRequirement

pydantic model controller.models.domain.kubernetes.LabelSelectorRequirement

Single rule for label matching.

Parameters:

data (Any)

Show JSON schema
{
   "title": "LabelSelectorRequirement",
   "description": "Single rule for label matching.",
   "type": "object",
   "properties": {
      "key": {
         "description": "Label key to match",
         "title": "Key",
         "type": "string"
      },
      "operator": {
         "allOf": [
            {
               "$ref": "#/$defs/LabelSelectorOperator"
            }
         ],
         "description": "Label match operator",
         "title": "Operator"
      },
      "values": {
         "default": [],
         "description": "For ``In`` and ``NotIn``, matches any value in this list. For ``Exists`` or ``DoesNotExist``, must be empty.",
         "items": {
            "type": "string"
         },
         "title": "Matching values",
         "type": "array"
      }
   },
   "$defs": {
      "LabelSelectorOperator": {
         "description": "Match operations for label selectors.",
         "enum": [
            "In",
            "NotIn",
            "Exists",
            "DoesNotExist"
         ],
         "title": "LabelSelectorOperator",
         "type": "string"
      }
   },
   "additionalProperties": false,
   "required": [
      "key",
      "operator"
   ]
}

Fields:
Validators:
  • _validate » all fields

field key: str [Required]

Label key to match

Validated by:
  • _validate

field operator: LabelSelectorOperator [Required]

Label match operator

Validated by:
  • _validate

field values: list[str] = []

For In and NotIn, matches any value in this list. For Exists or DoesNotExist, must be empty.

Validated by:
  • _validate

to_kubernetes()

Convert to the corresponding Kubernetes model.

Return type:

V1LabelSelectorRequirement