Skip to content

Commit

Permalink
optimize the pv and pvc code
Browse files Browse the repository at this point in the history
Signed-off-by: duanmengkk <[email protected]>
  • Loading branch information
duanmengkk committed Jan 23, 2024
1 parent 0cb00b4 commit 0b36bc5
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package pod

import (
"context"

"github.com/google/go-cmp/cmp"
"github.com/pkg/errors"
corev1 "k8s.io/api/core/v1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package pv

import (
"context"

v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ func (l *LeafPVCController) Reconcile(ctx context.Context, request reconcile.Req
if err != nil {
klog.Errorf("patch pvc namespace: %q, name: %q to root cluster failed, error: %v",
request.NamespacedName.Namespace, request.NamespacedName.Name, err)
return reconcile.Result{RequeueAfter: RootPVCRequeueTime}, nil
return reconcile.Result{RequeueAfter: utils.DefaultRequeueTime}, nil
}

return reconcile.Result{}, nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ package pvc

import (
"context"
"reflect"

v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
mergetypes "k8s.io/apimachinery/pkg/types"
"k8s.io/klog"
"reflect"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/builder"
"sigs.k8s.io/controller-runtime/pkg/client"
Expand Down
3 changes: 2 additions & 1 deletion pkg/utils/constants.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package utils

import (
"time"

corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/runtime/schema"
"time"
)

var (
Expand Down

0 comments on commit 0b36bc5

Please sign in to comment.