Skip to content

Commit 1625968

Browse files
committed
removing gjson
1 parent 55f433a commit 1625968

File tree

3 files changed

+14
-16
lines changed

3 files changed

+14
-16
lines changed

e2e/test_operator_backups/operator_backup_test.go

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ This test suite contains tests related to backup and restore with the operator.
2525
*/
2626

2727
import (
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() {

go.mod

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ require (
3838
github.com/pkg/errors v0.9.1
3939
github.com/prometheus/client_model v0.6.2
4040
github.com/robfig/cron/v3 v3.0.1
41-
github.com/tidwall/gjson v1.18.0
4241
)
4342

4443
require (
@@ -95,8 +94,6 @@ require (
9594
github.com/spf13/afero v1.12.0 // indirect
9695
github.com/spf13/cast v1.7.1 // indirect
9796
github.com/subosito/gotenv v1.6.0 // indirect
98-
github.com/tidwall/match v1.1.1 // indirect
99-
github.com/tidwall/pretty v1.2.0 // indirect
10097
github.com/x448/float16 v0.8.4 // indirect
10198
github.com/xlab/treeprint v1.2.0 // indirect
10299
go.uber.org/automaxprocs v1.6.0 // indirect

go.sum

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -195,12 +195,6 @@ github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOf
195195
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
196196
github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8=
197197
github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=
198-
github.com/tidwall/gjson v1.18.0 h1:FIDeeyB800efLX89e5a8Y0BNH+LOngJyGrIWxG2FKQY=
199-
github.com/tidwall/gjson v1.18.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
200-
github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA=
201-
github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM=
202-
github.com/tidwall/pretty v1.2.0 h1:RWIZEg2iJ8/g6fDDYzMpobmaoGh5OLl4AXtGUGPcqCs=
203-
github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU=
204198
github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM=
205199
github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg=
206200
github.com/xlab/treeprint v1.2.0 h1:HzHnuAF1plUN2zGlAFHbSQP2qJ0ZAD3XF5XD7OesXRQ=

0 commit comments

Comments
 (0)