From 70e10d18d8bf099cc6b02dd54858e81decf73eea Mon Sep 17 00:00:00 2001 From: Tapajit Chandra Paul Date: Wed, 6 Nov 2024 17:36:11 +0600 Subject: [PATCH] Add support for Druid Auth-Rotate Ops-Request Signed-off-by: Tapajit Chandra Paul --- apis/kubedb/v1alpha2/druid_types.go | 2 +- apis/kubedb/v1alpha2/openapi_generated.go | 2 +- apis/kubedb/v1alpha2/zz_generated.deepcopy.go | 4 ++-- apis/ops/v1alpha1/constant.go | 2 ++ crds/kubedb.com_druids.yaml | 7 +++++++ 5 files changed, 13 insertions(+), 4 deletions(-) diff --git a/apis/kubedb/v1alpha2/druid_types.go b/apis/kubedb/v1alpha2/druid_types.go index 524ea9b823..d572d1155b 100644 --- a/apis/kubedb/v1alpha2/druid_types.go +++ b/apis/kubedb/v1alpha2/druid_types.go @@ -68,7 +68,7 @@ type DruidSpec struct { // Database authentication secret // +optional - AuthSecret *core.LocalObjectReference `json:"authSecret,omitempty"` + AuthSecret *SecretReference `json:"authSecret,omitempty"` // Init is used to initialize database // +optional diff --git a/apis/kubedb/v1alpha2/openapi_generated.go b/apis/kubedb/v1alpha2/openapi_generated.go index 594eddfef5..6f9d8dd1cd 100644 --- a/apis/kubedb/v1alpha2/openapi_generated.go +++ b/apis/kubedb/v1alpha2/openapi_generated.go @@ -26955,7 +26955,7 @@ func schema_apimachinery_apis_kubedb_v1alpha2_DruidSpec(ref common.ReferenceCall "authSecret": { SchemaProps: spec.SchemaProps{ Description: "Database authentication secret", - Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), + Ref: ref("kubedb.dev/apimachinery/apis/kubedb/v1alpha2.SecretReference"), }, }, "init": { diff --git a/apis/kubedb/v1alpha2/zz_generated.deepcopy.go b/apis/kubedb/v1alpha2/zz_generated.deepcopy.go index f3ecdcc6fd..54e7ddd930 100644 --- a/apis/kubedb/v1alpha2/zz_generated.deepcopy.go +++ b/apis/kubedb/v1alpha2/zz_generated.deepcopy.go @@ -1017,8 +1017,8 @@ func (in *DruidSpec) DeepCopyInto(out *DruidSpec) { } if in.AuthSecret != nil { in, out := &in.AuthSecret, &out.AuthSecret - *out = new(corev1.LocalObjectReference) - **out = **in + *out = new(SecretReference) + (*in).DeepCopyInto(*out) } if in.Init != nil { in, out := &in.Init, &out.Init diff --git a/apis/ops/v1alpha1/constant.go b/apis/ops/v1alpha1/constant.go index aeae98e793..db24040d8b 100644 --- a/apis/ops/v1alpha1/constant.go +++ b/apis/ops/v1alpha1/constant.go @@ -331,6 +331,8 @@ const ( UpdateMiddleManagersNodePVCs = "UpdateMiddleManagersNodePVCs" UpdateHistoricalsNodePVCs = "UpdateHistoricalsNodePVCs" + + UpdateCredentialDynamically = "UpdateCredentialDynamically" ) // SingleStore Constants diff --git a/crds/kubedb.com_druids.yaml b/crds/kubedb.com_druids.yaml index 4541ffb7e4..b5b067b50a 100644 --- a/crds/kubedb.com_druids.yaml +++ b/crds/kubedb.com_druids.yaml @@ -48,9 +48,16 @@ spec: properties: authSecret: properties: + activeFrom: + format: date-time + type: string + externallyManaged: + type: boolean name: default: "" type: string + rotateAfter: + type: string type: object x-kubernetes-map-type: atomic configSecret: