From 6c7dc4634371c4e4d4272344817e2b55a0bad649 Mon Sep 17 00:00:00 2001 From: "Md. Ishtiaq Islam" Date: Thu, 21 Nov 2024 16:30:39 +0600 Subject: [PATCH] Add functions for verifier Signed-off-by: Md. Ishtiaq Islam --- .../v1alpha1/kubedb_kubestash_catalog_types.go | 5 +++++ .../installer/v1alpha1/zz_generated.deepcopy.go | 17 +++++++++++++++++ .../kubedbverifier/kubedbverifier-function.yaml | 10 ++++++++++ charts/kubedb-kubestash-catalog/README.md | 1 + .../kubedbverifier/kubedbverifier.yaml | 14 ++++++++++++++ .../values.openapiv3_schema.yaml | 8 ++++++++ charts/kubedb-kubestash-catalog/values.yaml | 2 ++ charts/kubedb/values.openapiv3_schema.yaml | 8 ++++++++ 8 files changed, 65 insertions(+) create mode 100644 catalog/kubestash/raw/kubedbverifier/kubedbverifier-function.yaml create mode 100644 charts/kubedb-kubestash-catalog/templates/kubedbverifier/kubedbverifier.yaml diff --git a/apis/installer/v1alpha1/kubedb_kubestash_catalog_types.go b/apis/installer/v1alpha1/kubedb_kubestash_catalog_types.go index 719ec92e2..aa012dcaa 100644 --- a/apis/installer/v1alpha1/kubedb_kubestash_catalog_types.go +++ b/apis/installer/v1alpha1/kubedb_kubestash_catalog_types.go @@ -60,6 +60,7 @@ type KubedbKubestashCatalogSpec struct { Postgres StashPostgresSpec `json:"postgres"` Singlestore StashSinglestoreSpec `json:"singlestore"` ZooKeeper StashZooKeeperSpec `json:"zookeeper"` + Kubedbverifier StashVerifierSpec `json:"kubedbverifier"` } // StashDruidSpec is the schema for Stash Druid values file @@ -237,6 +238,10 @@ type ZooKeeperRestore struct { Args string `json:"args"` } +type StashVerifierSpec struct { + Enabled bool `json:"enabled"` +} + // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // KubedbKubestashCatalogList is a list of KubedbKubestashCatalogs diff --git a/apis/installer/v1alpha1/zz_generated.deepcopy.go b/apis/installer/v1alpha1/zz_generated.deepcopy.go index 0e181f794..d0ec1b15a 100644 --- a/apis/installer/v1alpha1/zz_generated.deepcopy.go +++ b/apis/installer/v1alpha1/zz_generated.deepcopy.go @@ -1027,6 +1027,7 @@ func (in *KubedbKubestashCatalogSpec) DeepCopyInto(out *KubedbKubestashCatalogSp out.Postgres = in.Postgres out.Singlestore = in.Singlestore out.ZooKeeper = in.ZooKeeper + out.Kubedbverifier = in.Kubedbverifier return } @@ -3204,6 +3205,22 @@ func (in *StashSinglestoreSpec) DeepCopy() *StashSinglestoreSpec { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *StashVerifierSpec) DeepCopyInto(out *StashVerifierSpec) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StashVerifierSpec. +func (in *StashVerifierSpec) DeepCopy() *StashVerifierSpec { + if in == nil { + return nil + } + out := new(StashVerifierSpec) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *StashZooKeeperSpec) DeepCopyInto(out *StashZooKeeperSpec) { *out = *in diff --git a/catalog/kubestash/raw/kubedbverifier/kubedbverifier-function.yaml b/catalog/kubestash/raw/kubedbverifier/kubedbverifier-function.yaml new file mode 100644 index 000000000..63b9b25b5 --- /dev/null +++ b/catalog/kubestash/raw/kubedbverifier/kubedbverifier-function.yaml @@ -0,0 +1,10 @@ +apiVersion: addons.kubestash.com/v1alpha1 +kind: Function +metadata: + name: kubedbverifier +spec: + args: + - verify + - --namespace=${namespace:=default} + - --backupverificationsession=${backupVerificationSession:=} + image: ghcr.io/kubedb/kubedb-verifier:v0.1.0 diff --git a/charts/kubedb-kubestash-catalog/README.md b/charts/kubedb-kubestash-catalog/README.md index 199d4a9ec..81f44340c 100644 --- a/charts/kubedb-kubestash-catalog/README.md +++ b/charts/kubedb-kubestash-catalog/README.md @@ -100,6 +100,7 @@ The following table lists the configurable parameters of the `kubedb-kubestash-c | singlestore.restore.args | Arguments to pass to `singlestore` command during restore process | "" | | zookeeper.backup.args | Arguments to pass to `zk-dump` command during bakcup process | "" | | zookeeper.restore.args | Arguments to pass to `zookeeper` command during restore process | "" | +| kubedbverifier.enabled | | true | Specify each parameter using the `--set key=value[,key=value]` argument to `helm upgrade -i`. For example: diff --git a/charts/kubedb-kubestash-catalog/templates/kubedbverifier/kubedbverifier.yaml b/charts/kubedb-kubestash-catalog/templates/kubedbverifier/kubedbverifier.yaml new file mode 100644 index 000000000..32e656532 --- /dev/null +++ b/charts/kubedb-kubestash-catalog/templates/kubedbverifier/kubedbverifier.yaml @@ -0,0 +1,14 @@ +{{ if .Values.kubedbverifier.enabled }} +apiVersion: addons.kubestash.com/v1alpha1 +kind: Function +metadata: + name: 'kubedbverifier' + labels: + {{- include "kubedb-kubestash-catalog.labels" . | nindent 4 }} +spec: + args: + - verify + - --namespace=${namespace:=default} + - --backupverificationsession=${backupVerificationSession:=} + image: '{{ include "image.ghcr" (merge (dict "_repo" "kubedb/kubedb-verifier") $) }}:v0.1.0' +{{ end }} diff --git a/charts/kubedb-kubestash-catalog/values.openapiv3_schema.yaml b/charts/kubedb-kubestash-catalog/values.openapiv3_schema.yaml index a10ffddf6..0ab379bcf 100644 --- a/charts/kubedb-kubestash-catalog/values.openapiv3_schema.yaml +++ b/charts/kubedb-kubestash-catalog/values.openapiv3_schema.yaml @@ -45,6 +45,13 @@ properties: required: - enabled type: object + kubedbverifier: + properties: + enabled: + type: boolean + required: + - enabled + type: object mariadb: properties: backup: @@ -237,6 +244,7 @@ required: - elasticsearch - featureGates - kubedbmanifest +- kubedbverifier - mariadb - mongodb - mssqlserver diff --git a/charts/kubedb-kubestash-catalog/values.yaml b/charts/kubedb-kubestash-catalog/values.yaml index 445701c39..f228c7471 100644 --- a/charts/kubedb-kubestash-catalog/values.yaml +++ b/charts/kubedb-kubestash-catalog/values.yaml @@ -136,3 +136,5 @@ zookeeper: restore: # Arguments to pass to `zookeeper` command during restore process args: "" +kubedbverifier: + enabled: true diff --git a/charts/kubedb/values.openapiv3_schema.yaml b/charts/kubedb/values.openapiv3_schema.yaml index 2b61fdf9d..6d3d0dd44 100644 --- a/charts/kubedb/values.openapiv3_schema.yaml +++ b/charts/kubedb/values.openapiv3_schema.yaml @@ -4286,6 +4286,13 @@ properties: required: - enabled type: object + kubedbverifier: + properties: + enabled: + type: boolean + required: + - enabled + type: object mariadb: properties: backup: @@ -4480,6 +4487,7 @@ properties: - enabled - featureGates - kubedbmanifest + - kubedbverifier - mariadb - mongodb - mssqlserver