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
9691f888
Commit
9691f888
authored
Jun 13, 2023
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Generate a Warn event when a VCL update fails after ConfigMap update.
parent
74fb1ce3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
8 deletions
+7
-8
spec.go
pkg/apiclient/spec.go
+3
-5
monitor.go
pkg/varnish/monitor.go
+4
-3
No files found.
pkg/apiclient/spec.go
View file @
9691f888
...
...
@@ -44,9 +44,7 @@ import (
"k8s.io/client-go/tools/cache"
)
const
(
vclSpecErr
=
"VCLspecError"
)
const
vclSpecErr
=
"VCLspecError"
// SpecUpdaterConfig represents the user configuration for k8s
// resources that are considered for a VCL update.
...
...
@@ -435,8 +433,8 @@ func (updater *SpecUpdater) Update() error {
return
err
}
if
err
=
updater
.
vc
.
Update
(
&
spec
);
err
!=
nil
{
// XXX generate Warn event, inc counter
updater
.
log
.
Errorf
(
"Update failed: %s"
,
err
)
updater
.
vc
.
ErrorEvt
(
varnish
.
UpdateErr
,
"VCL update failed: %s"
,
err
)
return
err
}
// XXX generate Info event, inc counter(?)
...
...
pkg/varnish/monitor.go
View file @
9691f888
...
...
@@ -36,6 +36,8 @@ import (
)
const
(
// UpdateErr is the Event reason name when a VCL update fails
UpdateErr
=
"UpdateFailure"
connectErr
=
"ConnectFailure"
vsmErr
=
"SharedMemoryFailure"
pingErr
=
"PingFailure"
...
...
@@ -47,7 +49,6 @@ const (
panic
=
"Panic"
vclListErr
=
"VCLListFailure"
discardErr
=
"VCLDiscardFailure"
updateErr
=
"UpdateFailure"
monitorGood
=
"MonitorGood"
)
...
...
@@ -169,11 +170,11 @@ func (vc *Controller) monitor(monitorIntvl time.Duration) {
}
if
vc
.
updater
==
nil
{
vc
.
ErrorEvt
(
u
pdateErr
,
"Updater not initialized"
)
vc
.
ErrorEvt
(
U
pdateErr
,
"Updater not initialized"
)
metrics
.
updateErrs
.
Inc
()
good
=
false
}
else
if
err
:=
vc
.
updater
.
Update
();
err
!=
nil
{
vc
.
ErrorEvt
(
u
pdateErr
,
"Errors updating Varnish: %+v"
,
vc
.
ErrorEvt
(
U
pdateErr
,
"Errors updating Varnish: %+v"
,
err
)
metrics
.
updateErrs
.
Inc
()
good
=
false
...
...
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