fix controller Start method signature

Signed-off-by: Roland.Ma <rolandma@yunify.com>
This commit is contained in:
Roland.Ma
2021-08-11 09:05:53 +00:00
parent 810bfb618a
commit 2fcfb81066
39 changed files with 106 additions and 120 deletions

View File

@@ -89,7 +89,7 @@ func (r *Reconciler) SetupWithManager(mgr ctrl.Manager) error {
// +kubebuilder:rbac:groups=iam.kubesphere.io,resources=workspacerolebindings,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=types.kubefed.io,resources=federatedworkspacerolebindings,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=tenant.kubesphere.io,resources=workspaces,verbs=get;list;watch;
func (r *Reconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) {
func (r *Reconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
logger := r.Logger.WithValues("workspacetemplate", req.NamespacedName)
rootCtx := context.Background()
workspaceTemplate := &tenantv1alpha2.WorkspaceTemplate{}

View File

@@ -86,7 +86,7 @@ var _ = Describe("WorkspaceTemplate", func() {
req := ctrl.Request{
NamespacedName: key,
}
_, err := reconciler.Reconcile(req)
_, err := reconciler.Reconcile(context.Background(), req)
Expect(err).To(BeNil())
By("Expecting to create workspace template successfully")
@@ -117,7 +117,7 @@ var _ = Describe("WorkspaceTemplate", func() {
updated.Spec.Template.Spec.Manager = "admin"
Expect(reconciler.Update(context.Background(), updated)).Should(Succeed())
_, err = reconciler.Reconcile(req)
_, err = reconciler.Reconcile(context.Background(), req)
Expect(err).To(BeNil())
// List workspace role bindings
@@ -138,7 +138,7 @@ var _ = Describe("WorkspaceTemplate", func() {
return reconciler.Update(context.Background(), f)
}, timeout, interval).Should(Succeed())
_, err = reconciler.Reconcile(req)
_, err = reconciler.Reconcile(context.Background(), req)
Expect(err).To(BeNil())
})
}