Skip to content

Commit 6e007b9

Browse files
committed
BUG/MINOR: save alpn and strictSNI settings over updates
1 parent e6e24c1 commit 6e007b9

File tree

3 files changed

+13
-11
lines changed

3 files changed

+13
-11
lines changed

.aspell.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,5 @@ allowed:
4848
- backport
4949
- cmd
5050
- backports
51+
- alpn
52+
- SNI

pkg/controller/handler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ func (c *HAProxyController) initHandlers() {
3131

3232
// handlers executed at reconciliation loop
3333
c.updateHandlers = []UpdateHandler{
34-
handler.HTTPS{
34+
&handler.HTTPS{
3535
Enabled: !c.osArgs.DisableHTTPS,
3636
CertDir: c.haproxy.Certs.FrontendDir,
3737
IPv4: !c.osArgs.DisableIPV4,

pkg/handler/https.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ const (
5353
BIND_IP_V6 = "v6"
5454
)
5555

56-
func (handler HTTPS) bindList(h haproxy.HAProxy) (binds []models.Bind) {
56+
func (handler *HTTPS) bindList(h haproxy.HAProxy) (binds []models.Bind) {
5757
if handler.IPv4 {
5858
binds = append(binds, models.Bind{
5959
Address: handler.AddrIPv4,
@@ -78,7 +78,7 @@ func (handler HTTPS) bindList(h haproxy.HAProxy) (binds []models.Bind) {
7878
return binds
7979
}
8080

81-
func (handler HTTPS) bindListPassthrough(h haproxy.HAProxy) (binds []models.Bind) {
81+
func (handler *HTTPS) bindListPassthrough(h haproxy.HAProxy) (binds []models.Bind) {
8282
binds = append(binds, models.Bind{
8383
Address: "unix@" + handler.unixSocketPath(h),
8484
BindParams: models.BindParams{
@@ -89,11 +89,11 @@ func (handler HTTPS) bindListPassthrough(h haproxy.HAProxy) (binds []models.Bind
8989
return binds
9090
}
9191

92-
func (handler HTTPS) unixSocketPath(h haproxy.HAProxy) string {
92+
func (handler *HTTPS) unixSocketPath(h haproxy.HAProxy) string {
9393
return path.Join(h.Env.RuntimeDir, "ssl-frontend.sock")
9494
}
9595

96-
func (handler HTTPS) handleClientTLSAuth(k store.K8s, h haproxy.HAProxy) (err error) {
96+
func (handler *HTTPS) handleClientTLSAuth(k store.K8s, h haproxy.HAProxy) (err error) {
9797
// Parsing
9898
var caFile string
9999
var notFound store.ErrNotFound
@@ -158,7 +158,7 @@ func (handler HTTPS) handleClientTLSAuth(k store.K8s, h haproxy.HAProxy) (err er
158158
return
159159
}
160160

161-
func (handler HTTPS) Update(k store.K8s, h haproxy.HAProxy, a annotations.Annotations) (err error) {
161+
func (handler *HTTPS) Update(k store.K8s, h haproxy.HAProxy, a annotations.Annotations) (err error) {
162162
if !handler.Enabled {
163163
logger.Debug("Cannot proceed with SSL Passthrough update, HTTPS is disabled")
164164
return nil
@@ -203,7 +203,7 @@ func (handler HTTPS) Update(k store.K8s, h haproxy.HAProxy, a annotations.Annota
203203
return nil
204204
}
205205

206-
func (handler HTTPS) enableSSLPassthrough(h haproxy.HAProxy) (err error) {
206+
func (handler *HTTPS) enableSSLPassthrough(h haproxy.HAProxy) (err error) {
207207
// Create TCP frontend for ssl-passthrough
208208
frontend := models.FrontendBase{
209209
Name: h.FrontSSL,
@@ -243,7 +243,7 @@ func (handler HTTPS) enableSSLPassthrough(h haproxy.HAProxy) (err error) {
243243
return errors.Result()
244244
}
245245

246-
func (handler HTTPS) disableSSLPassthrough(h haproxy.HAProxy) (err error) {
246+
func (handler *HTTPS) disableSSLPassthrough(h haproxy.HAProxy) (err error) {
247247
err = h.FrontendDelete(h.FrontSSL)
248248
if err != nil {
249249
return err
@@ -256,7 +256,7 @@ func (handler HTTPS) disableSSLPassthrough(h haproxy.HAProxy) (err error) {
256256
return nil
257257
}
258258

259-
func (handler HTTPS) toggleSSLPassthrough(passthrough bool, h haproxy.HAProxy) (err error) {
259+
func (handler *HTTPS) toggleSSLPassthrough(passthrough bool, h haproxy.HAProxy) (err error) {
260260
handler.deleteHTTPSFrontendBinds(h)
261261
bindListFunc := handler.bindList
262262
if passthrough {
@@ -273,7 +273,7 @@ func (handler HTTPS) toggleSSLPassthrough(passthrough bool, h haproxy.HAProxy) (
273273
return nil
274274
}
275275

276-
func (handler HTTPS) deleteHTTPSFrontendBinds(h haproxy.HAProxy) {
276+
func (handler *HTTPS) deleteHTTPSFrontendBinds(h haproxy.HAProxy) {
277277
bindsToDelete := []string{BIND_IP_V4, BIND_IP_V6, BIND_UNIX_SOCKET}
278278
for _, bind := range bindsToDelete {
279279
if err := h.FrontendBindDelete(h.FrontHTTPS, bind); err != nil {
@@ -282,7 +282,7 @@ func (handler HTTPS) deleteHTTPSFrontendBinds(h haproxy.HAProxy) {
282282
}
283283
}
284284

285-
func (handler HTTPS) sslPassthroughRules(k store.K8s, h haproxy.HAProxy, a annotations.Annotations) error {
285+
func (handler *HTTPS) sslPassthroughRules(k store.K8s, h haproxy.HAProxy, a annotations.Annotations) error {
286286
inspectTimeout, err := a.Timeout("timeout-client", k.ConfigMaps.Main.Annotations)
287287
if inspectTimeout == nil {
288288
if err != nil {

0 commit comments

Comments
 (0)