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
6217f87e
Commit
6217f87e
authored
Dec 10, 2018
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Monitor discards cold VCL configs for previous Ingresses.
parent
c53813d1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
17 deletions
+18
-17
monitor.go
cmd/varnish/monitor.go
+18
-7
varnish.go
cmd/varnish/varnish.go
+0
-10
No files found.
cmd/varnish/monitor.go
View file @
6217f87e
...
@@ -26,15 +26,10 @@
...
@@ -26,15 +26,10 @@
* SUCH DAMAGE.
* SUCH DAMAGE.
*/
*/
/*
* VCL housekeeping
* either discard the previously active VCL immediately on new vcl.use
* or periodically clean up
*/
package
varnish
package
varnish
import
(
import
(
"strings"
"time"
"time"
"code.uplex.de/uplex-varnish/varnishapi/pkg/admin"
"code.uplex.de/uplex-varnish/varnishapi/pkg/admin"
...
@@ -81,7 +76,23 @@ func (vc *VarnishController) checkInst(inst *varnishSvc) {
...
@@ -81,7 +76,23 @@ func (vc *VarnishController) checkInst(inst *varnishSvc) {
// XXX clear the panic? Should be configurable
// XXX clear the panic? Should be configurable
}
}
// XXX discard cold & unlabelled ingress configs
vcls
,
err
:=
adm
.
VCLList
()
if
err
!=
nil
{
vc
.
log
.
Error
(
"Error getting VCL list at %s: %v"
,
inst
.
addr
,
err
)
return
}
for
_
,
vcl
:=
range
vcls
{
if
strings
.
HasPrefix
(
vcl
.
Name
,
ingressPrefix
)
&&
vcl
.
State
==
admin
.
ColdState
{
if
err
=
adm
.
VCLDiscard
(
vcl
.
Name
);
err
!=
nil
{
vc
.
log
.
Errorf
(
"Error discarding VCL %s at %s: "
+
"%v"
,
vcl
.
Name
,
inst
.
addr
,
err
)
return
}
vc
.
log
.
Infof
(
"Discarded VCL %s at %s"
,
vcl
.
Name
,
inst
.
addr
)
}
}
}
}
func
(
vc
*
VarnishController
)
monitor
()
{
func
(
vc
*
VarnishController
)
monitor
()
{
...
...
cmd/varnish/varnish.go
View file @
6217f87e
...
@@ -26,16 +26,6 @@
...
@@ -26,16 +26,6 @@
* SUCH DAMAGE.
* SUCH DAMAGE.
*/
*/
/*
// TODO
* VCL housekeeping
* either discard the previously active VCL immediately on new vcl.use
* or periodically clean up
* monitoring
* periodically call ping, status, panic.show when otherwise idle
*/
package
varnish
package
varnish
import
(
import
(
...
...
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