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:
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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user