diff --git a/controllers/dynamicenv_controller.go b/controllers/dynamicenv_controller.go index 3b1dcdb..3a0fc64 100644 --- a/controllers/dynamicenv_controller.go +++ b/controllers/dynamicenv_controller.go @@ -423,16 +423,6 @@ func (r *DynamicEnvReconciler) addFinalizersIfRequired(ctx context.Context, de * return nil } -func (r *DynamicEnvReconciler) deleteFinalizer(ctx context.Context, finalizer string, de *riskifiedv1alpha1.DynamicEnv) error { - log.Info("Deleting finalizer from dynamic env", "finalizer", finalizer) - remainingFinalizers := helpers.RemoveItemFromStringSlice(finalizer, de.Finalizers) - de.Finalizers = remainingFinalizers - if err := r.Update(ctx, de); err != nil { - return fmt.Errorf("error removing %s finalizer: %w", finalizer, err) - } - return nil -} - // SetupWithManager sets up the controller with the Manager. func (r *DynamicEnvReconciler) SetupWithManager(mgr ctrl.Manager) error { return ctrl.NewControllerManagedBy(mgr). diff --git a/pkg/handlers/deployment_handler_test.go b/pkg/handlers/deployment_handler_test.go index 5fae873..d8337b6 100644 --- a/pkg/handlers/deployment_handler_test.go +++ b/pkg/handlers/deployment_handler_test.go @@ -85,7 +85,7 @@ var _ = Describe("DeploymentHandler", func() { } handler := mkDeploymentHandler("unique", "my-namespace", mc) expected := mkExpected(handler, riskifiedv1alpha1.Missing) - result, _ := handler.GetStatus(nil) + result, _ := handler.GetStatus(context.Background()) Expect(result).To(Equal(expected)) }) @@ -108,7 +108,7 @@ var _ = Describe("DeploymentHandler", func() { } handler := mkDeploymentHandler("unique", "my-namespace", mc) expected := mkExpected(handler, riskifiedv1alpha1.Running) - result, _ := handler.GetStatus(nil) + result, _ := handler.GetStatus(context.Background()) Expect(result).To(Equal(expected)) }) @@ -127,7 +127,7 @@ var _ = Describe("DeploymentHandler", func() { } handler := mkDeploymentHandler("unique", "my-namespace", mc) expected := mkExpected(handler, riskifiedv1alpha1.Initializing) - result, _ := handler.GetStatus(nil) + result, _ := handler.GetStatus(context.Background()) Expect(result).To(Equal(expected)) }) }) @@ -155,7 +155,7 @@ var _ = Describe("DeploymentHandler", func() { } handler := mkDeploymentHandler("unavailable1", "my-namespace", mc) expected := mkExpected(handler, riskifiedv1alpha1.Initializing) - result, _ := handler.GetStatus(nil) + result, _ := handler.GetStatus(context.Background()) Expect(result).To(Equal(expected)) }) @@ -173,7 +173,7 @@ var _ = Describe("DeploymentHandler", func() { } handler := mkDeploymentHandler("unique", "my-namespace", mc) expected := mkExpected(handler, riskifiedv1alpha1.Failed) - result, _ := handler.GetStatus(nil) + result, _ := handler.GetStatus(context.Background()) Expect(result).To(Equal(expected)) }) @@ -206,7 +206,7 @@ var _ = Describe("DeploymentHandler", func() { handler.SubsetName = fmt.Sprintf("%s/%s", de.Spec.Subsets[0].Namespace, de.Spec.Subsets[0].Name) subset := de.Spec.Subsets[0].DeepCopy() handler.Subset = *subset - errorResult := handler.UpdateIfRequired(nil) + errorResult := handler.UpdateIfRequired(context.Background()) Expect(errorResult).To(BeNil()) Expect(handler.Updating).To(BeFalse()) }) diff --git a/pkg/handlers/destinationrule_handler_private_test.go b/pkg/handlers/destinationrule_handler_private_test.go index 7347662..d9533f3 100644 --- a/pkg/handlers/destinationrule_handler_private_test.go +++ b/pkg/handlers/destinationrule_handler_private_test.go @@ -72,7 +72,7 @@ var _ = Describe("Accepting alternative version label and version", func() { Owner: types.NamespacedName{}, Log: logr.Logger{}, } - dr, err := h.generateOverridingDestinationRule(nil, serviceName) + dr, err := h.generateOverridingDestinationRule(context.Background(), serviceName) Expect(err).To(BeNil()) Expect(dr).NotTo(BeNil()) }) diff --git a/pkg/handlers/virtualservice_handler_private_test.go b/pkg/handlers/virtualservice_handler_private_test.go index 00d3917..3d4cf59 100644 --- a/pkg/handlers/virtualservice_handler_private_test.go +++ b/pkg/handlers/virtualservice_handler_private_test.go @@ -289,7 +289,7 @@ var _ = Describe("VirtualServiceHandler", func() { Status: riskifiedv1alpha1.IgnoredMissingVS, }, } - result, err := handler.GetStatus(nil) + result, err := handler.GetStatus(context.Background()) Expect(err).To(BeNil()) Expect(result).To(Equal(expected)) }) @@ -338,7 +338,7 @@ var _ = Describe("VirtualServiceHandler", func() { Status: riskifiedv1alpha1.Running, }, } - result, err := handler.GetStatus(nil) + result, err := handler.GetStatus(context.Background()) Expect(err).To(BeNil()) Expect(result).To(Equal(expected)) })