Skip to content

Commit 78f9d29

Browse files
fabianonunesoktalz
authored andcommitted
BUG/MINOR: prevents unnecessary reloading when the attribute client-ca is not used.
If you don't use `client-ca`, the comparison between `BindParams.Verify` and `client-crt-optional` will never be true, which will force an unnecessary reload of the instance. If `client-ca` and `client-crt-optional` aren't used, `BindParams.Verify` will always be an empty string and, therefore, can't be equal to `"required"`. So, if `client-ca` and `BindParams.SslCafile` are equal and **both are empty**, we don't need to check the value of the `Verify` attribute. In this case, we can safely skip the reload, because if `client-ca` didn't change *and* is still empty, the `Verify` value doesn't matter.
1 parent 1af197c commit 78f9d29

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/handler/https.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ func (handler HTTPS) handleClientTLSAuth(k store.K8s, h haproxy.HAProxy) (reload
115115
}
116116

117117
// No changes
118-
if binds[0].SslCafile == caFile && binds[0].Verify == verify {
118+
if binds[0].SslCafile == caFile && (caFile == "" || binds[0].Verify == verify) {
119119
return
120120
}
121121
// Removing config

0 commit comments

Comments
 (0)