Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
a58a795e
Commit
a58a795e
authored
Dec 06, 2016
by
Xing Zhou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed a typo of wildcard DNS regex variable name.
Fixed a typo of wildcard DNS regex expression variable name.
parent
f16320ea
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
validation.go
pkg/util/validation/validation.go
+3
-3
No files found.
pkg/util/validation/validation.go
View file @
a58a795e
...
@@ -143,19 +143,19 @@ func IsDNS1035Label(value string) []string {
...
@@ -143,19 +143,19 @@ func IsDNS1035Label(value string) []string {
// examples:
// examples:
// - valid: *.bar.com, *.foo.bar.com
// - valid: *.bar.com, *.foo.bar.com
// - invalid: *.*.bar.com, *.foo.*.com, *bar.com, f*.bar.com, *
// - invalid: *.*.bar.com, *.foo.*.com, *bar.com, f*.bar.com, *
const
wildcardDN
F
1123SubdomainFmt
=
"
\\
*
\\
."
+
dns1123SubdomainFmt
const
wildcardDN
S
1123SubdomainFmt
=
"
\\
*
\\
."
+
dns1123SubdomainFmt
// IsWildcardDNS1123Subdomain tests for a string that conforms to the definition of a
// IsWildcardDNS1123Subdomain tests for a string that conforms to the definition of a
// wildcard subdomain in DNS (RFC 1034 section 4.3.3).
// wildcard subdomain in DNS (RFC 1034 section 4.3.3).
func
IsWildcardDNS1123Subdomain
(
value
string
)
[]
string
{
func
IsWildcardDNS1123Subdomain
(
value
string
)
[]
string
{
wildcardDNS1123SubdomainRegexp
:=
regexp
.
MustCompile
(
"^
\\
*
\\
."
+
dns
1123SubdomainFmt
+
"$"
)
wildcardDNS1123SubdomainRegexp
:=
regexp
.
MustCompile
(
"^
"
+
wildcardDNS
1123SubdomainFmt
+
"$"
)
var
errs
[]
string
var
errs
[]
string
if
len
(
value
)
>
DNS1123SubdomainMaxLength
{
if
len
(
value
)
>
DNS1123SubdomainMaxLength
{
errs
=
append
(
errs
,
MaxLenError
(
DNS1123SubdomainMaxLength
))
errs
=
append
(
errs
,
MaxLenError
(
DNS1123SubdomainMaxLength
))
}
}
if
!
wildcardDNS1123SubdomainRegexp
.
MatchString
(
value
)
{
if
!
wildcardDNS1123SubdomainRegexp
.
MatchString
(
value
)
{
errs
=
append
(
errs
,
RegexError
(
wildcardDN
F
1123SubdomainFmt
,
"*.example.com"
))
errs
=
append
(
errs
,
RegexError
(
wildcardDN
S
1123SubdomainFmt
,
"*.example.com"
))
}
}
return
errs
return
errs
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment