Skip to content

Commit

Permalink
enhancement (CollaSet): fix ut
Browse files Browse the repository at this point in the history
  • Loading branch information
wu8685 committed Aug 10, 2023
1 parent e0c8fc0 commit 7418e8e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Image URL to use all building/pushing image targets
IMG ?= controller:202307101
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
ENVTEST_K8S_VERSION = 1.22.6
ENVTEST_K8S_VERSION = 1.22.1
# kind cluster name for e2e
CLUSTER_NAME ?= kindcluster
# kind version for e2e
Expand Down Expand Up @@ -163,7 +163,7 @@ GINKGO ?= $(LOCALBIN)/ginkgo

## Tool Versions
KUSTOMIZE_VERSION ?= v4.5.5
CONTROLLER_TOOLS_VERSION ?= v0.12.0
CONTROLLER_TOOLS_VERSION ?= v0.10.0
GINKGO_VERSION ?= 1.16.5

KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"
Expand All @@ -185,7 +185,7 @@ $(CONTROLLER_GEN): $(LOCALBIN)
.PHONY: envtest
envtest: $(ENVTEST) ## Download envtest-setup locally if necessary.
$(ENVTEST): $(LOCALBIN)
test -s $(LOCALBIN)/setup-envtest || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest
test -s $(LOCALBIN)/setup-envtest || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@v0.10.3

.PHONY: ginkgo
ginkgo: $(GINKGO) ## Download ginkgo locally if necessary. If wrong version is installed, it will be overwritten.
Expand Down
3 changes: 1 addition & 2 deletions pkg/controllers/poddeletion/poddeletion_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import (
"sigs.k8s.io/controller-runtime/pkg/reconcile"
"sigs.k8s.io/controller-runtime/pkg/source"

"kusionstack.io/kafed/pkg/controllers/collaset/utils"
"kusionstack.io/kafed/pkg/controllers/utils/expectations"
"kusionstack.io/kafed/pkg/controllers/utils/podopslifecycle"
)
Expand Down Expand Up @@ -92,7 +91,7 @@ func (r *PodDeletionReconciler) Reconcile(ctx context.Context, req ctrl.Request)
}

klog.Infof("Pod %s is deleted", req)
return ctrl.Result{}, utils.ActiveExpectations.Delete(req.Namespace, req.Name)
return ctrl.Result{}, activeExpectations.Delete(req.Namespace, req.Name)
}

// if expectation not satisfied, shortcut this reconciling till informer cache is updated.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import (
"sigs.k8s.io/controller-runtime/pkg/source"

appsv1alpha1 "kusionstack.io/kafed/apis/apps/v1alpha1"
"kusionstack.io/kafed/pkg/controllers/collaset/utils"
"kusionstack.io/kafed/pkg/controllers/utils/expectations"
)

Expand Down Expand Up @@ -96,7 +95,7 @@ func (r *ResourceContextReconciler) Reconcile(ctx context.Context, req ctrl.Requ
}

klog.Infof("ResourceContext %s is deleted", req)
return ctrl.Result{}, utils.ActiveExpectations.Delete(req.Namespace, req.Name)
return ctrl.Result{}, activeExpectations.Delete(req.Namespace, req.Name)
}

// if expectation not satisfied, shortcut this reconciling till informer cache is updated.
Expand Down

0 comments on commit 7418e8e

Please sign in to comment.