Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
k8s-vcl-reloader
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
0
Merge Requests
0
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
uplex-varnish
k8s-vcl-reloader
Commits
2edb5814
Commit
2edb5814
authored
Nov 19, 2019
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Spec.ConfigName().
parent
163c3a6e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
0 deletions
+12
-0
spec.go
pkg/varnish/vcl/spec.go
+5
-0
vcl_test.go
pkg/varnish/vcl/vcl_test.go
+7
-0
No files found.
pkg/varnish/vcl/spec.go
View file @
2edb5814
...
...
@@ -153,3 +153,8 @@ func (spec Spec) DeepHash() string {
func
(
spec
Spec
)
FQVersion
()
string
{
return
spec
.
Version
+
"-"
+
spec
.
Created
.
Format
(
RFC3339Micro
)
}
func
(
spec
Spec
)
ConfigName
()
string
{
name
:=
spec
.
FQVersion
()
return
vclIllegal
.
ReplaceAllLiteralString
(
name
,
"_"
)
}
pkg/varnish/vcl/vcl_test.go
View file @
2edb5814
...
...
@@ -201,3 +201,10 @@ func TestFQVersion(t *testing.T) {
t
.
Fatal
(
"FQVersion(): timestamp != Spec.Created"
,
fqVersion
)
}
}
func
TestConfigName
(
t
*
testing
.
T
)
{
cfgName
:=
testSpec
.
ConfigName
()
if
vclIllegal
.
MatchString
(
cfgName
)
{
t
.
Fatal
(
"ConfigName() result is an illegal VCL name:"
,
cfgName
)
}
}
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