浏览代码

stackdriver: add default value for authentication type

Erik Sundell 7 年之前
父节点
当前提交
cd7b454e25
共有 2 个文件被更改,包括 2 次插入2 次删除
  1. 1 1
      pkg/api/pluginproxy/ds_auth_provider.go
  2. 1 1
      pkg/tsdb/stackdriver/test_datasource_query.go

+ 1 - 1
pkg/api/pluginproxy/ds_auth_provider.go

@@ -55,7 +55,7 @@ func ApplyRoute(ctx context.Context, req *http.Request, proxyPath string, route
 		}
 	}
 
-	authenticationType := ds.JsonData.Get("authenticationType").MustString()
+	authenticationType := ds.JsonData.Get("authenticationType").MustString("jwt")
 	if route.JwtTokenAuth != nil && authenticationType == "jwt" {
 		logger.Info("authenticationType", "authenticationType", "jwt")
 		if token, err := tokenProvider.getJwtAccessToken(ctx, data); err != nil {

+ 1 - 1
pkg/tsdb/stackdriver/test_datasource_query.go

@@ -17,7 +17,7 @@ import (
 )
 
 func (e *StackdriverExecutor) executeTestDataSource(ctx context.Context, tsdbQuery *tsdb.TsdbQuery) (*tsdb.Response, error) {
-	authenticationType := e.dsInfo.JsonData.Get("authenticationType").MustString()
+	authenticationType := e.dsInfo.JsonData.Get("authenticationType").MustString("jwt")
 	if authenticationType == "gce" {
 		defaultProject, err := e.getDefaultProject(ctx)
 		if err != nil {