Skip to content

Add observedGeneration while updating the ApicurioRegistry3's status #6367

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

Closed
wants to merge 4 commits into from

Conversation

kamolhasan
Copy link

@kamolhasan kamolhasan commented Jun 26, 2025

This pull request refines the status management logic in the StatusManager class to ensure the observedGeneration field is updated accurately and reflects the latest resource version. The changes improve the reliability of status updates for the ApicurioRegistry3 resource.

Background Context

The ApicurioRegistry3 operator is exhibiting unexpected behavior where the status.observedGeneration field is being removed and then immediately re-added in subsequent reconciliation loops. This pattern results in frequent MODIFIED events, each triggering a new resourceVersion in etcd:

  • observedGeneration is removed by the operator.

  • A follow-up event adds the same observedGeneration back.

  • Each of these changes results in a new resourceVersion.

2025/06/26 15:05:34 === APICURIOREGISTRY3 MODIFIED EVENT ===
2025/06/26 15:05:34 Resource: default/apicurio-registry
2025/06/26 15:05:34 Timestamp: 2025-06-26T15:05:34+07:00
2025/06/26 15:05:34 Kind: ApicurioRegistry3
2025/06/26 15:05:34 APIVersion: registry.apicur.io/v1
2025/06/26 15:05:34 Event: ApicurioRegistry3 modified
2025/06/26 15:05:34 Status changes (-old +new):
  map[string]any{
        "conditions":         []any{map[string]any{"lastTransitionTime": string("2025-06-26T07:37:20Z"), "lastUpdateTime": string("2025-06-26T07:37:20Z"), "message": string("All active Deployments are available."), "reason": string("ActiveDeploymentsAvailable"), ...}},
-       "observedGeneration": int64(1),
  }
2025/06/26 15:05:34 ResourceVersion changed: 151704 -> 152413
2025/06/26 15:05:34 === END EVENT ===
2025/06/26 15:05:34 === APICURIOREGISTRY3 MODIFIED EVENT ===
2025/06/26 15:05:34 Resource: default/apicurio-registry
2025/06/26 15:05:34 Timestamp: 2025-06-26T15:05:34+07:00
2025/06/26 15:05:34 Kind: ApicurioRegistry3
2025/06/26 15:05:34 APIVersion: registry.apicur.io/v1
2025/06/26 15:05:34 Event: ApicurioRegistry3 modified
2025/06/26 15:05:34 Status changes (-old +new):
  map[string]any{
        "conditions":         []any{map[string]any{"lastTransitionTime": string("2025-06-26T07:37:20Z"), "lastUpdateTime": string("2025-06-26T07:37:20Z"), "message": string("All active Deployments are available."), "reason": string("ActiveDeploymentsAvailable"), ...}},
+       "observedGeneration": int64(1),
  }
2025/06/26 15:05:34 ResourceVersion changed: 152413 -> 152417
2025/06/26 15:05:34 === END EVENT ===

These seemingly redundant modifications cause unnecessary propagation of updates to dependent deployment objects (app, ui) through the annotation: javaoperatorsdk.io/previous: ... ...

Each event causes the operator to patch these deployments even though there is no actual configuration change, resulting in noise and inefficiency.

@kamolhasan
Copy link
Author

#6366

Copy link
Member

@jsenko jsenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR, this is interesting because the observed generation should be managed automatically by the Java Operator SDK. It seems like it's not doing that properly.

@kamolhasan
Copy link
Author

Thanks @jsenko

Java is not my core programming language, so I'm not sure how to resolve the failing GitHub Actions test suites. If you’d like, you can take over this PR, or feel free to close it and include this change in one of your future PRs.

@jsenko
Copy link
Member

jsenko commented Jul 15, 2025

Should be addressed by #6409 . We're upgrading to new major version of JOSDK where observed generation management is done manually.

@jsenko jsenko closed this Jul 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants