@@ -132,9 +132,11 @@ var _ = SIGDescribe("DisruptionController", func() {
132
132
133
133
ginkgo .By ("Patching PodDisruptionBudget status" )
134
134
patched , _ := patchPDBOrDie (cs , dc , ns , defaultName , func (old * policyv1beta1.PodDisruptionBudget ) (bytes []byte , err error ) {
135
- oldBytes , _ := json .Marshal (old )
135
+ oldBytes , err := json .Marshal (old )
136
+ framework .ExpectNoError (err , "failed to marshal JSON for old data" )
136
137
old .Status .DisruptedPods = make (map [string ]metav1.Time )
137
- newBytes , _ := json .Marshal (old )
138
+ newBytes , err := json .Marshal (old )
139
+ framework .ExpectNoError (err , "failed to marshal JSON for new data" )
138
140
return jsonpatch .CreateMergePatch (oldBytes , newBytes )
139
141
}, "status" )
140
142
framework .ExpectEmpty (patched .Status .DisruptedPods , "Expecting the PodDisruptionBudget's be empty" )
@@ -303,10 +305,12 @@ var _ = SIGDescribe("DisruptionController", func() {
303
305
ginkgo .By ("Patching the pdb to disallow a pod to be evicted" )
304
306
patchPDBOrDie (cs , dc , ns , defaultName , func (old * policyv1beta1.PodDisruptionBudget ) (bytes []byte , err error ) {
305
307
oldData , err := json .Marshal (old )
308
+ framework .ExpectNoError (err , "failed to marshal JSON for old data" )
306
309
old .Spec .MinAvailable = nil
307
310
maxUnavailable := intstr .FromInt (0 )
308
311
old .Spec .MaxUnavailable = & maxUnavailable
309
- newData , _ := json .Marshal (old )
312
+ newData , err := json .Marshal (old )
313
+ framework .ExpectNoError (err , "failed to marshal JSON for new data" )
310
314
return jsonpatch .CreateMergePatch (oldData , newData )
311
315
})
312
316
0 commit comments