Skip to content

Commit 4d88408

Browse files
Bump ABS version SHA to fix restore validation issue
1 parent 95d4830 commit 4d88408

File tree

4 files changed

+37
-15
lines changed

4 files changed

+37
-15
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module github.com/aerospike/aerospike-kubernetes-operator/v4
33
go 1.23.11
44

55
require (
6-
github.com/aerospike/aerospike-backup-service/v3 v3.4.0
6+
github.com/aerospike/aerospike-backup-service/v3 v3.4.1-0.20251113113955-5523ec8870b1
77
github.com/aerospike/aerospike-client-go/v8 v8.4.0
88
github.com/aerospike/aerospike-management-lib v1.8.1-0.20251029081729-d5f8b09e1080
99
github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ cel.dev/expr v0.24.0 h1:56OvJKSH3hDGL0ml5uSxZmz3/3Pq4tJ+fb1unVLAFcY=
22
cel.dev/expr v0.24.0/go.mod h1:hLPLo1W4QUmuYdA72RBX06QTs6MXw941piREPl3Yfiw=
33
github.com/KyleBanks/depth v1.2.1 h1:5h8fQADFrWtarTdtDudMmGsC7GPbOAu6RVB3ffsVFHc=
44
github.com/KyleBanks/depth v1.2.1/go.mod h1:jzSb9d0L43HxTQfT+oSA1EEp2q+ne2uh6XgeJcm8brE=
5-
github.com/aerospike/aerospike-backup-service/v3 v3.4.0 h1:9h24Zc7erQnG/de7+ISBbt+k9Ddp+7YOgDAsI8FgfH4=
6-
github.com/aerospike/aerospike-backup-service/v3 v3.4.0/go.mod h1:O96iFIRIgxZsp2J0LW/aT68Cxro+SkyRBmiYDgvJOOI=
5+
github.com/aerospike/aerospike-backup-service/v3 v3.4.1-0.20251113113955-5523ec8870b1 h1:BgwbeMCy6hfosvtG19rEwk3N2DohzxKiej6r98X0Ndc=
6+
github.com/aerospike/aerospike-backup-service/v3 v3.4.1-0.20251113113955-5523ec8870b1/go.mod h1:O96iFIRIgxZsp2J0LW/aT68Cxro+SkyRBmiYDgvJOOI=
77
github.com/aerospike/aerospike-client-go/v8 v8.4.0 h1:bcFaOMIT09DnWPiXjepHQ7sgZNraqojQBuzEaZnW00I=
88
github.com/aerospike/aerospike-client-go/v8 v8.4.0/go.mod h1:t1LXZ3QVi4B4lR9qEkyei1eMbuohBJBGs1YY5b5fYEI=
99
github.com/aerospike/aerospike-management-lib v1.8.1-0.20251029081729-d5f8b09e1080 h1:9KqMRrlFJ3hx1BuKqhWWedr3ZMYWxaEX9G1Dq1JxZhE=

test/restore/restore_test.go

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -179,26 +179,27 @@ var _ = Describe(
179179

180180
err = validateRestoredData(k8sClient)
181181
Expect(err).ToNot(HaveOccurred())
182-
183182
},
184183
)
185184

186185
It(
187186
"Should complete restore for Timestamp restore type", func() {
188-
restoreConfig := getRestoreConfigInMap(backupDataPath)
189-
delete(restoreConfig, asdbv1beta1.SourceKey)
190-
delete(restoreConfig, asdbv1beta1.BackupDataPathKey)
187+
configBytes, err := getTimeStampRestoreConfigBytes(getRestoreConfigInMap(backupDataPath))
188+
Expect(err).ToNot(HaveOccurred())
189+
190+
restore = newRestoreWithConfig(restoreNsNm, asdbv1beta1.Timestamp, configBytes)
191191

192-
parts := strings.Split(backupDataPath, "/")
193-
time := parts[len(parts)-3]
194-
timeInt, err := strconv.Atoi(time)
192+
err = createRestore(k8sClient, restore)
195193
Expect(err).ToNot(HaveOccurred())
196194

197-
// increase time by 1 millisecond to consider the latest backup under time bound
198-
restoreConfig[asdbv1beta1.TimeKey] = int64(timeInt) + 1
199-
restoreConfig[asdbv1beta1.RoutineKey] = parts[len(parts)-5]
195+
err = validateRestoredData(k8sClient)
196+
Expect(err).ToNot(HaveOccurred())
197+
},
198+
)
200199

201-
configBytes, err := json.Marshal(restoreConfig)
200+
It(
201+
"Should complete restore for Timestamp restore type and with TLS configured", func() {
202+
configBytes, err := getTimeStampRestoreConfigBytes(getRestoreConfigWithTLSInMap(backupDataPath))
202203
Expect(err).ToNot(HaveOccurred())
203204

204205
restore = newRestoreWithConfig(restoreNsNm, asdbv1beta1.Timestamp, configBytes)
@@ -208,8 +209,23 @@ var _ = Describe(
208209

209210
err = validateRestoredData(k8sClient)
210211
Expect(err).ToNot(HaveOccurred())
211-
212212
},
213213
)
214214
})
215215
})
216+
217+
func getTimeStampRestoreConfigBytes(restoreConfig map[string]interface{}) (configBytes []byte, err error) {
218+
delete(restoreConfig, asdbv1beta1.SourceKey)
219+
delete(restoreConfig, asdbv1beta1.BackupDataPathKey)
220+
221+
parts := strings.Split(backupDataPath, "/")
222+
time := parts[len(parts)-3]
223+
timeInt, err := strconv.Atoi(time)
224+
Expect(err).ToNot(HaveOccurred())
225+
226+
// increase time by 1 millisecond to consider the latest backup under time bound
227+
restoreConfig[asdbv1beta1.TimeKey] = int64(timeInt) + 1
228+
restoreConfig[asdbv1beta1.RoutineKey] = parts[len(parts)-5]
229+
230+
return getRestoreConfBytes(restoreConfig)
231+
}

test/restore/test_utils.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,8 @@ func waitForRestore(cl client.Client, restore *asdbv1beta1.AerospikeRestore,
189189
return fmt.Errorf("restore result is not set")
190190
}
191191

192+
pkgLog.Info(fmt.Sprintf("Restore result %s", string(restore.Status.RestoreResult.Raw)))
193+
192194
var restoreResult dto.RestoreJobStatus
193195

194196
if err := json.Unmarshal(restore.Status.RestoreResult.Raw, &restoreResult); err != nil {
@@ -199,6 +201,10 @@ func waitForRestore(cl client.Client, restore *asdbv1beta1.AerospikeRestore,
199201
return fmt.Errorf("restore job status is not done")
200202
}
201203

204+
if restoreResult.InsertedRecords == 0 {
205+
return fmt.Errorf("no records were restored")
206+
}
207+
202208
if restoreResult.Error != "" {
203209
return fmt.Errorf("restore job failed with error: %s", restoreResult.Error)
204210
}

0 commit comments

Comments
 (0)