Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add switch for PersistentPodState controller #1002

Merged
merged 1 commit into from
Jun 20, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
appsv1beta1 "github.com/openkruise/kruise/apis/apps/v1beta1"
"github.com/openkruise/kruise/pkg/util"
"github.com/openkruise/kruise/pkg/util/controllerfinder"
"github.com/openkruise/kruise/pkg/util/discovery"
"github.com/openkruise/kruise/pkg/util/ratelimiter"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
Expand Down Expand Up @@ -58,6 +59,7 @@ var (
KindSts = appsv1.SchemeGroupVersion.WithKind("StatefulSet")
// kruise
KruiseKindSts = appsv1beta1.SchemeGroupVersion.WithKind("StatefulSet")
KruiseKindPps = appsv1alpha1.SchemeGroupVersion.WithKind("PersistentPodState")
// AutoGeneratePersistentPodStatePrefix auto generate PersistentPodState crd
AutoGeneratePersistentPodStatePrefix = "generate#"
)
Expand All @@ -70,6 +72,9 @@ var (
// Add creates a new PersistentPodState Controller and adds it to the Manager with default RBAC. The Manager will set fields on the Controller
// and Start it when the Manager is Started.
func Add(mgr manager.Manager) error {
if !discovery.DiscoverGVK(KruiseKindPps) {
return nil
}
return add(mgr, newReconciler(mgr))
}

Expand Down