From 15d411fd10c5d3b82b5dfc14d6134602aba75988 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20=C4=8Ctvrtka?= Date: Thu, 31 Oct 2024 10:47:19 +0100 Subject: [PATCH] PMM-13057 Fix for changes. --- managed/services/telemetry/mock_data_source_test.go | 12 ++++++------ managed/services/telemetry/mock_sender_test.go | 6 +++--- managed/services/telemetry/telemetry.go | 1 + managed/utils/platform/client.go | 1 + 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/managed/services/telemetry/mock_data_source_test.go b/managed/services/telemetry/mock_data_source_test.go index 8c0b53e3a5..e6b004ebb5 100644 --- a/managed/services/telemetry/mock_data_source_test.go +++ b/managed/services/telemetry/mock_data_source_test.go @@ -5,7 +5,7 @@ package telemetry import ( context "context" - telemetryv1 "github.com/percona/saas/gen/telemetry/generic" + genericv1 "github.com/percona/saas/gen/telemetry/generic" mock "github.com/stretchr/testify/mock" ) @@ -51,23 +51,23 @@ func (_m *mockDataSource) Enabled() bool { } // FetchMetrics provides a mock function with given fields: ctx, config -func (_m *mockDataSource) FetchMetrics(ctx context.Context, config Config) ([]*telemetryv1.GenericReport_Metric, error) { +func (_m *mockDataSource) FetchMetrics(ctx context.Context, config Config) ([]*genericv1.GenericReport_Metric, error) { ret := _m.Called(ctx, config) if len(ret) == 0 { panic("no return value specified for FetchMetrics") } - var r0 []*telemetryv1.GenericReport_Metric + var r0 []*genericv1.GenericReport_Metric var r1 error - if rf, ok := ret.Get(0).(func(context.Context, Config) ([]*telemetryv1.GenericReport_Metric, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context, Config) ([]*genericv1.GenericReport_Metric, error)); ok { return rf(ctx, config) } - if rf, ok := ret.Get(0).(func(context.Context, Config) []*telemetryv1.GenericReport_Metric); ok { + if rf, ok := ret.Get(0).(func(context.Context, Config) []*genericv1.GenericReport_Metric); ok { r0 = rf(ctx, config) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).([]*telemetryv1.GenericReport_Metric) + r0 = ret.Get(0).([]*genericv1.GenericReport_Metric) } } diff --git a/managed/services/telemetry/mock_sender_test.go b/managed/services/telemetry/mock_sender_test.go index 8230bff6ed..3c943e8de4 100644 --- a/managed/services/telemetry/mock_sender_test.go +++ b/managed/services/telemetry/mock_sender_test.go @@ -5,7 +5,7 @@ package telemetry import ( context "context" - telemetryv1 "github.com/percona/saas/gen/telemetry/generic" + genericv1 "github.com/percona/saas/gen/telemetry/generic" mock "github.com/stretchr/testify/mock" ) @@ -15,7 +15,7 @@ type mockSender struct { } // SendTelemetry provides a mock function with given fields: ctx, report -func (_m *mockSender) SendTelemetry(ctx context.Context, report *telemetryv1.ReportRequest) error { +func (_m *mockSender) SendTelemetry(ctx context.Context, report *genericv1.ReportRequest) error { ret := _m.Called(ctx, report) if len(ret) == 0 { @@ -23,7 +23,7 @@ func (_m *mockSender) SendTelemetry(ctx context.Context, report *telemetryv1.Rep } var r0 error - if rf, ok := ret.Get(0).(func(context.Context, *telemetryv1.ReportRequest) error); ok { + if rf, ok := ret.Get(0).(func(context.Context, *genericv1.ReportRequest) error); ok { r0 = rf(ctx, report) } else { r0 = ret.Error(0) diff --git a/managed/services/telemetry/telemetry.go b/managed/services/telemetry/telemetry.go index 4e49bb20a3..073b821080 100644 --- a/managed/services/telemetry/telemetry.go +++ b/managed/services/telemetry/telemetry.go @@ -24,6 +24,7 @@ import ( "github.com/google/uuid" pmmv1 "github.com/percona/saas/gen/telemetry/events/pmm" + telemetryv1 "github.com/percona/saas/gen/telemetry/generic" "github.com/pkg/errors" "github.com/sirupsen/logrus" "google.golang.org/protobuf/types/known/durationpb" diff --git a/managed/utils/platform/client.go b/managed/utils/platform/client.go index c045ee8f3b..216365019a 100644 --- a/managed/utils/platform/client.go +++ b/managed/utils/platform/client.go @@ -25,6 +25,7 @@ import ( "net/http" api "github.com/percona/saas/gen/check/retrieval" + telemetryv1 "github.com/percona/saas/gen/telemetry/generic" "github.com/pkg/errors" "github.com/sirupsen/logrus" "google.golang.org/grpc/codes"