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
7ea10bfc
Commit
7ea10bfc
authored
Dec 28, 2018
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bugfix determining whether a Varnish Service sync requires VCL reload.
And remove some dead code while we're at it.
parent
d733fb1d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
14 deletions
+17
-14
ingress.go
pkg/controller/ingress.go
+3
-10
service.go
pkg/controller/service.go
+14
-4
No files found.
pkg/controller/ingress.go
View file @
7ea10bfc
...
...
@@ -47,13 +47,6 @@ import (
const
(
ingressClassKey
=
"kubernetes.io/ingress.class"
annotationPrefix
=
"ingress.varnish-cache.org/"
selfShardKey
=
"self-sharding"
shardProbeTimeoutKey
=
"self-sharding-probe-timeout"
shardProbeIntervalKey
=
"self-sharding-probe-interval"
shardProbeInitialKey
=
"self-sharding-probe-initial"
shardProbeWindowKey
=
"self-sharding-probe-window"
shardProbeThresholdKey
=
"self-sharding-probe-threshold"
shardMax2ndTTL
=
"self-sharding-max-secondary-ttl"
varnishSvcKey
=
annotationPrefix
+
"varnish-svc"
)
...
...
pkg/controller/service.go
View file @
7ea10bfc
...
...
@@ -105,9 +105,19 @@ func (worker *NamespaceWorker) enqueueIngressForService(
// Return true if changes in Varnish services may lead to changes in
// the VCL config generated for the Ingress.
func
isVarnishInVCLSpec
(
ing
*
extensions
.
Ingress
)
bool
{
_
,
selfShard
:=
ing
.
Annotations
[
selfShardKey
]
return
selfShard
func
(
worker
*
NamespaceWorker
)
isVarnishInVCLSpec
(
ing
*
extensions
.
Ingress
)
bool
{
vcfgs
,
err
:=
worker
.
vcfg
.
List
(
labels
.
Everything
())
if
err
!=
nil
{
worker
.
log
.
Warnf
(
"Error retrieving VarnishConfigs in "
+
"namespace %s: %v"
,
worker
.
namespace
,
err
)
return
false
}
for
_
,
vcfg
:=
range
vcfgs
{
if
vcfg
.
Spec
.
SelfSharding
!=
nil
{
return
true
}
}
return
false
}
func
(
worker
*
NamespaceWorker
)
syncSvc
(
key
string
)
error
{
...
...
@@ -143,7 +153,7 @@ func (worker *NamespaceWorker) syncSvc(key string) error {
ingSvc
.
Name
!=
svc
.
Name
{
continue
}
if
!
isVarnishInVCLSpec
(
ing
)
{
if
!
worker
.
isVarnishInVCLSpec
(
ing
)
{
continue
}
updateVCL
=
true
...
...
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