|
7 | 7 | from ...types import Fragment, FragmentId |
8 | 8 | from ..base import EdgeBuilder, EdgeDict |
9 | 9 |
|
10 | | -_K8S_API_VERSION_RE = re.compile(r"^apiVersion:\s*([^\s#]+)", re.MULTILINE) |
11 | | -_K8S_KIND_RE = re.compile(r"^kind:\s*(\w+)", re.MULTILINE) |
12 | | -_K8S_NAME_RE = re.compile(r"^\s+name:\s*['\"]?([^'\"#\n]+)", re.MULTILINE) |
13 | | -_K8S_NAMESPACE_RE = re.compile(r"^\s+namespace:\s*['\"]?([^'\"#\n]+)", re.MULTILINE) |
14 | | - |
15 | | -_CONFIGMAP_REF_RE = re.compile(r"configMapKeyRef:\s*\n\s+name:\s*['\"]?([^'\"#\n]+)", re.MULTILINE) |
16 | | -_CONFIGMAP_NAME_RE = re.compile(r"configMapName:\s*['\"]?([^'\"#\n]+)", re.MULTILINE) |
17 | | -_SECRET_REF_RE = re.compile(r"secretKeyRef:\s*\n\s+name:\s*['\"]?([^'\"#\n]+)", re.MULTILINE) |
18 | | -_SECRET_NAME_RE = re.compile(r"secretName:\s*['\"]?([^'\"#\n]+)", re.MULTILINE) |
19 | | - |
20 | | -_SERVICE_NAME_RE = re.compile(r"serviceName:\s*['\"]?([^'\"#\n]+)", re.MULTILINE) |
21 | | -_BACKEND_SERVICE_RE = re.compile(r"service:\s*\n\s+name:\s*['\"]?([^'\"#\n]+)", re.MULTILINE) |
22 | | - |
23 | | -_IMAGE_RE = re.compile(r"^\s+image:\s*['\"]?([^'\"#\n]+)", re.MULTILINE) |
24 | | - |
25 | | -_SELECTOR_MATCH_LABELS_RE = re.compile(r"selector:\s*\n\s+matchLabels:\s*\n((?:\s+[a-zA-Z0-9_./-]+:\s*[^\n:]+\n)+)", re.MULTILINE) |
26 | | -_LABELS_RE = re.compile(r"labels:\s*\n((?:\s+[a-zA-Z0-9_./-]+:\s*[^\n:]+\n)+)", re.MULTILINE) |
27 | | -_LABEL_PAIR_RE = re.compile(r"^\s*([a-zA-Z0-9_./-]+):\s*['\"]?([a-zA-Z0-9_./-]+)['\"]?\s*$", re.MULTILINE) |
28 | | -_SIMPLE_SELECTOR_RE = re.compile(r"selector:\s*\n((?:\s+[a-zA-Z0-9_./-]+:\s*[^\n:]+\n)+)", re.MULTILINE) |
29 | | - |
30 | | -_VOLUME_CONFIGMAP_RE = re.compile(r"configMap:\s*\n\s+name:\s*['\"]?([^'\"#\n]+)", re.MULTILINE) |
31 | | -_VOLUME_SECRET_RE = re.compile(r"secret:\s*\n\s+secretName:\s*['\"]?([^'\"#\n]+)", re.MULTILINE) |
32 | | -_VOLUME_PVC_RE = re.compile(r"persistentVolumeClaim:\s*\n\s+claimName:\s*['\"]?([^'\"#\n]+)", re.MULTILINE) |
| 10 | +_K8S_API_VERSION_RE = re.compile(r"^apiVersion:\s?([^\s#]{1,100})", re.MULTILINE) |
| 11 | +_K8S_KIND_RE = re.compile(r"^kind:\s?(\w{1,100})", re.MULTILINE) |
| 12 | +_K8S_NAME_RE = re.compile(r"^\s{1,20}name:\s?['\"]?([^'\"#\n]{1,200})", re.MULTILINE) |
| 13 | +_K8S_NAMESPACE_RE = re.compile(r"^\s{1,20}namespace:\s?['\"]?([^'\"#\n]{1,200})", re.MULTILINE) |
| 14 | + |
| 15 | +_CONFIGMAP_REF_RE = re.compile(r"configMapKeyRef:\s?\n\s{1,20}name:\s?['\"]?([^'\"#\n]{1,200})", re.MULTILINE) |
| 16 | +_CONFIGMAP_NAME_RE = re.compile(r"configMapName:\s?['\"]?([^'\"#\n]{1,200})", re.MULTILINE) |
| 17 | +_SECRET_REF_RE = re.compile(r"secretKeyRef:\s?\n\s{1,20}name:\s?['\"]?([^'\"#\n]{1,200})", re.MULTILINE) |
| 18 | +_SECRET_NAME_RE = re.compile(r"secretName:\s?['\"]?([^'\"#\n]{1,200})", re.MULTILINE) |
| 19 | + |
| 20 | +_SERVICE_NAME_RE = re.compile(r"serviceName:\s?['\"]?([^'\"#\n]{1,200})", re.MULTILINE) |
| 21 | +_BACKEND_SERVICE_RE = re.compile(r"service:\s?\n\s{1,20}name:\s?['\"]?([^'\"#\n]{1,200})", re.MULTILINE) |
| 22 | + |
| 23 | +_IMAGE_RE = re.compile(r"^\s{1,20}image:\s?['\"]?([^'\"#\n]{1,300})", re.MULTILINE) |
| 24 | + |
| 25 | +_SELECTOR_MATCH_LABELS_RE = re.compile( |
| 26 | + r"selector:\s?\n\s{1,20}matchLabels:\s?\n((?:\s{1,20}[a-zA-Z0-9_./-]{1,100}:\s?[^\n:]{1,200}\n){1,50})", re.MULTILINE |
| 27 | +) |
| 28 | +_LABELS_RE = re.compile(r"labels:\s?\n((?:\s{1,20}[a-zA-Z0-9_./-]{1,100}:\s?[^\n:]{1,200}\n){1,50})", re.MULTILINE) |
| 29 | +_LABEL_PAIR_RE = re.compile(r"^\s{0,20}([a-zA-Z0-9_./-]{1,100}):\s?['\"]?([a-zA-Z0-9_./-]{1,100})['\"]?\s{0,10}$", re.MULTILINE) |
| 30 | +_SIMPLE_SELECTOR_RE = re.compile(r"selector:\s?\n((?:\s{1,20}[a-zA-Z0-9_./-]{1,100}:\s?[^\n:]{1,200}\n){1,50})", re.MULTILINE) |
| 31 | + |
| 32 | +_VOLUME_CONFIGMAP_RE = re.compile(r"configMap:\s?\n\s{1,20}name:\s?['\"]?([^'\"#\n]{1,200})", re.MULTILINE) |
| 33 | +_VOLUME_SECRET_RE = re.compile(r"secret:\s?\n\s{1,20}secretName:\s?['\"]?([^'\"#\n]{1,200})", re.MULTILINE) |
| 34 | +_VOLUME_PVC_RE = re.compile(r"persistentVolumeClaim:\s?\n\s{1,20}claimName:\s?['\"]?([^'\"#\n]{1,200})", re.MULTILINE) |
33 | 35 |
|
34 | 36 | _YAML_EXTS = {".yaml", ".yml"} |
35 | 37 |
|
|
0 commit comments