@@ -131,7 +131,7 @@ var _ = SIGDescribe("DisruptionController", func() {
131
131
framework .ExpectHaveKey (updated .Status .DisruptedPods , pod .Name , "Expecting the DisruptedPods have %s" , pod .Name )
132
132
133
133
ginkgo .By ("Patching PodDisruptionBudget status" )
134
- patched , _ := patchPDBOrDie (cs , dc , ns , defaultName , func (old * policyv1beta1.PodDisruptionBudget ) (bytes []byte , err error ) {
134
+ patched := patchPDBOrDie (cs , dc , ns , defaultName , func (old * policyv1beta1.PodDisruptionBudget ) (bytes []byte , err error ) {
135
135
oldBytes , err := json .Marshal (old )
136
136
framework .ExpectNoError (err , "failed to marshal JSON for old data" )
137
137
old .Status .DisruptedPods = make (map [string ]metav1.Time )
@@ -374,8 +374,8 @@ type updateFunc func(pdb *policyv1beta1.PodDisruptionBudget) *policyv1beta1.PodD
374
374
type updateRestAPI func (ctx context.Context , podDisruptionBudget * policyv1beta1.PodDisruptionBudget , opts metav1.UpdateOptions ) (* policyv1beta1.PodDisruptionBudget , error )
375
375
type patchFunc func (pdb * policyv1beta1.PodDisruptionBudget ) ([]byte , error )
376
376
377
- func updatePDBOrDie (cs kubernetes.Interface , ns string , name string , f updateFunc , api updateRestAPI ) (updated * policyv1beta1.PodDisruptionBudget , err error ) {
378
- err = retry .RetryOnConflict (retry .DefaultRetry , func () error {
377
+ func updatePDBOrDie (cs kubernetes.Interface , ns string , name string , f updateFunc , api updateRestAPI ) (updated * policyv1beta1.PodDisruptionBudget ) {
378
+ err : = retry .RetryOnConflict (retry .DefaultRetry , func () error {
379
379
old , err := cs .PolicyV1beta1 ().PodDisruptionBudgets (ns ).Get (context .TODO (), name , metav1.GetOptions {})
380
380
if err != nil {
381
381
return err
@@ -389,11 +389,11 @@ func updatePDBOrDie(cs kubernetes.Interface, ns string, name string, f updateFun
389
389
390
390
framework .ExpectNoError (err , "Waiting for the PDB update to be processed in namespace %s" , ns )
391
391
waitForPdbToBeProcessed (cs , ns , name )
392
- return updated , err
392
+ return updated
393
393
}
394
394
395
- func patchPDBOrDie (cs kubernetes.Interface , dc dynamic.Interface , ns string , name string , f patchFunc , subresources ... string ) (updated * policyv1beta1.PodDisruptionBudget , err error ) {
396
- err = retry .RetryOnConflict (retry .DefaultRetry , func () error {
395
+ func patchPDBOrDie (cs kubernetes.Interface , dc dynamic.Interface , ns string , name string , f patchFunc , subresources ... string ) (updated * policyv1beta1.PodDisruptionBudget ) {
396
+ err : = retry .RetryOnConflict (retry .DefaultRetry , func () error {
397
397
old := getPDBStatusOrDie (dc , ns , name )
398
398
patchBytes , err := f (old )
399
399
if updated , err = cs .PolicyV1beta1 ().PodDisruptionBudgets (ns ).Patch (context .TODO (), old .Name , types .MergePatchType , patchBytes , metav1.PatchOptions {}, subresources ... ); err != nil {
@@ -404,7 +404,7 @@ func patchPDBOrDie(cs kubernetes.Interface, dc dynamic.Interface, ns string, nam
404
404
405
405
framework .ExpectNoError (err , "Waiting for the pdb update to be processed in namespace %s" , ns )
406
406
waitForPdbToBeProcessed (cs , ns , name )
407
- return updated , err
407
+ return updated
408
408
}
409
409
410
410
func deletePDBOrDie (cs kubernetes.Interface , ns string , name string ) {
0 commit comments