Skip to content

feat(k8sevent): discover node names from Kubernetes Event logs - #1176

Merged
kyasbal merged 2 commits into
GoogleCloudPlatform:mainfrom
K53:push-zswrprzsprvq
Oct 26, 2026
Merged

kyasbal merged 2 commits into
GoogleCloudPlatform:mainfrom
K53:push-zswrprzsprvq

Conversation

@K53

@K53 K53 commented Oct 24, 2026

Copy link
Copy Markdown
Collaborator

Summary

Extracts node names from jsonPayload.source.host in Kubernetes Event logs and registers them with the node name discovery inventory (TagNodeNameDiscovery).

Motivation

Previously, node name discovery did not inspect Kubernetes Event logs. When node creation audit logs fall outside the inspection time window, nodes that emit Kubernetes Events (recorded in jsonPayload.source.host) could be missed by the node name inventory used by downstream node-related log queries.

@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 implements a new discovery task, nodeNameDiscoveryTask, to extract node names from Kubernetes Event logs via the jsonPayload.source.host field. The KubernetesEventFieldSet struct and its extractor were updated to support this new field, and comprehensive unit tests were added for both the extractor changes and the new discovery task. Since there are no review comments, I have no feedback to provide.

Comment on lines +93 to +97
slices.Sort(result)
slices.Sort(tc.want)
if diff := cmp.Diff(tc.want, result); diff != "" {
t.Errorf("result mismatch (-want +got):\n%s", diff)
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Instead of sorting results and tc.want, it should use cmpopts.SortSlices.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

done

@K53
K53 force-pushed the push-zswrprzsprvq branch from 429d431 to e12070e Compare October 26, 2026 06:26
@K53
K53 force-pushed the push-zswrprzsprvq branch from e12070e to 2d23853 Compare October 26, 2026 07:51

@kyasbal kyasbal left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@kyasbal
kyasbal added this pull request to the merge queue Oct 26, 2026
Merged via the queue into GoogleCloudPlatform:main with commit 50c5ba5 Oct 26, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants