@@ -25,14 +25,14 @@ This test suite contains tests related to backup and restore with the operator.
2525*/
2626
2727import (
28+ "encoding/json"
2829 "fmt"
2930 "log"
3031
3132 fdbv1beta2 "github.com/FoundationDB/fdb-kubernetes-operator/v2/api/v1beta2"
3233 "github.com/FoundationDB/fdb-kubernetes-operator/v2/e2e/fixtures"
3334 . "github.com/onsi/ginkgo/v2"
3435 . "github.com/onsi/gomega"
35- "github.com/tidwall/gjson"
3636 corev1 "k8s.io/api/core/v1"
3737 "k8s.io/utils/ptr"
3838)
@@ -150,7 +150,8 @@ func describeBackupMode(backupMode fdbv1beta2.BackupMode) {
150150
151151 When ("encryption is enabled" , func () {
152152 JustBeforeEach (func () {
153- if ! factory .GetFDBVersion ().IsAtLeast (fdbv1beta2 .Versions .SupportsBackupEncryption ) {
153+ if ! factory .GetFDBVersion ().
154+ IsAtLeast (fdbv1beta2 .Versions .SupportsBackupEncryption ) {
154155 Skip ("version doesn't support the encryption feature" )
155156 }
156157 performBackupSetup (true , false )
@@ -166,14 +167,20 @@ func describeBackupMode(backupMode fdbv1beta2.BackupMode) {
166167 // TODO (09harsh): Enable this test when we have the fileLevelEncryption in json parser
167168 // here: https://github.com/apple/foundationdb/blob/main/fdbclient/BackupContainer.actor.cpp#L193-L250
168169 PIt ("should have file level encryption enabled" , func () {
169- fileLevelEncryption := gjson .Get (describeOutput , "FileLevelEncryption" ).Bool ()
170+ var describeData map [string ]interface {}
171+ err := json .Unmarshal ([]byte (describeOutput ), & describeData )
172+ Expect (err ).NotTo (HaveOccurred ())
173+ fileLevelEncryption := describeData ["FileLevelEncryption" ].(bool )
170174 Expect (fileLevelEncryption ).To (BeTrue ())
171175 })
172176
173- It ("should be able to restore the cluster successfully with a restorable version" , func () {
174- restore = factory .CreateRestoreForCluster (backup , currentRestorableVersion )
175- Expect (fdbCluster .GetRange ([]byte {prefix }, 25 , 60 )).Should (Equal (keyValues ))
176- })
177+ It (
178+ "should be able to restore the cluster successfully with a restorable version" ,
179+ func () {
180+ restore = factory .CreateRestoreForCluster (backup , currentRestorableVersion )
181+ Expect (fdbCluster .GetRange ([]byte {prefix }, 25 , 60 )).Should (Equal (keyValues ))
182+ },
183+ )
177184 })
178185
179186 It ("should restore the cluster successfully with a restorable version" , func () {
0 commit comments