diff --git a/pkg/operator/ceph/object/spec.go b/pkg/operator/ceph/object/spec.go index 950295bf8..5c12f1daa 100644 --- a/pkg/operator/ceph/object/spec.go +++ b/pkg/operator/ceph/object/spec.go @@ -189,7 +189,7 @@ func (c *clusterConfig) makeRGWPodSpec(rgwConfig *rgwConfig) (v1.PodTemplateSpec // If host networking is not enabled, preferred pod anti-affinity is added to the rgw daemons labels := getLabels(c.store.Name, c.store.Namespace, false) - k8sutil.SetNodeAntiAffinityForPod(&podSpec, c.clusterSpec.Network.IsHost(), v1.LabelHostname, labels, nil) + k8sutil.SetNodeAntiAffinityForPod(&podSpec, c.store.Spec.IsHostNetwork(c.clusterSpec), v1.LabelHostname, labels, nil) podTemplateSpec := v1.PodTemplateSpec{ ObjectMeta: metav1.ObjectMeta{ @@ -426,7 +426,7 @@ func (c *clusterConfig) generateProbePort() intstr.IntOrString { port := intstr.FromInt(int(rgwPortInternalPort)) // If Host Networking is enabled, the port from the spec must be reflected - if c.clusterSpec.Network.IsHost() { + if c.store.Spec.IsHostNetwork(c.clusterSpec) { port = intstr.FromInt(int(c.store.Spec.Gateway.Port)) } @@ -448,7 +448,7 @@ func (c *clusterConfig) generateService(cephObjectStore *cephv1.CephObjectStore) if c.store.Spec.Gateway.Service != nil { c.store.Spec.Gateway.Service.Annotations.ApplyToObjectMeta(&svc.ObjectMeta) } - if c.clusterSpec.Network.IsHost() { + if c.store.Spec.IsHostNetwork(c.clusterSpec) { svc.Spec.ClusterIP = v1.ClusterIPNone }