浏览代码

Patch add-on canonical name (#3175)

Stefan McShane 2 年之前
父节点
当前提交
ba13a6af41
共有 2 个文件被更改,包括 13 次插入11 次删除
  1. 2 1
      api/server/handlers/namespace/list_releases.go
  2. 11 10
      internal/kubernetes/config.go

+ 2 - 1
api/server/handlers/namespace/list_releases.go

@@ -69,7 +69,8 @@ func (c *ListReleasesHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
 
 	for _, helmRel := range releases {
 		release := types.Release{
-			Release: helmRel,
+			Release:       helmRel,
+			PorterRelease: &types.PorterRelease{},
 		}
 
 		telemetry.WithAttributes(span,

+ 11 - 10
internal/kubernetes/config.go

@@ -245,32 +245,33 @@ type OutOfClusterConfig struct {
 // TODO: this should be split out from OutOfClusterConfig, and implemented separately in order to wrap the kubernetes RESTGetter interface.
 // Until then, we lose context propagation on all these calls
 func (conf *OutOfClusterConfig) ToRESTConfig() (*rest.Config, error) {
-	ctx, span := telemetry.NewSpan(context.Background(), "ooc-to-rest-config")
-	defer span.End()
+	ctx := context.Background()
+	// ctx, span := telemetry.NewSpan(context.Background(), "ooc-to-rest-config")
+	// defer span.End()
 
-	telemetry.WithAttributes(span,
-		telemetry.AttributeKV{Key: "cluster-id", Value: conf.Cluster.ID},
-		telemetry.AttributeKV{Key: "project-id", Value: conf.Cluster.ProjectID},
-	)
+	// telemetry.WithAttributes(span,
+	// 	telemetry.AttributeKV{Key: "cluster-id", Value: conf.Cluster.ID},
+	// 	telemetry.AttributeKV{Key: "project-id", Value: conf.Cluster.ProjectID},
+	// )
 
 	if conf.Cluster.ProvisionedBy == "CAPI" {
-		telemetry.WithAttributes(span, telemetry.AttributeKV{Key: "capi-provisioned", Value: true})
+		// telemetry.WithAttributes(span, telemetry.AttributeKV{Key: "capi-provisioned", Value: true})
 
 		rc, err := restConfigForCAPICluster(ctx, conf.CAPIManagementClusterClient, *conf.Cluster)
 		if err != nil {
-			return nil, telemetry.Error(ctx, span, err, "error getting config for capi cluster")
+			return nil, fmt.Errorf("error getting config for capi cluster: %w", err)
 		}
 		return rc, nil
 	}
 
 	cmdConf, err := conf.GetClientConfigFromCluster(ctx)
 	if err != nil {
-		return nil, telemetry.Error(ctx, span, err, "error getting client config from cluster")
+		return nil, fmt.Errorf("error getting client config from cluster: %w", err)
 	}
 
 	restConf, err := cmdConf.ClientConfig()
 	if err != nil {
-		return nil, telemetry.Error(ctx, span, err, "error getting client config")
+		return nil, fmt.Errorf("error getting client config: %w", err)
 	}
 
 	restConf.Timeout = conf.Timeout