Skip to content

Commit 5571fda

Browse files
committed
fix compilation errors
1 parent f245297 commit 5571fda

24 files changed

Lines changed: 39 additions & 39 deletions

File tree

pkg/core/inspection/taskbase/logingester_task.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import (
2828
"go.opentelemetry.io/otel/trace"
2929
)
3030

31-
// NewLogIngester store its given logs to history to prepare the history type to have ChangeSet associated with the log.
31+
// NewLogIngesterTask returns a task stores its given logs to history to prepare the history type to have ChangeSet associated with the log.
3232
// This must be called before LogToTimelineMapperTask and Logs must be discarded before this task if it shouldn't be included in the result.
3333
func NewLogIngesterTask(taskID taskid.TaskImplementationID[[]*log.Log], input taskid.TaskReference[[]*log.Log]) coretask.Task[[]*log.Log] {
3434
return NewProgressReportableInspectionTask(taskID, []taskid.UntypedTaskReference{input}, func(ctx context.Context, taskMode inspectioncore_contract.InspectionTaskModeType, progress *inspectionmetadata.TaskProgressMetadata) ([]*log.Log, error) {

pkg/core/inspection/taskbase/logingester_task_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ func TestLogIngesterTask_DryRunMode(t *testing.T) {
3131
ctx := inspectiontest.WithDefaultTestInspectionTaskContext(t.Context())
3232
inputTaskID := taskid.NewDefaultImplementationID[[]*log.Log]("input")
3333
taskID := taskid.NewDefaultImplementationID[[]*log.Log]("test")
34-
task := NewLogIngester(taskID, inputTaskID.Ref())
34+
task := NewLogIngesterTask(taskID, inputTaskID.Ref())
3535

3636
result, _, err := inspectiontest.RunInspectionTask(ctx, task, inspectioncore_contract.TaskModeDryRun, map[string]any{},
3737
tasktest.NewTaskDependencyValuePair(inputTaskID.Ref(), []*log.Log{l}))
@@ -55,7 +55,7 @@ func TestLogIngesterTask_RunMode(t *testing.T) {
5555
ctx := inspectiontest.WithDefaultTestInspectionTaskContext(t.Context())
5656
inputTaskID := taskid.NewDefaultImplementationID[[]*log.Log]("input")
5757
taskID := taskid.NewDefaultImplementationID[[]*log.Log]("test")
58-
task := NewLogIngester(taskID, inputTaskID.Ref())
58+
task := NewLogIngesterTask(taskID, inputTaskID.Ref())
5959

6060
result, _, err := inspectiontest.RunInspectionTask(ctx, task, inspectioncore_contract.TaskModeRun, map[string]any{},
6161
tasktest.NewTaskDependencyValuePair(inputTaskID.Ref(), []*log.Log{l}))

pkg/core/inspection/taskbase/mapper_task_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ type mockLogToTimelineMapperGroupData struct {
4242
type mockLogToTimelineMapper struct {
4343
}
4444

45-
// GroupedLogTask implements HistoryModifer.
45+
// GroupedLogTask implements LogToTimelineMapper.
4646
func (m *mockLogToTimelineMapper) GroupedLogTask() taskid.TaskReference[LogGroupMap] {
4747
return mockLogToTimelineMapperPrevTaskID.Ref()
4848
}

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,22 +198,22 @@ func (c *conditionLogToTimelineMapperTaskSetting) processSecondPass(ctx context.
198198
return state, nil
199199
}
200200

201-
// Dependencies implements commonlogk8sauditv2_contract.ResourceBasedHistoryModifer.
201+
// Dependencies implements commonlogk8sauditv2_contract.ManifestLogToTimelineMapperTaskSetting.
202202
func (c *conditionLogToTimelineMapperTaskSetting) Dependencies() []taskid.UntypedTaskReference {
203203
return []taskid.UntypedTaskReference{}
204204
}
205205

206-
// PassCount implements commonlogk8sauditv2_contract.ResourceBasedHistoryModifer.
206+
// PassCount implements commonlogk8sauditv2_contract.ManifestLogToTimelineMapperTaskSetting.
207207
func (c *conditionLogToTimelineMapperTaskSetting) PassCount() int {
208208
return 2
209209
}
210210

211-
// GroupedLogTask implements commonlogk8sauditv2_contract.ResourceBasedHistoryModifer.
211+
// GroupedLogTask implements commonlogk8sauditv2_contract.ManifestLogToTimelineMapperTaskSetting.
212212
func (c *conditionLogToTimelineMapperTaskSetting) GroupedLogTask() taskid.TaskReference[commonlogk8sauditv2_contract.ResourceManifestLogGroupMap] {
213213
return commonlogk8sauditv2_contract.ResourceLifetimeTrackerTaskID.Ref()
214214
}
215215

216-
// LogIngesterTask implements commonlogk8sauditv2_contract.ResourceBasedHistoryModifer.
216+
// LogIngesterTask implements commonlogk8sauditv2_contract.ManifestLogToTimelineMapperTaskSetting.
217217
func (c *conditionLogToTimelineMapperTaskSetting) LogIngesterTask() taskid.TaskReference[[]*log.Log] {
218218
return commonlogk8sauditv2_contract.K8sAuditLogIngesterTaskID.Ref()
219219
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -336,17 +336,17 @@ func (e *endpointResourceLogToTimelineMapperTaskSetting) ResourcePairs(ctx conte
336336
return result, nil
337337
}
338338

339-
// Dependencies implements commonlogk8sauditv2_contract.ResourceBasedHistoryModifer.
339+
// Dependencies implements commonlogk8sauditv2_contract.ManifestLogToTimelineMapperTaskSetting.
340340
func (e *endpointResourceLogToTimelineMapperTaskSetting) Dependencies() []taskid.UntypedTaskReference {
341341
return []taskid.UntypedTaskReference{}
342342
}
343343

344-
// GroupedLogTask implements commonlogk8sauditv2_contract.ResourceBasedHistoryModifer.
344+
// GroupedLogTask implements commonlogk8sauditv2_contract.ManifestLogToTimelineMapperTaskSetting.
345345
func (e *endpointResourceLogToTimelineMapperTaskSetting) GroupedLogTask() taskid.TaskReference[commonlogk8sauditv2_contract.ResourceManifestLogGroupMap] {
346346
return commonlogk8sauditv2_contract.ResourceLifetimeTrackerTaskID.Ref()
347347
}
348348

349-
// LogIngesterTask implements commonlogk8sauditv2_contract.ResourceBasedHistoryModifer.
349+
// LogIngesterTask implements commonlogk8sauditv2_contract.ManifestLogToTimelineMapperTaskSetting.
350350
func (e *endpointResourceLogToTimelineMapperTaskSetting) LogIngesterTask() taskid.TaskReference[[]*log.Log] {
351351
return commonlogk8sauditv2_contract.K8sAuditLogIngesterTaskID.Ref()
352352
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ var ResourceLifetimeTrackerTask = inspectiontaskbase.NewProgressReportableInspec
197197
updator.Start(ctx)
198198

199199
processedLogCount.Store(0)
200-
setting := &lifeTimeTrackerTaskSetting{
200+
setting := &lifeTimeTrackerTaskSetting{
201201
kindsToWaitExactDeletionToDetermineDeletion: map[string]struct{}{
202202
"core/v1#pod": {},
203203
},
@@ -213,7 +213,7 @@ setting := &lifeTimeTrackerTaskSetting{
213213
}
214214
for _, l := range group.Logs {
215215
var err error
216-
groupData, err = mapperSettingSetting.DetectLifetimeLogEvent(ctx, l, groupData)
216+
groupData, err = setting.DetectLifetimeLogEvent(ctx, l, groupData)
217217
if err != nil {
218218
var yaml string
219219
yamlBytes, err2 := l.Log.Serialize("", &structured.YAMLNodeSerializer{})

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import (
2727
)
2828

2929
// LogIngesterTask is the task to serialize k8s audit logs.
30-
var LogIngesterTask = inspectiontaskbase.NewLogIngester(
30+
var LogIngesterTask = inspectiontaskbase.NewLogIngesterTask(
3131
commonlogk8sauditv2_contract.K8sAuditLogIngesterTaskID,
3232
commonlogk8sauditv2_contract.K8sAuditLogProviderRef,
3333
)

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,22 +100,22 @@ func (r *resourceOwnerReferenceTimelineMapperTaskSetting) ResourcePairs(ctx cont
100100
return result, nil
101101
}
102102

103-
// Dependencies implements commonlogk8sauditv2_contract.ResourceBasedHistoryModifer.
103+
// Dependencies implements commonlogk8sauditv2_contract.ManifestLogToTimelineMapperTaskSetting.
104104
func (r *resourceOwnerReferenceTimelineMapperTaskSetting) Dependencies() []taskid.UntypedTaskReference {
105105
return []taskid.UntypedTaskReference{}
106106
}
107107

108-
// PassCount implements commonlogk8sauditv2_contract.ResourceBasedHistoryModifer.
108+
// PassCount implements commonlogk8sauditv2_contract.ManifestLogToTimelineMapperTaskSetting.
109109
func (r *resourceOwnerReferenceTimelineMapperTaskSetting) PassCount() int {
110110
return 1
111111
}
112112

113-
// GroupedLogTask implements commonlogk8sauditv2_contract.ResourceBasedHistoryModifer.
113+
// GroupedLogTask implements commonlogk8sauditv2_contract.ManifestLogToTimelineMapperTaskSetting.
114114
func (r *resourceOwnerReferenceTimelineMapperTaskSetting) GroupedLogTask() taskid.TaskReference[commonlogk8sauditv2_contract.ResourceManifestLogGroupMap] {
115115
return commonlogk8sauditv2_contract.ResourceLifetimeTrackerTaskID.Ref()
116116
}
117117

118-
// LogIngesterTask implements commonlogk8sauditv2_contract.ResourceBasedHistoryModifer.
118+
// LogIngesterTask implements commonlogk8sauditv2_contract.ManifestLogToTimelineMapperTaskSetting.
119119
func (r *resourceOwnerReferenceTimelineMapperTaskSetting) LogIngesterTask() taskid.TaskReference[[]*log.Log] {
120120
return commonlogk8sauditv2_contract.K8sAuditLogIngesterTaskID.Ref()
121121
}

pkg/task/inspection/googlecloudlogcomputeapiaudit/impl/parser_tasks.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ var FieldSetReaderTask = inspectiontaskbase.NewFieldSetReadTask(googlecloudlogco
3636
&googlecloudcommon_contract.GCPOperationAuditLogFieldSetReader{},
3737
})
3838

39-
var LogIngesterTask = inspectiontaskbase.NewLogIngester(googlecloudlogcomputeapiaudit_contract.LogIngesterTaskID, googlecloudlogcomputeapiaudit_contract.ListLogEntriesTaskID.Ref())
39+
var LogIngesterTask = inspectiontaskbase.NewLogIngesterTask(googlecloudlogcomputeapiaudit_contract.LogIngesterTaskID, googlecloudlogcomputeapiaudit_contract.ListLogEntriesTaskID.Ref())
4040

4141
var LogGrouperTask = inspectiontaskbase.NewLogGrouperTask(googlecloudlogcomputeapiaudit_contract.LogGrouperTaskID, googlecloudlogcomputeapiaudit_contract.FieldSetReaderTaskID.Ref(),
4242
func(ctx context.Context, l *log.Log) string {

pkg/task/inspection/googlecloudlogcomputeapiaudit/impl/parser_tasks_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,10 @@ func TestLogToTimelineMapperTask(t *testing.T) {
143143
for _, tc := range testCases {
144144
t.Run(tc.desc, func(t *testing.T) {
145145
l := log.NewLogWithFieldSetsForTest(testCommonFieldSet, &tc.input)
146-
mapperSetting := &gcpComputeAuditLogLogToTimelineMapperSetting{}
146+
mapperSetting := &gcpComputeAuditLogLogToTimelineMapperSetting{}
147147
cs := history.NewChangeSet(l)
148148

149-
_, err := mapperSettingSetting.ProcessLogByGroup(t.Context(), l, cs, nil, struct{}{})
149+
_, err := mapperSetting.ProcessLogByGroup(t.Context(), l, cs, nil, struct{}{})
150150
if err != nil {
151151
t.Errorf("got error %v, want nil", err)
152152
}

0 commit comments

Comments
 (0)