From 84a31f24af3cff4c8764f015db04c1e85aa87edd Mon Sep 17 00:00:00 2001 From: Tedi Mitiku Date: Thu, 17 Oct 2024 20:00:06 +0900 Subject: [PATCH] lint engine --- .../stream_logs_strategy/stream_logs_strategy_impl.go | 4 ---- .../stream_logs_strategy_impl_test.go | 11 ----------- 2 files changed, 15 deletions(-) diff --git a/engine/server/engine/centralized_logs/client_implementations/persistent_volume/stream_logs_strategy/stream_logs_strategy_impl.go b/engine/server/engine/centralized_logs/client_implementations/persistent_volume/stream_logs_strategy/stream_logs_strategy_impl.go index f681fd394e..3117a06931 100644 --- a/engine/server/engine/centralized_logs/client_implementations/persistent_volume/stream_logs_strategy/stream_logs_strategy_impl.go +++ b/engine/server/engine/centralized_logs/client_implementations/persistent_volume/stream_logs_strategy/stream_logs_strategy_impl.go @@ -21,10 +21,6 @@ import ( "github.com/sirupsen/logrus" ) -const ( - oneWeek = 7 * 24 * time.Hour -) - // StreamLogsStrategyImpl pulls logs from filesystem where there is a log file per year, per week, per enclave, per service // Weeks are denoted 01-52 // e.g. diff --git a/engine/server/engine/centralized_logs/client_implementations/persistent_volume/stream_logs_strategy/stream_logs_strategy_impl_test.go b/engine/server/engine/centralized_logs/client_implementations/persistent_volume/stream_logs_strategy/stream_logs_strategy_impl_test.go index 121369577b..2183d7a822 100644 --- a/engine/server/engine/centralized_logs/client_implementations/persistent_volume/stream_logs_strategy/stream_logs_strategy_impl_test.go +++ b/engine/server/engine/centralized_logs/client_implementations/persistent_volume/stream_logs_strategy/stream_logs_strategy_impl_test.go @@ -2,23 +2,18 @@ package stream_logs_strategy import ( "bufio" - "fmt" "github.com/kurtosis-tech/kurtosis/engine/server/engine/centralized_logs/client_implementations/persistent_volume/file_layout" "github.com/kurtosis-tech/kurtosis/engine/server/engine/centralized_logs/client_implementations/persistent_volume/logs_clock" "github.com/kurtosis-tech/kurtosis/engine/server/engine/centralized_logs/client_implementations/persistent_volume/volume_consts" "github.com/kurtosis-tech/kurtosis/engine/server/engine/centralized_logs/logline" "github.com/stretchr/testify/require" "io" - "strconv" "strings" "testing" "time" ) const ( - testEnclaveUuid = "test-enclave" - testUserService1Uuid = "test-user-service-1" - retentionPeriodInWeeksForTesting = 5 ) @@ -42,12 +37,6 @@ func TestIsWithinRetentionPeriod(t *testing.T) { require.False(t, isWithinRetentionPeriod) } -func getWeekFilepathStr(year, week int) string { - // %02d to format week num with leading zeros so 1-9 are converted to 01-09 for %V format - formattedWeekNum := fmt.Sprintf("%02d", week) - return fmt.Sprintf(file_layout.PerWeekFilePathFmtStr, volume_consts.LogsStorageDirpath, strconv.Itoa(year), formattedWeekNum, testEnclaveUuid, testUserService1Uuid, volume_consts.Filetype) -} - func TestGetCompleteJsonLogString(t *testing.T) { logLine1 := "{\"log\":\"Starting feature 'runs idempotently'\"}" logLine2a := "{\"log\":\"Starting feature 'apic "