Skip to content

Commit

Permalink
🐛 fix mock provider panic
Browse files Browse the repository at this point in the history
Signed-off-by: Ivan Milchev <[email protected]>
  • Loading branch information
imilchev committed Feb 20, 2024
1 parent 4e41f00 commit 4d5db9a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion providers/builtin.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 1 addition & 3 deletions providers/mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ var mockProvider = Provider{
}

type mockProviderService struct {
coordinator ProvidersCoordinator
initialized bool
runtime *Runtime
}
Expand Down Expand Up @@ -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()
}

0 comments on commit 4d5db9a

Please sign in to comment.