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

fix: prevent redundant reconciliations #470

Merged
merged 3 commits into from
Dec 19, 2023
Merged
Show file tree
Hide file tree
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
@@ -1,6 +1,5 @@
package eu.glasskube.operator.apps.odoo

import eu.glasskube.kubernetes.client.patchOrUpdateResourceAndStatus
import eu.glasskube.kubernetes.client.patchOrUpdateStatus
import eu.glasskube.operator.api.reconciler.informerEventSource
import eu.glasskube.operator.apps.odoo.dependent.OdooConfigMap
Expand Down Expand Up @@ -90,12 +89,7 @@ class OdooReconciler(webhookService: WebhookService) :
}

return with(resource) {
if (FINALIZER in metadata.finalizers) {
metadata.finalizers.remove(FINALIZER)
patchOrUpdateResourceAndStatus(newStatus)
} else {
patchOrUpdateStatus(newStatus)
}
patchOrUpdateStatus(newStatus)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import io.javaoperatorsdk.operator.processing.dependent.kubernetes.CRUDKubernete
import io.javaoperatorsdk.operator.processing.dependent.kubernetes.KubernetesDependent
import io.javaoperatorsdk.operator.processing.event.ResourceID

@KubernetesDependent(resourceDiscriminator = PlaneFrontendConfigMap.Discriminator::class)
@KubernetesDependent(resourceDiscriminator = PlaneApiService.Discriminator::class)
class PlaneApiService : CRUDKubernetesDependentResource<Service, Plane>(Service::class.java) {

internal class Discriminator :
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,10 @@ abstract class DependentPostgresCluster<P>(
spec = ClusterSpec(
instances = primary.getSpec().database.instances,
enableSuperuserAccess = false,
inheritedMetadata = EmbeddedObjectMetadata(
annotations = configService.getBackupAnnotations(primary, "pgdata")
),
inheritedMetadata =
configService.getBackupAnnotations(primary, "pgdata")
.takeIf { it.isNotEmpty() }
?.let { EmbeddedObjectMetadata(annotations = it) },
bootstrap = BootstrapConfiguration(
initdb = BootstrapInitDB(
database = postgresNameMapper.getDatabaseName(primary),
Expand Down
Loading