diff --git a/pkg/operator/ceph/object/spec.go b/pkg/operator/ceph/object/spec.go index 350a36e4b..ee983d5cd 100644 --- a/pkg/operator/ceph/object/spec.go +++ b/pkg/operator/ceph/object/spec.go @@ -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 } diff --git a/pkg/operator/ceph/object/spec_test.go b/pkg/operator/ceph/object/spec_test.go index 46237879c..08974c41c 100644 --- a/pkg/operator/ceph/object/spec_test.go +++ b/pkg/operator/ceph/object/spec_test.go @@ -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