Skip to content

Commit 30aa54b

Browse files
committed
fix issue pointed by gemini-code-assist
1 parent c0724f1 commit 30aa54b

1 file changed

Lines changed: 7 additions & 11 deletions

File tree

pkg/task/inspection/commonlogk8sauditv2/impl/podphase_task.go

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -72,19 +72,15 @@ func (c *podPhaseTaskSetting) Process(ctx context.Context, passIndex int, event
7272

7373
// firstPass collects the node name of the pod.
7474
func (c *podPhaseTaskSetting) firstPass(ctx context.Context, event commonlogk8sauditv2_contract.ResourceChangeEvent, cs *history.ChangeSet, builder *history.Builder, state *podPhaseTaskState) (*podPhaseTaskState, error) {
75-
76-
if event.EventTargetBodyReader != nil {
77-
nodeName, found := GetNodeNameOfPod(event.EventTargetBodyReader)
78-
if !found {
79-
return state, nil
80-
}
81-
uid, _ := GetUID(event.EventTargetBodyReader)
82-
83-
if nodeName != "" && uid != "" {
84-
state.uidToNodeNameMap[uid] = nodeName
85-
}
75+
nodeName, found := GetNodeNameOfPod(event.EventTargetBodyReader)
76+
if !found {
77+
return state, nil
8678
}
79+
uid, _ := GetUID(event.EventTargetBodyReader)
8780

81+
if nodeName != "" && uid != "" {
82+
state.uidToNodeNameMap[uid] = nodeName
83+
}
8884
return state, nil
8985
}
9086

0 commit comments

Comments
 (0)