Просмотр исходного кода

Merge branch 'master' into beta.3.integration-frontend

jusrhee 5 лет назад
Родитель
Сommit
7c7bf61789

+ 4 - 1
dashboard/src/main/home/Home.tsx

@@ -2,6 +2,7 @@ import React, { Component } from 'react';
 import posthog from 'posthog-js';
 import styled from 'styled-components';
 import ReactModal from 'react-modal';
+import * as FullStory from '@fullstory/browser';
 
 import { Context } from '../../shared/Context';
 import api from '../../shared/api';
@@ -90,12 +91,14 @@ export default class Home extends Component<PropsType, StateType> {
   }
 
   componentDidMount() {
+    console.log('newest release')
     let { user } = this.context;
     window.location.href.indexOf('127.0.0.1') === -1 && posthog.init(process.env.POSTHOG_API_KEY, {
       api_host: process.env.POSTHOG_HOST,
-      loaded: function(posthog: any) { posthog.identify(user.email) }
+      loaded: function(posthog) { posthog.identify(user.email) }
     })
 
+    FullStory.identify(user.email)
     this.getProjects();
   }
 

+ 0 - 1
dashboard/src/main/home/cluster-dashboard/expanded-chart/status/Logs.tsx

@@ -49,7 +49,6 @@ export default class Logs extends Component<PropsType, StateType> {
     let { currentCluster, currentProject } = this.context;
     let { selectedPod } = this.props;
     if (!selectedPod.metadata?.name) return
-
     let protocol = process.env.NODE_ENV == 'production' ? 'wss' : 'ws'
     this.ws = new WebSocket(`${protocol}://${process.env.API_SERVER}/api/projects/${currentProject.id}/k8s/${selectedPod?.metadata?.namespace}/pod/${selectedPod?.metadata?.name}/logs?cluster_id=${currentCluster.id}&service_account_id=${currentCluster.service_account_id}`)
 

+ 9 - 7
internal/helm/postrenderer.go

@@ -266,14 +266,15 @@ func (d *DockerSecretsPostRenderer) updatePodSpecs(secrets map[string]string) {
 			continue
 		}
 
-		var imagePullSecrets []map[string]interface{}
-		existingNames := map[string]bool{}
+		imagePullSecrets := make([]map[string]interface{}, 0)
+
 		if existingPullSecrets, ok := podSpec["imagePullSecrets"]; ok {
-			imagePullSecrets = existingPullSecrets.([]map[string]interface{})
-			for _, s := range imagePullSecrets {
+			existing := existingPullSecrets.([]map[string]interface{})
+
+			for _, s := range existing {
 				if name, ok := s["name"]; ok {
-					if n, ok := name.(string); ok {
-						existingNames[n] = true
+					if n, ok := name.(string); ok && n != "" {
+						imagePullSecrets = append(imagePullSecrets, s)
 					}
 				}
 			}
@@ -311,9 +312,10 @@ func (d *DockerSecretsPostRenderer) updatePodSpecs(secrets map[string]string) {
 				"name": secrets[regName],
 			})
 		}
-
 		if len(imagePullSecrets) > 0 {
 			podSpec["imagePullSecrets"] = imagePullSecrets
+		} else {
+			podSpec["imagePullSecrets"] = nil
 		}
 
 	}

+ 1 - 0
internal/kubernetes/agent.go

@@ -160,6 +160,7 @@ func (a *Agent) GetPodLogs(namespace string, name string, conn *websocket.Conn)
 				return
 			default:
 			}
+
 			bytes, err := r.ReadBytes('\n')
 			if writeErr := conn.WriteMessage(websocket.TextMessage, bytes); writeErr != nil {
 				errorchan <- writeErr

+ 1 - 0
server/api/release_handler.go

@@ -437,6 +437,7 @@ func (app *App) HandleGetReleaseToken(w http.ResponseWriter, r *http.Request) {
 
 // HandleUpgradeRelease upgrades a release with new values.yaml
 func (app *App) HandleUpgradeRelease(w http.ResponseWriter, r *http.Request) {
+	fmt.Println("=========================================UPGRADE RELEASE============================================")
 	projID, err := strconv.ParseUint(chi.URLParam(r, "project_id"), 0, 64)
 
 	if err != nil || projID == 0 {