mirror of
https://github.com/actions-runner-controller/actions-runner-controller.git
synced 2026-09-30 12:13:33 +02:00
Apply batched suggestions from code review
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
co-authored by
Copilot Autofix powered by AI
parent
c156b81e00
commit
c4e15959eb
@@ -25,7 +25,11 @@ Expects a dict with "key", "kind" (label|annotation) and "path" (the values path
|
||||
{{- if eq (len $parts) 2 -}}
|
||||
{{- $prefix := index $parts 0 -}}
|
||||
{{- $name = index $parts 1 -}}
|
||||
{{- if or (eq $prefix "") (gt (len $prefix) 253) (not (regexMatch "^[a-z0-9]([-a-z0-9.]*[a-z0-9])?$" $prefix)) -}}
|
||||
{{- if or (eq $prefix "") (gt (len $prefix) 253) -}}
|
||||
{{- fail (printf "%s: invalid %s key %q: the prefix %q must be a DNS subdomain of no more than 253 characters" .path .kind $key $prefix) -}}
|
||||
{{- end -}}
|
||||
{{- range $_, $seg := splitList "." $prefix -}}
|
||||
{{- if or (eq $seg "") (gt (len $seg) 63) (not (regexMatch "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$" $seg)) -}}
|
||||
{{- fail (printf "%s: invalid %s key %q: the prefix %q must be a DNS subdomain of no more than 253 characters" .path .kind $key $prefix) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
@@ -81,7 +81,11 @@ Expects a dict with "key", "kind" (label|annotation) and "path" (the values path
|
||||
{{- if eq (len $parts) 2 -}}
|
||||
{{- $prefix := index $parts 0 -}}
|
||||
{{- $name = index $parts 1 -}}
|
||||
{{- if or (eq $prefix "") (gt (len $prefix) 253) (not (regexMatch "^[a-z0-9]([-a-z0-9.]*[a-z0-9])?$" $prefix)) -}}
|
||||
{{- if or (eq $prefix "") (gt (len $prefix) 253) -}}
|
||||
{{- fail (printf "%s: invalid %s key %q: the prefix %q must be a DNS subdomain of no more than 253 characters" .path .kind $key $prefix) -}}
|
||||
{{- end -}}
|
||||
{{- range $_, $seg := splitList "." $prefix -}}
|
||||
{{- if or (eq $seg "") (gt (len $seg) 63) (not (regexMatch "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$" $seg)) -}}
|
||||
{{- fail (printf "%s: invalid %s key %q: the prefix %q must be a DNS subdomain of no more than 253 characters" .path .kind $key $prefix) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
Reference in New Issue
Block a user