Merge pull request #7334 from thotz/livenessprobergwsslenabled
ceph: handle ssl cases for RGW's livenessprobe
This commit is contained in:
2 files changed
+4
-13
No files matched your search
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user