Merge pull request #10756 from rook/mergify/bp/release-1.9/pr-10750

object: hostNetwork setting should be under spec.gateway instead of spec in the ObjectStore CRD (backport #10750)
This commit is contained in:
mergify[bot] authored and GitHub committed 2022-08-22 20:06:59 +00:00
commit b468db897c
6 files changed
+26 -26

No files matched your search

@@ -7632,6 +7632,11 @@ spec:
type: object
nullable: true
type: array
hostNetwork:
description: Whether host networking is enabled for the rgw daemon. If not set, the network settings from the cluster CR will be applied.
nullable: true
type: boolean
x-kubernetes-preserve-unknown-fields: true
instances:
description: The number of pods in the rgw replicaset.
format: int32
@@ -8577,11 +8582,6 @@ spec:
type: object
type: object
type: object
hostNetwork:
description: Whether host networking is enabled for the rgw daemon. If not set, the network settings from the cluster CR will be applied.
nullable: true
type: boolean
x-kubernetes-preserve-unknown-fields: true
metadataPool:
description: The metadata pool settings
nullable: true
+5 -5
View File
@@ -7624,6 +7624,11 @@ spec:
type: object
nullable: true
type: array
hostNetwork:
description: Whether host networking is enabled for the rgw daemon. If not set, the network settings from the cluster CR will be applied.
nullable: true
type: boolean
x-kubernetes-preserve-unknown-fields: true
instances:
description: The number of pods in the rgw replicaset.
format: int32
@@ -8569,11 +8574,6 @@ spec:
type: object
type: object
type: object
hostNetwork:
description: Whether host networking is enabled for the rgw daemon. If not set, the network settings from the cluster CR will be applied.
nullable: true
type: boolean
x-kubernetes-preserve-unknown-fields: true
metadataPool:
description: The metadata pool settings
nullable: true
+2 -2
View File
@@ -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()
}
+6 -6
View File
@@ -1325,12 +1325,6 @@ type ObjectStoreSpec struct {
// +optional
// +nullable
Security *SecuritySpec `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
@@ -1421,6 +1415,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
@@ -2363,6 +2363,11 @@ func (in *GatewaySpec) DeepCopyInto(out *GatewaySpec) {
*out = new(RGWServiceSpec)
(*in).DeepCopyInto(*out)
}
if in.HostNetwork != nil {
in, out := &in.HostNetwork, &out.HostNetwork
*out = new(bool)
**out = **in
}
return
}
@@ -2993,11 +2998,6 @@ func (in *ObjectStoreSpec) DeepCopyInto(out *ObjectStoreSpec) {
*out = new(SecuritySpec)
(*in).DeepCopyInto(*out)
}
if in.HostNetwork != nil {
in, out := &in.HostNetwork, &out.HostNetwork
*out = new(bool)
**out = **in
}
return
}
+3 -3
View File
@@ -633,15 +633,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)
}