Skip to content

fix(k8scontainer): prevent container log pod phase mapper from overwriting CAI pod revisions and resolve CAI pod UID - #1009

Merged
kyasbal merged 1 commit into
GoogleCloudPlatform:mainfrom
kyasbal:push-lsvsoywlrrwr
Sep 16, 2026
Merged

kyasbal merged 1 commit into
GoogleCloudPlatform:mainfrom
kyasbal:push-lsvsoywlrrwr

Conversation

@kyasbal

@kyasbal kyasbal commented Sep 16, 2026

Copy link
Copy Markdown
Member

Summary

When Cloud Asset Inventory (CAI) provides initial Pod state, containerLogPodPhaseTimelineMapper previously generated synthetic supplement revisions (RevisionStateK8sResourceExistingLogNotFound) on podPath and bindingPath, overwriting existing CAI Pod revisions.

Changes

  • Query InitialResourceStateProvider for the Pod's initial state in containerLogPodPhaseTimelineMapper.
  • Resolve metadata.uid from the CAI Pod snapshot when constructing the PodPhase timeline path under the Node.
  • Check TimelineAccumulator for existing PodPhase revisions from audit logs (PodPhaseLogToTimelineMapperTask) and suppress duplicate container log revisions when present.
  • Suppress synthetic supplement revisions on podPath and bindingPath when CAI already knows about the Pod.
…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 kyasbal added type:bug Something isn't working as expected area:backend-parser Log parsers and log timeline mapper tasks labels Sep 16, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

@kyasbal
kyasbal added this pull request to the merge queue Sep 16, 2026
Merged via the queue into GoogleCloudPlatform:main with commit 732585a Sep 16, 2026
17 checks passed
@kyasbal
kyasbal deleted the push-lsvsoywlrrwr branch September 16, 2026 02:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:backend-parser Log parsers and log timeline mapper tasks type:bug Something isn't working as expected

1 participant