Repository navigation
fix(kubernetes): emit each topology identity once per snapshot - #545
Draft
thbertoldi wants to merge 2 commits into
Draft
thbertoldi wants to merge 2 commits into
thbertoldi wants to merge 2 commits into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Kubernetes topology collectors can submit the same identity several times within one snapshot. For example, a Qdrant container mounting two files from one ConfigMap produces the same container-to-ConfigMap relation twice; shared ingress endpoints and host paths similarly repeat components. The backend retains one observation but reports duplicate-item synchronization errors.
Accept the first component and relation observation for each external ID in the snapshot using concurrent identity caches. Deduplicate relations before deciding whether to queue them, so a duplicate arriving after its endpoints cannot replace an earlier queued observation. Drain queued relations after correlation. Each new snapshot gets fresh caches, preserving subsequent updates, existing identifiers and missing-endpoint filtering. Existing ingress tests now expect one shared endpoint with the distinct ingress relations retained. Include a Cluster Agent release note.
Validation:
1.26.6. Changed-code lint passed with golangci-lint2.9.0; the new release note passed the repository RST linter.3.78.2-dedup.20261014, based on13679eda6fwith the exact implementation in5a41036559, ran on two real Kubernetes clusters. Duplicate-item errors cleared; seven node IDs, two cluster IDs and the existing Qdrant mount relation ID were preserved. The latest check shows both Kubernetes synchronizations Running with empty active error details. Historical error counters were not reset.The unfiltered kubeapi suite could not complete:
TestProcessBundledEventswaits for an unavailable Kubernetes API client. Full-package lint reports preexisting issues; only changed-code lint is clean. Separate process/network synchronization errors remain outside this Kubernetes snapshot fix. The deployed binary is a private test override, not an official Agent release.Target
stackstate-7.78.2, the current StackVista default branch and deployed source baseline. Keep draft: this repository skips unit-test jobs for fork PRs and its aggregate gate requires those jobs, so maintainer-side CI is still needed. Discovered while validating SUSE AI StackPacks v2; the fix belongs in the native Agent.