plugins: Don't exit on duplicate plugin (#28390)

* plugins: Don't exit on duplicate plugin

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Add missing files

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* Fix test

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
This commit is contained in:
Arve Knudsen
2020-10-21 12:39:41 +02:00
committed by GitHub
parent 13e67660f5
commit 4084b53f91
8 changed files with 73 additions and 7 deletions
+1 -1
View File
@@ -21,7 +21,7 @@ type URLValidationError struct {
// Error returns the error message.
func (e URLValidationError) Error() string {
return fmt.Sprintf("Validation of data source URL %q failed: %s", e.URL, e.Err.Error())
return fmt.Sprintf("validation of data source URL %q failed: %s", e.URL, e.Err.Error())
}
// Unwrap returns the wrapped error.
+1 -1
View File
@@ -585,7 +585,7 @@ func TestNewDataSourceProxy_InvalidURL(t *testing.T) {
plugin := plugins.DataSourcePlugin{}
_, err := NewDataSourceProxy(&ds, &plugin, &ctx, "api/method", &cfg)
require.Error(t, err)
assert.True(t, strings.HasPrefix(err.Error(), `Validation of data source URL "://host/root" failed`))
assert.True(t, strings.HasPrefix(err.Error(), `validation of data source URL "://host/root" failed`))
}
func TestNewDataSourceProxy_ProtocolLessURL(t *testing.T) {