Merge pull request #11923 from rook/mergify/bp/release-1.11/pr-11908

rgw: enableRGWDashboard can be configured by custom (backport #11908)
This commit is contained in:
Travis Nielsen authored and GitHub committed 2023-03-20 12:41:55 -06:00
commit 257f09dfce
5 files changed
+26 -2

No files matched your search

@@ -11948,6 +11948,11 @@ spec:
description: The name of the secret that stores custom ca-bundle with root and intermediate certificates.
nullable: true
type: string
dashboardEnabled:
description: Whether rgw dashboard is enabled for the rgw daemon. If not set, the rgw dashboard will be enabled.
nullable: true
type: boolean
x-kubernetes-preserve-unknown-fields: true
externalRgwEndpoints:
description: ExternalRgwEndpoints points to external RGW endpoint(s). Multiple endpoints can be given, but for stability of ObjectBucketClaims, we highly recommend that users give only a single external RGW endpoint that is a load balancer that sends requests to the multiple RGWs.
items:
+5
View File
@@ -11940,6 +11940,11 @@ spec:
description: The name of the secret that stores custom ca-bundle with root and intermediate certificates.
nullable: true
type: string
dashboardEnabled:
description: Whether rgw dashboard is enabled for the rgw daemon. If not set, the rgw dashboard will be enabled.
nullable: true
type: boolean
x-kubernetes-preserve-unknown-fields: true
externalRgwEndpoints:
description: ExternalRgwEndpoints points to external RGW endpoint(s). Multiple endpoints can be given, but for stability of ObjectBucketClaims, we highly recommend that users give only a single external RGW endpoint that is a load balancer that sends requests to the multiple RGWs.
items:
+4
View File
@@ -41,6 +41,10 @@ func (s *ObjectStoreSpec) IsTLSEnabled() bool {
return s.Gateway.SecurePort != 0 && (s.Gateway.SSLCertificateRef != "" || s.GetServiceServingCert() != "")
}
func (s *ObjectStoreSpec) IsRGWDashboardEnabled() bool {
return s.Gateway.DashboardEnabled == nil || *s.Gateway.DashboardEnabled
}
func (s *ObjectStoreSpec) GetPort() (int32, error) {
if s.IsTLSEnabled() {
return s.Gateway.SecurePort, nil
+6
View File
@@ -1458,6 +1458,12 @@ type GatewaySpec struct {
// +nullable
// +optional
HostNetwork *bool `json:"hostNetwork,omitempty"`
// Whether rgw dashboard is enabled for the rgw daemon. If not set, the rgw dashboard will be enabled.
// +kubebuilder:pruning:PreserveUnknownFields
// +nullable
// +optional
DashboardEnabled *bool `json:"dashboardEnabled,omitempty"`
}
// EndpointAddress is a tuple that describes a single IP address or host name. This is a subset of
+6 -2
View File
@@ -82,8 +82,12 @@ func (c *clusterConfig) createOrUpdateStore(realmName, zoneGroupName, zoneName s
return nil
}
if err = enableRGWDashboard(objContext); err != nil {
logger.Warningf("failed to enable dashboard for rgw. %v", err)
if c.clusterSpec.Dashboard.Enabled {
if !c.store.Spec.IsRGWDashboardEnabled() {
disableRGWDashboard(objContext)
} else if err = enableRGWDashboard(objContext); err != nil {
logger.Warningf("failed to enable dashboard for rgw. %v", err)
}
}
logger.Infof("created object store %q in namespace %q", c.store.Name, c.store.Namespace)