From f7659f901d61c91afbb4d97e6bd7fbf9207d53d0 Mon Sep 17 00:00:00 2001 From: Ivan Milchev Date: Tue, 20 Feb 2024 11:38:03 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix=20mock=20provider=20panic=20?= =?UTF-8?q?(#3368)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ivan Milchev --- .gitignore | 1 + providers/builtin.go | 2 +- providers/mock.go | 4 +--- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 3c6e66bc90..8522eb6d83 100644 --- a/.gitignore +++ b/.gitignore @@ -16,5 +16,6 @@ providers/*/resources/*.resources.json providers/*/resources/*.manifest.json providers/mock_coordinator.go providers/mock_plugin_interface.go +providers/mock_schema.go providers-sdk/*/testutils/mockprovider/resources/*.resources.json !providers/core/resources/*.resources.json diff --git a/providers/builtin.go b/providers/builtin.go index 25b2064e52..609eefd6e7 100644 --- a/providers/builtin.go +++ b/providers/builtin.go @@ -35,7 +35,7 @@ var builtinProviders = map[string]*builtinProvider{ Runtime: &RunningProvider{ Name: mockProvider.Name, ID: mockProvider.ID, - Plugin: &mockProviderService{coordinator: Coordinator}, + Plugin: &mockProviderService{}, isClosed: false, }, Config: mockProvider.Provider, diff --git a/providers/mock.go b/providers/mock.go index 34bf595e79..5ffb137c46 100644 --- a/providers/mock.go +++ b/providers/mock.go @@ -23,7 +23,6 @@ var mockProvider = Provider{ } type mockProviderService struct { - coordinator ProvidersCoordinator initialized bool runtime *Runtime } @@ -121,9 +120,8 @@ func (s *mockProviderService) Init(running *RunningProvider) { } s.initialized = true - // TODO: Currently not needed, as the runtime loads all schemas right now. + // TODO: Currently not needed, as the coordinator loads all schemas right now. // Once it doesn't do that anymore, remember to load all schemas here // rt.schema.unsafeLoadAll() // rt.schema.unsafeRefresh() - running.Schema = s.coordinator.Schema() }