From df9177cac3978899590e87fb5c61093c4c7155d2 Mon Sep 17 00:00:00 2001 From: pritamdas99 Date: Thu, 5 Dec 2024 10:52:19 +0600 Subject: [PATCH 1/2] testing Signed-off-by: pritamdas99 Signed-off-by: pritamdas99 --- apis/addons/v1alpha1/addon_types.go | 2 +- apis/addons/v1alpha1/zz_generated.deepcopy.go | 1 - apis/config/v1alpha1/zz_generated.deepcopy.go | 1 - apis/core/v1alpha1/zz_generated.deepcopy.go | 1 - apis/storage/v1alpha1/snapshot_types.go | 31 ++++++++++++++++ .../storage/v1alpha1/zz_generated.deepcopy.go | 21 ++++++++++- apis/types.go | 3 +- apis/zz_generated.deepcopy.go | 1 - crds/addons.kubestash.com_addons.yaml | 18 +++++++++ crds/storage.kubestash.com_snapshots.yaml | 37 +++++++++++++++++++ 10 files changed, 109 insertions(+), 7 deletions(-) diff --git a/apis/addons/v1alpha1/addon_types.go b/apis/addons/v1alpha1/addon_types.go index 4815b0ed..490dab67 100644 --- a/apis/addons/v1alpha1/addon_types.go +++ b/apis/addons/v1alpha1/addon_types.go @@ -69,7 +69,7 @@ type Task struct { // Valid values are: // - "Restic": The underlying tool is [restic](https://restic.net/). // - "WalG": The underlying tool is [wal-g](https://github.com/wal-g/wal-g). - // +kubebuilder:validation:Enum=Restic;WalG;VolumeSnapshotter; + // +kubebuilder:validation:Enum=Restic;WalG;VolumeSnapshotter;Solr; Driver apis.Driver `json:"driver,omitempty"` // Executor specifies the type of entity that will execute the task. For example, it can be a Job, diff --git a/apis/addons/v1alpha1/zz_generated.deepcopy.go b/apis/addons/v1alpha1/zz_generated.deepcopy.go index 22133508..e1da3996 100644 --- a/apis/addons/v1alpha1/zz_generated.deepcopy.go +++ b/apis/addons/v1alpha1/zz_generated.deepcopy.go @@ -1,5 +1,4 @@ //go:build !ignore_autogenerated -// +build !ignore_autogenerated /* Copyright AppsCode Inc. and Contributors diff --git a/apis/config/v1alpha1/zz_generated.deepcopy.go b/apis/config/v1alpha1/zz_generated.deepcopy.go index 5dac5c13..56bd1218 100644 --- a/apis/config/v1alpha1/zz_generated.deepcopy.go +++ b/apis/config/v1alpha1/zz_generated.deepcopy.go @@ -1,5 +1,4 @@ //go:build !ignore_autogenerated -// +build !ignore_autogenerated /* Copyright AppsCode Inc. and Contributors diff --git a/apis/core/v1alpha1/zz_generated.deepcopy.go b/apis/core/v1alpha1/zz_generated.deepcopy.go index 3116115a..c3b15f2a 100644 --- a/apis/core/v1alpha1/zz_generated.deepcopy.go +++ b/apis/core/v1alpha1/zz_generated.deepcopy.go @@ -1,5 +1,4 @@ //go:build !ignore_autogenerated -// +build !ignore_autogenerated /* Copyright AppsCode Inc. and Contributors diff --git a/apis/storage/v1alpha1/snapshot_types.go b/apis/storage/v1alpha1/snapshot_types.go index 65ff51ac..fc265765 100644 --- a/apis/storage/v1alpha1/snapshot_types.go +++ b/apis/storage/v1alpha1/snapshot_types.go @@ -207,6 +207,9 @@ type Component struct { VolumeSnapshotterStats []VolumeSnapshotterStats `json:"volumeSnapshotterStats,omitempty"` // WalSegments specifies a list of wall segment for individual component WalSegments []WalSegment `json:"walSegments,omitempty"` + + // SolrStats represents the Solr specific information + SolrStats []SolrStat `json:"solrStats,omitempty"` } // ComponentPhase represents the backup phase of the individual component. @@ -246,6 +249,34 @@ type ResticStats struct { EndTime *metav1.Time `json:"endTime,omitempty"` } +// SolrStat specifies Solr driver related information +type SolrStat struct { + // Collection represents the name of the Solr collection. + Collection string `json:"collection,omitempty"` + + // BackupId represents the Solr snapshot id. + BackupId int `json:"backupId,omitempty"` + + // Location represents the location where the backup exists. + Location string `json:"location,omitempty"` + + // StartTime represents the Solr backup start time. + // +optional + StartTime string `json:"startTime,omitempty"` + + // IndexFileCount represents the number of index files in Solr backup. + // +optional + IndexFileCount int `json:"indexFileCount,omitempty"` + + // IndexFileCount represents the size of index files in Solr backup. + // +optional + IndexSizeMB float64 `json:"indexSizeMB,omitempty"` + + // IndexFileSizeUploaded represents the size uploaded solr index file size in solr backup + // +optional + UploadedIndexFileMB float64 `json:"uploadedIndexFileMB,omitempty"` +} + // VolumeSnapshotterStats specifies the "VolumeSnapshotter" driver specific information type VolumeSnapshotterStats struct { diff --git a/apis/storage/v1alpha1/zz_generated.deepcopy.go b/apis/storage/v1alpha1/zz_generated.deepcopy.go index e48d252b..9f3fd15e 100644 --- a/apis/storage/v1alpha1/zz_generated.deepcopy.go +++ b/apis/storage/v1alpha1/zz_generated.deepcopy.go @@ -1,5 +1,4 @@ //go:build !ignore_autogenerated -// +build !ignore_autogenerated /* Copyright AppsCode Inc. and Contributors @@ -221,6 +220,11 @@ func (in *Component) DeepCopyInto(out *Component) { (*in)[i].DeepCopyInto(&(*out)[i]) } } + if in.SolrStats != nil { + in, out := &in.SolrStats, &out.SolrStats + *out = make([]SolrStat, len(*in)) + copy(*out, *in) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Component. @@ -715,6 +719,21 @@ func (in *SnapshotStatus) DeepCopy() *SnapshotStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SolrStat) DeepCopyInto(out *SolrStat) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SolrStat. +func (in *SolrStat) DeepCopy() *SolrStat { + if in == nil { + return nil + } + out := new(SolrStat) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *SuccessfulSnapshotsKeepPolicy) DeepCopyInto(out *SuccessfulSnapshotsKeepPolicy) { *out = *in diff --git a/apis/types.go b/apis/types.go index f1771ea2..7ea32c65 100644 --- a/apis/types.go +++ b/apis/types.go @@ -24,13 +24,14 @@ import ( ) // Driver specifies the name of underlying tool that is being used to upload the backed up data. -// +kubebuilder:validation:Enum=Restic;WalG;VolumeSnapshotter +// +kubebuilder:validation:Enum=Restic;WalG;VolumeSnapshotter;Solr type Driver string const ( DriverRestic Driver = "Restic" DriverWalG Driver = "WalG" DriverVolumeSnapshotter Driver = "VolumeSnapshotter" + DriverSolr Driver = "Solr" ) // VolumeSource specifies the source of volume to mount in the backup/restore executor diff --git a/apis/zz_generated.deepcopy.go b/apis/zz_generated.deepcopy.go index 6ee74efd..40d4e350 100644 --- a/apis/zz_generated.deepcopy.go +++ b/apis/zz_generated.deepcopy.go @@ -1,5 +1,4 @@ //go:build !ignore_autogenerated -// +build !ignore_autogenerated /* Copyright AppsCode Inc. and Contributors diff --git a/crds/addons.kubestash.com_addons.yaml b/crds/addons.kubestash.com_addons.yaml index 3b54a850..18951e94 100644 --- a/crds/addons.kubestash.com_addons.yaml +++ b/crds/addons.kubestash.com_addons.yaml @@ -43,10 +43,19 @@ spec: - Restic - WalG - VolumeSnapshotter + - Solr - enum: - Restic - WalG - VolumeSnapshotter +<<<<<<< HEAD +======= + - Solr + description: 'Driver specifies the underlying tool that will + be used to upload the data to the backend storage. Valid values + are: - "Restic": The underlying tool is [restic](https://restic.net/). + - "WalG": The underlying tool is [wal-g](https://github.com/wal-g/wal-g).' +>>>>>>> 7c1f76d9 (Add solr sanpshot api) type: string executor: enum: @@ -1036,10 +1045,19 @@ spec: - Restic - WalG - VolumeSnapshotter + - Solr - enum: - Restic - WalG - VolumeSnapshotter +<<<<<<< HEAD +======= + - Solr + description: 'Driver specifies the underlying tool that will + be used to upload the data to the backend storage. Valid values + are: - "Restic": The underlying tool is [restic](https://restic.net/). + - "WalG": The underlying tool is [wal-g](https://github.com/wal-g/wal-g).' +>>>>>>> 7c1f76d9 (Add solr sanpshot api) type: string executor: enum: diff --git a/crds/storage.kubestash.com_snapshots.yaml b/crds/storage.kubestash.com_snapshots.yaml index 1658b021..e3d75b1d 100644 --- a/crds/storage.kubestash.com_snapshots.yaml +++ b/crds/storage.kubestash.com_snapshots.yaml @@ -92,6 +92,7 @@ spec: - Restic - WalG - VolumeSnapshotter + - Solr type: string duration: type: string @@ -129,6 +130,42 @@ spec: type: array size: type: string + solrStats: + description: SolrStats represents the Solr specific information + items: + description: SolrStat specifies Solr driver related information + properties: + backupId: + description: BackupId represents the Solr snapshot id. + type: integer + collection: + description: Collection represents the name of the Solr + collection. + type: string + indexFileCount: + description: IndexFileCount represents the number of index + files in Solr backup. + type: integer + indexSizeMB: + description: IndexFileCount represents the size of index + files in Solr backup. + format: double + type: number + location: + description: Location represents the location where the + backup exists. + type: string + startTime: + description: StartTime represents the Solr backup start + time. + type: string + uploadedIndexFileMB: + description: IndexFileSizeUploaded represents the size + uploaded solr index file size in solr backup + format: double + type: number + type: object + type: array volumeSnapshotterStats: items: properties: From a2e0b009cbc0aa87e928b88e3f3f9a11dce9eb15 Mon Sep 17 00:00:00 2001 From: pritamdas99 Date: Thu, 5 Dec 2024 10:46:14 +0600 Subject: [PATCH 2/2] Add solr sanpshot api Signed-off-by: pritamdas99 --- crds/addons.kubestash.com_addons.yaml | 14 -------------- crds/core.kubestash.com_restoresessions.yaml | 13 ------------- crds/storage.kubestash.com_snapshots.yaml | 15 --------------- 3 files changed, 42 deletions(-) diff --git a/crds/addons.kubestash.com_addons.yaml b/crds/addons.kubestash.com_addons.yaml index 18951e94..45550dce 100644 --- a/crds/addons.kubestash.com_addons.yaml +++ b/crds/addons.kubestash.com_addons.yaml @@ -48,14 +48,7 @@ spec: - Restic - WalG - VolumeSnapshotter -<<<<<<< HEAD -======= - Solr - description: 'Driver specifies the underlying tool that will - be used to upload the data to the backend storage. Valid values - are: - "Restic": The underlying tool is [restic](https://restic.net/). - - "WalG": The underlying tool is [wal-g](https://github.com/wal-g/wal-g).' ->>>>>>> 7c1f76d9 (Add solr sanpshot api) type: string executor: enum: @@ -1050,14 +1043,7 @@ spec: - Restic - WalG - VolumeSnapshotter -<<<<<<< HEAD -======= - Solr - description: 'Driver specifies the underlying tool that will - be used to upload the data to the backend storage. Valid values - are: - "Restic": The underlying tool is [restic](https://restic.net/). - - "WalG": The underlying tool is [wal-g](https://github.com/wal-g/wal-g).' ->>>>>>> 7c1f76d9 (Add solr sanpshot api) type: string executor: enum: diff --git a/crds/core.kubestash.com_restoresessions.yaml b/crds/core.kubestash.com_restoresessions.yaml index 9676ba8a..7e9e34ec 100644 --- a/crds/core.kubestash.com_restoresessions.yaml +++ b/crds/core.kubestash.com_restoresessions.yaml @@ -9450,19 +9450,6 @@ spec: type: boolean dbName: type: string - internalAuthIssuerRef: - properties: - apiGroup: - type: string - kind: - type: string - name: - type: string - required: - - kind - - name - type: object - x-kubernetes-map-type: atomic restoreNamespace: type: string tlsIssuerRef: diff --git a/crds/storage.kubestash.com_snapshots.yaml b/crds/storage.kubestash.com_snapshots.yaml index e3d75b1d..a84eb4a3 100644 --- a/crds/storage.kubestash.com_snapshots.yaml +++ b/crds/storage.kubestash.com_snapshots.yaml @@ -131,37 +131,22 @@ spec: size: type: string solrStats: - description: SolrStats represents the Solr specific information items: - description: SolrStat specifies Solr driver related information properties: backupId: - description: BackupId represents the Solr snapshot id. type: integer collection: - description: Collection represents the name of the Solr - collection. type: string indexFileCount: - description: IndexFileCount represents the number of index - files in Solr backup. type: integer indexSizeMB: - description: IndexFileCount represents the size of index - files in Solr backup. format: double type: number location: - description: Location represents the location where the - backup exists. type: string startTime: - description: StartTime represents the Solr backup start - time. type: string uploadedIndexFileMB: - description: IndexFileSizeUploaded represents the size - uploaded solr index file size in solr backup format: double type: number type: object