Repository navigation
fix(k8scontainer): prevent container log pod phase mapper from overwriting CAI pod revisions and resolve CAI pod UID - #1009
Merged
Conversation
…iting CAI pod revisions and resolve CAI pod UID When Cloud Asset Inventory (CAI) provides initial Pod state, the container log PodPhase timeline mapper previously generated synthetic supplement revisions (RevisionStateK8sResourceExistingLogNotFound) on podPath and bindingPath, overwriting existing CAI Pod revisions. This change: - Queries InitialResourceStateProvider for the Pod's initial state in containerLogPodPhaseTimelineMapper. - Resolves metadata.uid from the CAI Pod snapshot when constructing the PodPhase timeline path under the Node. - Checks TimelineAccumulator for existing PodPhase revisions (from audit logs) and suppresses duplicate container log revisions when present. - Suppresses synthetic supplement revisions on podPath and bindingPath when CAI already knows about the Pod.
kyasbal
requested review from
K53,
RyuSA,
jyane,
kkuchima and
renamoo
as code owners
September 16, 2026 02:01
Contributor
There was a problem hiding this comment.
Code Review
This pull request integrates the InitialResourceStateProvider into the container log pod phase timeline mapper. This allows the mapper to determine if Cloud Asset Inventory (CAI) knows about a Pod, using its resolved UID and avoiding redundant Pod or Binding revisions when CAI data is present. Unit tests have been updated and expanded to cover these new CAI-related scenarios. No review comments were provided, so there is no feedback to address.
Merged
via the queue into
GoogleCloudPlatform:main
with commit Sep 16, 2026
732585a
17 checks passed
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.
Summary
When Cloud Asset Inventory (CAI) provides initial Pod state,
containerLogPodPhaseTimelineMapperpreviously generated synthetic supplement revisions (RevisionStateK8sResourceExistingLogNotFound) onpodPathandbindingPath, overwriting existing CAI Pod revisions.Changes
InitialResourceStateProviderfor the Pod's initial state incontainerLogPodPhaseTimelineMapper.metadata.uidfrom the CAI Pod snapshot when constructing thePodPhasetimeline path under the Node.TimelineAccumulatorfor existingPodPhaserevisions from audit logs (PodPhaseLogToTimelineMapperTask) and suppress duplicate container log revisions when present.podPathandbindingPathwhen CAI already knows about the Pod.