Skip to content

Commit 36d8309

Browse files
committed
Correct the version for the backup encryption feature
1 parent f1324b1 commit 36d8309

File tree

3 files changed

+24
-22
lines changed

3 files changed

+24
-22
lines changed

e2e/fixtures/fdb_backup.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ func (fdbBackup *FdbBackup) WaitForRestorableVersion(version uint64) uint64 {
275275
g.Expect(status.LatestRestorablePoint).NotTo(gomega.BeNil())
276276

277277
return ptr.Deref(status.LatestRestorablePoint.Version, 0)
278-
}).WithTimeout(10*time.Minute).WithPolling(2*time.Second).Should(gomega.BeNumerically(">", version), "error waiting for restorable version")
278+
}).WithTimeout(10*time.Minute).WithPolling(2*time.Second).Should(gomega.BeNumerically(">=", version), "error waiting for restorable version")
279279
return restorableVersion
280280
}
281281

e2e/fixtures/fdb_operator_client.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -400,8 +400,8 @@ spec:
400400
- name: fdb-binaries
401401
mountPath: /var/output-files
402402
securityContext:
403-
runAsUser: 0
404-
runAsGroup: 0
403+
runAsUser: 4059
404+
runAsGroup: 4059
405405
{{ end }}
406406
containers:
407407
- command:

e2e/test_operator_backups/operator_backup_test.go

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,10 @@ import (
3636
)
3737

3838
var (
39-
factory *fixtures.Factory
40-
fdbCluster *fixtures.FdbCluster
41-
testOptions *fixtures.FactoryOptions
39+
factory *fixtures.Factory
40+
fdbCluster *fixtures.FdbCluster
41+
testOptions *fixtures.FactoryOptions
42+
supportsEncryption fdbv1beta2.Version
4243
)
4344

4445
func init() {
@@ -62,6 +63,9 @@ var _ = BeforeSuite(func() {
6263
Skip("Skip backup tests with 7.1.63 as this version has a bug in the fdbbackup agent")
6364
}
6465

66+
supportsEncryption, err = fdbv1beta2.ParseFdbVersion("7.4.6")
67+
Expect(err).NotTo(HaveOccurred())
68+
6569
// Create a blobstore for testing backups and restore.
6670
factory.CreateBlobstoreIfAbsent(factory.SingleNamespace())
6771
})
@@ -126,9 +130,10 @@ var _ = Describe("Operator Backup", Label("e2e", "pr"), func() {
126130
// In case of the one time backup we have to first write the keys and then do the backup.
127131
keyValues = fdbCluster.GenerateRandomValues(10, prefix)
128132
fdbCluster.WriteKeyValues(keyValues)
133+
currentVersion := fdbCluster.GetClusterVersion()
129134
backup = factory.CreateBackupForCluster(fdbCluster, backupConfiguration)
130135
restorableVersion = backup.WaitForRestorableVersion(
131-
fdbCluster.GetClusterVersion(),
136+
currentVersion,
132137
)
133138
}
134139

@@ -157,22 +162,23 @@ var _ = Describe("Operator Backup", Label("e2e", "pr"), func() {
157162

158163
When("encryption is enabled", func() {
159164
BeforeEach(func() {
160-
requiredFdbVersion, err := fdbv1beta2.ParseFdbVersion("7.4.5")
161-
Expect(err).NotTo(HaveOccurred())
162-
163-
version := factory.GetFDBVersion()
164-
if !version.IsAtLeast(requiredFdbVersion) {
165+
if !factory.GetFDBVersion().IsAtLeast(supportsEncryption) {
165166
Skip(
166-
"version has a bug in the backup version that prevents tests to succeed",
167+
"version doesn't support the encryption feature",
167168
)
168169
}
169170

170171
backupConfiguration.EncryptionEnabled = true
171172
})
172173

173-
It("should restore the cluster successfully with a restorable version", func() {
174-
Expect(fdbCluster.GetRange([]byte{prefix}, 25, 60)).Should(Equal(keyValues))
175-
})
174+
It(
175+
"should restore the cluster successfully with a restorable version",
176+
func() {
177+
Expect(
178+
fdbCluster.GetRange([]byte{prefix}, 25, 60),
179+
).Should(Equal(keyValues))
180+
},
181+
)
176182
})
177183

178184
// TODO (johscheuer): Enable test once the CRD in CI is updated.
@@ -203,13 +209,9 @@ var _ = Describe("Operator Backup", Label("e2e", "pr"), func() {
203209

204210
When("encryption is enabled", func() {
205211
BeforeEach(func() {
206-
requiredFdbVersion, err := fdbv1beta2.ParseFdbVersion("7.4.5")
207-
Expect(err).NotTo(HaveOccurred())
208-
209-
version := factory.GetFDBVersion()
210-
if !version.IsAtLeast(requiredFdbVersion) {
212+
if !factory.GetFDBVersion().IsAtLeast(supportsEncryption) {
211213
Skip(
212-
"version has a bug in the backup version that prevents tests to succeed",
214+
"version doesn't support the encryption feature",
213215
)
214216
}
215217

0 commit comments

Comments
 (0)