Add timeout context for controllers (#1990)

This commit is contained in:
Somefive
2021-08-02 19:31:00 +08:00
committed by GitHub
parent d9cd048d79
commit 7a1f95773d
17 changed files with 83 additions and 46 deletions

View File

@@ -22,6 +22,7 @@ import (
"reflect"
"github.com/oam-dev/kubevela/apis/core.oam.dev/condition"
common2 "github.com/oam-dev/kubevela/pkg/controller/common"
controller "github.com/oam-dev/kubevela/pkg/controller/core.oam.dev"
@@ -77,7 +78,8 @@ type Reconciler struct {
// +kubebuilder:rbac:groups=apps,resources=deployments,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=,resources=services,verbs=get;list;watch;create;update;patch;delete
func (r *Reconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) {
ctx := context.Background()
ctx, cancel := common2.NewReconcileContext()
defer cancel()
log := r.log.WithValues("podspecworkload", req.NamespacedName)
log.Info("Reconcile podspecworkload workload")