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

If a user modifies .spec field of Application on Managed Agent (or any non-source of truth peer), it is not reconciled back #238

Open
jgwest opened this issue Nov 25, 2024 · 0 comments
Labels
bug Something isn't working
Milestone

Comments

@jgwest
Copy link
Member

jgwest commented Nov 25, 2024

If a user modifies the .spec field of an Application on Managed Agent (or any non-source of truth peer), it is not reconciled back to the canonical value from principal.

Arguable whether this is an enhancement or a bug, it's right on the line between the two 😄. Feel free to re-classify.

Consider the following scenario:

  1. Principal and managed agent are connected. They share one Application appA.
  2. A user on managed agent cluster modifies the .spec field of Application.
  • (Same scenario but for principal and autonomous agent)

Expected Behaviour:

  • Managed-agent detects that the .spec field has been modified, and reconciles the Application's .spec field back to the canonical value from principal.

Actual Behaviour:

  • Managed-agent does not reconcile .spec field back (in fact, I think it treats it as a .status update instead?) My expectation is that it will only be reconciled back when the principal is next reconciled.

At least two possible solutions:

  • A) When managed agent detects a .spec change, it should send request-update message with checksum. Principal will reply with canonical version of the .spec if the checksum differs. Agent will update back to that.
  • B) Agent maintains an in-memory copy of all applications, and reconciles them back to that value on detected spec change.

My personal preference is A, since it is simpler (given that it fits with other logic we already implementing). However A) would not cover all cases: for example, what if managed agent is temporarily disconnected from principal (e.g. the managed agent on a cruise ship scenario).

I think B) is a better solution, as it will better handle all scenarios, for example, what if managed agent is temporarily disconnected from principal (e.g. the managed agent on a cruise ship scenario). This solution will be more complex, as there are two hard problems in computer science, cache invalidation and naming things.

Issue Criteria:

  • Peer (e.g. managed agent) detects and revert changes to the .spec field of resource (e.g. Application) back to canonical value.
  • E2E test which verifies the issue is resolved.
@jgwest jgwest added the bug Something isn't working label Nov 25, 2024
@jannfis jannfis added this to the v0.1.0 milestone Nov 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants