Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
k8s-ingress
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
3
Merge Requests
3
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
uplex-varnish
k8s-ingress
Commits
5c7ef404
Commit
5c7ef404
authored
Apr 29, 2021
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove the obsolete upper bound on VCL symbol lengths.
parent
803148b9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
26 deletions
+1
-26
hash_test.go
pkg/varnish/vcl/hash_test.go
+0
-19
template.go
pkg/varnish/vcl/template.go
+1
-7
No files found.
pkg/varnish/vcl/hash_test.go
View file @
5c7ef404
...
...
@@ -190,22 +190,3 @@ func TestCanoncial(t *testing.T) {
}
}
}
var
names
=
[]
string
{
"vk8s_cafe_example_com_url"
,
"vk8s_very_long_name_that_breaks_the_symbol_length_upper_bound"
,
}
func
TestBound
(
t
*
testing
.
T
)
{
for
_
,
n
:=
range
names
{
if
len
(
bound
(
n
,
maxSymLen
))
>
maxSymLen
{
t
.
Errorf
(
"bound(
\"
%s
\"
, %d) not shortened as "
+
"expected: len(
\"
%s
\"
)=%d"
,
n
,
maxSymLen
,
bound
(
n
,
maxSymLen
),
len
(
bound
(
n
,
maxSymLen
)))
}
if
len
(
n
)
<=
maxSymLen
&&
n
!=
bound
(
n
,
maxSymLen
)
{
t
.
Errorf
(
"bound(
\"
%s
\"
, %d) exp=
\"
%s
\"
got=
\"
%s
\"
"
,
n
,
maxSymLen
,
n
,
bound
(
n
,
maxSymLen
))
}
}
}
pkg/varnish/vcl/template.go
View file @
5c7ef404
...
...
@@ -78,11 +78,6 @@ func (spec Spec) GetSrc() (string, error) {
// The following functions are re-used in the function maps of more
// than one template.
// maxSymLen is a workaround for Varnish issue #2880
// https://github.com/varnishcache/varnish-cache/issues/2880
// Will be unnecssary as of the March 2019 release
const
maxSymLen
=
46
var
vclIllegal
=
regexp
.
MustCompile
(
"[^[:word:]-]+"
)
func
replIllegal
(
ill
[]
byte
)
[]
byte
{
...
...
@@ -113,8 +108,7 @@ func mangle(s string) string {
}
prefixed
:=
"vk8s_"
+
s
bytes
:=
[]
byte
(
prefixed
)
mangled
:=
vclIllegal
.
ReplaceAllFunc
(
bytes
,
replIllegal
)
return
bound
(
string
(
mangled
),
maxSymLen
)
return
string
(
vclIllegal
.
ReplaceAllFunc
(
bytes
,
replIllegal
))
}
func
backendName
(
svc
Service
,
addr
Address
)
string
{
...
...
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