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
14153428
Commit
14153428
authored
May 08, 2020
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix tracking whether the haproxy offloader frontend is configured.
parent
d407fe0d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
haproxy.go
pkg/haproxy/haproxy.go
+6
-2
No files found.
pkg/haproxy/haproxy.go
View file @
14153428
...
@@ -121,6 +121,7 @@ type configStatus struct {
...
@@ -121,6 +121,7 @@ type configStatus struct {
dplaneState
ReloadState
dplaneState
ReloadState
version
int64
version
int64
pemExists
bool
pemExists
bool
loaded
bool
}
}
type
haproxyInst
struct
{
type
haproxyInst
struct
{
...
@@ -315,6 +316,7 @@ func (hc *Controller) updateInstance(inst *haproxyInst, spec *Spec) error {
...
@@ -315,6 +316,7 @@ func (hc *Controller) updateInstance(inst *haproxyInst, spec *Spec) error {
hc
.
log
.
Infof
(
"Offloader instance %s: TLS config %s sucessfully"
+
hc
.
log
.
Infof
(
"Offloader instance %s: TLS config %s sucessfully"
+
"loaded at %s"
,
inst
.
name
,
spec
,
"loaded at %s"
,
inst
.
name
,
spec
,
state
.
Timestamp
.
Format
(
time
.
RFC3339
))
state
.
Timestamp
.
Format
(
time
.
RFC3339
))
inst
.
status
.
loaded
=
true
return
nil
return
nil
case
Failed
,
Unknown
:
case
Failed
,
Unknown
:
return
fmt
.
Errorf
(
"Offloader instance %s: TLS config %s load "
+
return
fmt
.
Errorf
(
"Offloader instance %s: TLS config %s load "
+
...
@@ -333,6 +335,7 @@ func (hc *Controller) updateInstance(inst *haproxyInst, spec *Spec) error {
...
@@ -333,6 +335,7 @@ func (hc *Controller) updateInstance(inst *haproxyInst, spec *Spec) error {
hc
.
log
.
Infof
(
"Offloader instance %s: TLS config %s "
+
hc
.
log
.
Infof
(
"Offloader instance %s: TLS config %s "
+
"successfully loaded at %s"
,
inst
.
name
,
spec
,
"successfully loaded at %s"
,
inst
.
name
,
spec
,
state
.
Timestamp
.
Format
(
time
.
RFC3339
))
state
.
Timestamp
.
Format
(
time
.
RFC3339
))
inst
.
status
.
loaded
=
true
return
nil
return
nil
}
}
// XXX SyncIncomplete
// XXX SyncIncomplete
...
@@ -377,7 +380,7 @@ func (hc *Controller) updateOffldSvc(svcKey string) error {
...
@@ -377,7 +380,7 @@ func (hc *Controller) updateOffldSvc(svcKey string) error {
}
}
// XXX metrics
// XXX metrics
hc
.
log
.
Debugf
(
"offloader svc %s: get current status"
,
inst
.
name
)
hc
.
log
.
Debugf
(
"offloader svc %s: get current status"
,
inst
.
name
)
if
err
:=
hc
.
getOffldStatus
(
*
inst
);
err
!=
nil
{
if
err
:=
hc
.
getOffldStatus
(
inst
);
err
!=
nil
{
offldrErr
:=
inst
.
mkError
(
err
)
offldrErr
:=
inst
.
mkError
(
err
)
errs
=
append
(
errs
,
offldrErr
)
errs
=
append
(
errs
,
offldrErr
)
continue
continue
...
@@ -579,7 +582,7 @@ func (hc *Controller) updateOffldrAddrs(key string, addrs []OffldAddr,
...
@@ -579,7 +582,7 @@ func (hc *Controller) updateOffldrAddrs(key string, addrs []OffldAddr,
return
errs
return
errs
}
}
func
(
hc
*
Controller
)
getOffldStatus
(
inst
haproxyInst
)
error
{
func
(
hc
*
Controller
)
getOffldStatus
(
inst
*
haproxyInst
)
error
{
hc
.
log
.
Debugf
(
"Offloader instance %s, checking offloader config"
,
hc
.
log
.
Debugf
(
"Offloader instance %s, checking offloader config"
,
inst
.
name
)
inst
.
name
)
inst
.
admMtx
.
Lock
()
inst
.
admMtx
.
Lock
()
...
@@ -592,6 +595,7 @@ func (hc *Controller) getOffldStatus(inst haproxyInst) error {
...
@@ -592,6 +595,7 @@ func (hc *Controller) getOffldStatus(inst haproxyInst) error {
return
err
return
err
}
}
inst
.
status
.
version
=
int64
(
version
)
inst
.
status
.
version
=
int64
(
version
)
inst
.
status
.
loaded
=
loaded
if
loaded
{
if
loaded
{
hc
.
log
.
Infof
(
"Offloader instance %s: offloader configured, "
+
hc
.
log
.
Infof
(
"Offloader instance %s: offloader configured, "
+
"version=%d"
,
inst
.
name
,
version
)
"version=%d"
,
inst
.
name
,
version
)
...
...
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