Skip to content

Commit

Permalink
fadadfaf
Browse files Browse the repository at this point in the history
Signed-off-by: duanmengkk <[email protected]>
  • Loading branch information
duanmengkk committed Dec 22, 2023
1 parent fa0f6ef commit 73369ba
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@ type AutoCreateMCSController struct {
ReservedNamespaces []string
}

func (c *AutoCreateMCSController) Reconcile(_ context.Context, request reconcile.Request) (reconcile.Result, error) {
func (c *AutoCreateMCSController) Reconcile(ctx context.Context, request reconcile.Request) (reconcile.Result, error) {
klog.V(4).Infof("============ %s starts to reconcile %s ============", AutoCreateMCSControllerName, request.NamespacedName.String())
defer func() {
klog.V(4).Infof("============ %s has been reconciled =============", request.NamespacedName.String())
}()

var shouldDelete bool
service := &corev1.Service{}
if err := c.RootClient.Get(context.TODO(), request.NamespacedName, service); err != nil {
if err := c.RootClient.Get(ctx, request.NamespacedName, service); err != nil {
if !apierrors.IsNotFound(err) {
klog.Errorf("Cloud not get service in root cluster,Error: %v", err)
return controllerruntime.Result{Requeue: true}, err
Expand All @@ -66,7 +66,7 @@ func (c *AutoCreateMCSController) Reconcile(_ context.Context, request reconcile
}

clusterList := &kosmosv1alpha1.ClusterList{}
if err := c.RootClient.List(context.TODO(), clusterList); err != nil {
if err := c.RootClient.List(ctx, clusterList); err != nil {
klog.Errorf("Cloud not get cluster in root cluster,Error: %v", err)
return controllerruntime.Result{Requeue: true}, err
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ type ServiceExportController struct {
ReservedNamespaces []string
}

func (c *ServiceExportController) Reconcile(_ context.Context, request reconcile.Request) (reconcile.Result, error) {
func (c *ServiceExportController) Reconcile(ctx context.Context, request reconcile.Request) (reconcile.Result, error) {
klog.V(4).Infof("============ %s starts to reconcile %s ============", ServiceExportControllerName, request.NamespacedName.String())
defer func() {
klog.V(4).Infof("============ %s has been reconciled =============", request.NamespacedName.String())
}()

serviceExport := &mcsv1alpha1.ServiceExport{}
if err := c.RootClient.Get(context.TODO(), request.NamespacedName, serviceExport); err != nil {
if err := c.RootClient.Get(ctx, request.NamespacedName, serviceExport); err != nil {
if apierrors.IsNotFound(err) {
return controllerruntime.Result{}, nil
}
Expand Down

0 comments on commit 73369ba

Please sign in to comment.