Skip to content

Commit

Permalink
Always recover from panic
Browse files Browse the repository at this point in the history
  • Loading branch information
ppalucki committed Jul 11, 2024
1 parent ad70031 commit 3217948
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions cmd/gardener-extension-cri-resmgr/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,11 @@ import (
"context"
"fmt"

controllerconfig "sigs.k8s.io/controller-runtime/pkg/config"

// Local

"github.com/intel/gardener-extension-cri-resmgr/pkg/controller/healthcheck"
"github.com/intel/gardener-extension-cri-resmgr/pkg/controller/lifecycle"
"github.com/intel/gardener-extension-cri-resmgr/pkg/options"
"k8s.io/utils/ptr"

// Gardener
extensionscontroller "github.com/gardener/gardener/extensions/pkg/controller"
Expand Down Expand Up @@ -53,7 +50,7 @@ func NewExtensionControllerCommand(ctx context.Context) *cobra.Command {
}
mgroptions := options.MgrOpts.Completed().Options()
// For debugging purposes, do not recover from panics from Reconciller
mgroptions.Controller = controllerconfig.Controller{RecoverPanic: ptr.To(false)}
//mgroptions.Controller = controllerconfig.Controller{RecoverPanic: ptr.To(false)}
mgr, err := manager.New(options.RestOptions.Completed().Config, mgroptions)
if err != nil {
return fmt.Errorf("could not instantiate controller-manager: %s", err)
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/lifecycle/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ func AddConfigMapWatchingControllerToManager(ctx context.Context, mgr manager.Ma
FinalizerSuffix: consts.ExtensionType, // We're using the same finalizer as the original controller on purpose to "delete" only once without a need to wait for another "configs" controller
}
controllerOptions.Reconciler = extension.NewReconciler(mgr, configReconcilerArgs)
recoverPanic := false // TODO: make it configurable for debugging purposes !!?!?
recoverPanic := true // TODO: make it configurable for debugging purposes !!?!?
controllerOptions.RecoverPanic = &recoverPanic

controllerName := consts.ControllerName + consts.ConfigsSuffix
Expand Down

0 comments on commit 3217948

Please sign in to comment.