Merge pull request #7334 from thotz/livenessprobergwsslenabled

ceph: handle ssl cases for RGW's livenessprobe
This commit is contained in:
Travis Nielsen authored and GitHub committed 2021-03-02 11:42:06 -07:00
commit ddedecabac
2 files changed
+4 -13

No files matched your search

+4 -5
View File
@@ -302,13 +302,12 @@ func (c *clusterConfig) generateLiveProbePort() intstr.IntOrString {
// If Host Networking is enabled, the port from the spec must be reflected
if c.clusterSpec.Network.IsHost() {
if c.store.Spec.Gateway.Port == 0 && c.store.Spec.Gateway.SecurePort != 0 && c.store.Spec.Gateway.SSLCertificateRef != "" {
port = intstr.FromInt(int(c.store.Spec.Gateway.SecurePort))
} else {
port = intstr.FromInt(int(c.store.Spec.Gateway.Port))
}
port = intstr.FromInt(int(c.store.Spec.Gateway.Port))
}
if c.store.Spec.Gateway.Port == 0 && c.store.Spec.Gateway.SecurePort != 0 && c.store.Spec.Gateway.SSLCertificateRef != "" {
port = intstr.FromInt(int(c.store.Spec.Gateway.SecurePort))
}
return port
}
-8
View File
@@ -215,14 +215,6 @@ func TestGenerateLiveProbe(t *testing.T) {
assert.Equal(t, int32(8080), p.Handler.HTTPGet.Port.IntVal)
assert.Equal(t, v1.URISchemeHTTP, p.Handler.HTTPGet.Scheme)
// SSL - HostNetwork is disabled - using internal port
c.store.Spec.Gateway.Port = 0
c.store.Spec.Gateway.SecurePort = 321
c.store.Spec.Gateway.SSLCertificateRef = "foo"
p = c.generateLiveProbe()
assert.Equal(t, int32(8080), p.Handler.HTTPGet.Port.IntVal)
assert.Equal(t, v1.URISchemeHTTPS, p.Handler.HTTPGet.Scheme)
// No SSL - HostNetwork is enabled
c.store.Spec.Gateway.Port = 123
c.store.Spec.Gateway.SecurePort = 0