Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Elastic Agent: Set status.ObservedGeneration from metadata.Generation #5383
Elastic Agent: Set status.ObservedGeneration from metadata.Generation #5383
Changes from 26 commits
fd34d3d
5bc9db5
8b7e14a
9de32ab
f77b470
30f6c8f
c6661bb
58ed712
b6045d0
1374e88
5e03689
b96cd85
2bc4fd9
a58c2da
250fcb5
a78d66d
27027d0
8b549f8
28731f7
ea5935e
c10da1b
3d9975d
bc4f919
ecad6df
4c8d2ec
d7844d7
205b1cf
5177545
b850b4f
4e6f801
f782303
0dea707
074933c
2894c06
052fb3f
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which case are we covering here? If we cannot fetch the Agent resource we cannot update. The case where we can fetch the Agent resource but the JSON in the association config is invalid is the only one I can think of. We do not handle this case for the Kibana resource as far as I can tell. I think it would be good to be somewhat consistent here.
So assuming I am not missing an obvious case (totally possible), I am not fully decided which way we should go here. Either we consider this case too much of an edge case to warrant updating the status in two places (which I would be OK with at this point) or we try to bring all the status update functionality into the same place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've just removed updating the status on association failures, as it seems to be causing more issues than it's worth.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think
observedGeneration
should be updated even if associations are not correctly set. One reason is that misconfigured associations are not immediately detected. Here is an example:config/recipes/elastic-agent/fleet-kubernetes-integration.yaml
observerdGeneration
is eventually updated:⬆️
generation
andobservedGeneration
are both set to 2Kibana
,observedGeneration
is still updated:⬆️
generation
andobservedGeneration
are both set to 3Agent
resource while keeping theKibana
association broken,observedGeneration
is no more updated, which seems a bit confusing to me and does not match the description "If the generation observed in status diverges from the generation in metadata, the Elastic Agent controller has not yet processed the changes contained in the Elastic Agent specification."⬆️
generation
has been updated to 4, butobservedGeneration
is still 3There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This logic has been updated, and I'll get these steps tested.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are using this in only one place you might as well inline it. But its fine if you want to keep it.