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

exporter: Skip reconcile on exporter deletion #13597

Merged
merged 1 commit into from
Jan 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 12 additions & 4 deletions pkg/operator/ceph/controller/predicate.go
Original file line number Diff line number Diff line change
Expand Up @@ -521,8 +521,8 @@ func WatchPredicateForNonCRDObject(owner runtime.Object, scheme *runtime.Scheme)
return false
}

// If the resource is a canary deployment we don't reconcile because it's ephemeral
if isCanary(e.Object) || isCrashCollector(e.Object) {
// If the resource is a canary, crash collector, or exporter we don't reconcile because it's ephemeral
if isCanary(e.Object) || isCrashCollector(e.Object) || isExporter(e.Object) {
return false
}

Expand Down Expand Up @@ -693,6 +693,14 @@ func isCanary(obj runtime.Object) bool {
}

func isCrashCollector(obj runtime.Object) bool {
return isDeployment(obj, "rook-ceph-crashcollector")
}

func isExporter(obj runtime.Object) bool {
return isDeployment(obj, "rook-ceph-exporter")
}

func isDeployment(obj runtime.Object, appName string) bool {
// If not a deployment, let's not reconcile
d, ok := obj.(*appsv1.Deployment)
if !ok {
Expand All @@ -703,8 +711,8 @@ func isCrashCollector(obj runtime.Object) bool {
labels := d.GetLabels()

labelVal, labelKeyExist := labels["app"]
if labelKeyExist && labelVal == "rook-ceph-crashcollector" {
logger.Debugf("do not reconcile %q on crash collectors", d.Name)
if labelKeyExist && labelVal == appName {
logger.Debugf("do not reconcile %q on %s", d.Name, appName)
return true
}

Expand Down