From a1aa5196376323047267d13d6e2c6aa5a03693dc Mon Sep 17 00:00:00 2001 From: Tapajit Chandra Paul Date: Mon, 1 Jul 2024 12:38:55 +0600 Subject: [PATCH] Fix druid defaulter Signed-off-by: Tapajit Chandra Paul --- apis/kubedb/v1alpha2/constants.go | 10 +++++++--- apis/kubedb/v1alpha2/druid_helpers.go | 6 ++++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/apis/kubedb/v1alpha2/constants.go b/apis/kubedb/v1alpha2/constants.go index 553894659c..0fd8a3fee4 100644 --- a/apis/kubedb/v1alpha2/constants.go +++ b/apis/kubedb/v1alpha2/constants.go @@ -932,10 +932,12 @@ const ( DruidVolumeOperatorConfig = "operator-config-volume" DruidVolumeMainConfig = "main-config-volume" DruidVolumeCustomConfig = "custom-config" + DruidMetadataTLSVolume = "metadata-tls-volume" - DruidOperatorConfigDir = "/tmp/config/operator-config" - DruidMainConfigDir = "/opt/druid/conf" - DruidCustomConfigDir = "/tmp/config/custom-config" + DruidOperatorConfigDir = "/tmp/config/operator-config" + DruidMainConfigDir = "/opt/druid/conf" + DruidCustomConfigDir = "/tmp/config/custom-config" + DruidMetadataTLSConfigDir = "/tmp/metadata-tls" DruidVolumeCommonConfig = "common-config-volume" DruidCommonConfigFile = "common.runtime.properties" @@ -959,6 +961,8 @@ const ( EnvDruidMetdataStoragePassword = "DRUID_METADATA_STORAGE_PASSWORD" EnvDruidZKServicePassword = "DRUID_ZK_SERVICE_PASSWORD" EnvDruidCoordinatorAsOverlord = "DRUID_COORDINATOR_AS_OVERLORD" + EnvDruidMetadataTLSEnable = "DRUID_METADATA_TLS_ENABLE" + EnvDruidMetadataStorageType = "DRUID_METADATA_STORAGE_TYPE" DruidPortCoordinators = 8081 DruidPortOverlords = 8090 diff --git a/apis/kubedb/v1alpha2/druid_helpers.go b/apis/kubedb/v1alpha2/druid_helpers.go index f54e8bf547..0fd076501d 100644 --- a/apis/kubedb/v1alpha2/druid_helpers.go +++ b/apis/kubedb/v1alpha2/druid_helpers.go @@ -513,6 +513,12 @@ func (d *Druid) SetDefaults() { if d.Spec.MetadataStorage == nil { d.Spec.MetadataStorage = &MetadataStorage{} } + if !d.Spec.MetadataStorage.ExternallyManaged { + if d.Spec.MetadataStorage.ObjectReference == nil { + d.Spec.MetadataStorage.ObjectReference = &kmapi.ObjectReference{} + } + d.Spec.MetadataStorage.Name = d.GetMetadataStorageName() + } if d.Spec.MetadataStorage.Namespace == "" { d.Spec.MetadataStorage.Namespace = d.Namespace }