diff --git a/pkg/apis/ceph.rook.io/v1/object.go b/pkg/apis/ceph.rook.io/v1/object.go index 3d815df80..c8ce342cc 100644 --- a/pkg/apis/ceph.rook.io/v1/object.go +++ b/pkg/apis/ceph.rook.io/v1/object.go @@ -50,8 +50,8 @@ func (s *ObjectStoreSpec) IsExternal() bool { } func (s *ObjectStoreSpec) IsHostNetwork(c *ClusterSpec) bool { - if s.HostNetwork != nil { - return *s.HostNetwork + if s.Gateway.HostNetwork != nil { + return *s.Gateway.HostNetwork } return c.Network.IsHost() } diff --git a/pkg/apis/ceph.rook.io/v1/types.go b/pkg/apis/ceph.rook.io/v1/types.go index 4f191adb1..1ccdac3d1 100755 --- a/pkg/apis/ceph.rook.io/v1/types.go +++ b/pkg/apis/ceph.rook.io/v1/types.go @@ -1337,12 +1337,6 @@ type ObjectStoreSpec struct { // +optional // +nullable Security *ObjectStoreSecuritySpec `json:"security,omitempty"` - - // Whether host networking is enabled for the rgw daemon. If not set, the network settings from the cluster CR will be applied. - // +kubebuilder:pruning:PreserveUnknownFields - // +nullable - // +optional - HostNetwork *bool `json:"hostNetwork,omitempty"` } // BucketHealthCheckSpec represents the health check of an object store @@ -1433,6 +1427,12 @@ type GatewaySpec struct { // +optional // +nullable Service *RGWServiceSpec `json:"service,omitempty"` + + // Whether host networking is enabled for the rgw daemon. If not set, the network settings from the cluster CR will be applied. + // +kubebuilder:pruning:PreserveUnknownFields + // +nullable + // +optional + HostNetwork *bool `json:"hostNetwork,omitempty"` } // ZoneSpec represents a Ceph Object Store Gateway Zone specification diff --git a/pkg/operator/ceph/object/spec_test.go b/pkg/operator/ceph/object/spec_test.go index 25680d79a..7f925ae7f 100644 --- a/pkg/operator/ceph/object/spec_test.go +++ b/pkg/operator/ceph/object/spec_test.go @@ -753,15 +753,15 @@ func TestMakeRGWPodSpec(t *testing.T) { t.Run(tt.name, func(t *testing.T) { if tt.isSet { if tt.enabled { - c.store.Spec.HostNetwork = func(hostNetwork bool) *bool { return &hostNetwork }(true) + c.store.Spec.Gateway.HostNetwork = func(hostNetwork bool) *bool { return &hostNetwork }(true) } else { - c.store.Spec.HostNetwork = new(bool) + c.store.Spec.Gateway.HostNetwork = new(bool) } } podTemplateSpec, _ := c.makeRGWPodSpec(rgwConfig) if tt.isSet { - assert.Equal(t, *c.store.Spec.HostNetwork, podTemplateSpec.Spec.HostNetwork) + assert.Equal(t, *c.store.Spec.Gateway.HostNetwork, podTemplateSpec.Spec.HostNetwork) } else { assert.Equal(t, c.clusterSpec.Network.IsHost(), podTemplateSpec.Spec.HostNetwork) }