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

Merge pull request #2370 from porter-dev/master

Stage incidents tab hide
jusrhee 3 лет назад
Родитель
Сommit
e814a2ea52

+ 8 - 2
cli/cmd/connect/dockerhub.go

@@ -3,6 +3,7 @@ package connect
 import (
 	"context"
 	"fmt"
+	"strings"
 
 	"github.com/porter-dev/porter/api/types"
 
@@ -22,12 +23,17 @@ func Dockerhub(
 
 	// query for dockerhub name
 
-	repoName, err := utils.PromptPlaintext("Provide the Docker Hub organization name. For example, if your Docker Hub repository is 'myorg/myrepo', enter 'myorg'.\nName: ")
-
+	repoName, err := utils.PromptPlaintext("Provide the Docker Hub repository, in the form of ${org_name}/${repo_name}. For example, porter1/porter.\nRepository: ")
 	if err != nil {
 		return 0, err
 	}
 
+	orgRepo := strings.Split(repoName, "/")
+
+	if len(orgRepo) != 2 || orgRepo[0] == "" || orgRepo[1] == "" {
+		return 0, fmt.Errorf("invalid Docker Hub repository: %s", repoName)
+	}
+
 	username, err := utils.PromptPlaintext("Docker Hub username: ")
 
 	if err != nil {

+ 3 - 0
cli/cmd/deploy/create.go

@@ -438,6 +438,9 @@ func (c *CreateAgent) GetImageRepoURL(name, namespace string) (uint, string, err
 	if strings.Contains(imageURI, "pkg.dev") {
 		repoSlice := strings.Split(imageURI, "/")
 		imageURI = fmt.Sprintf("%s/%s", imageURI, repoSlice[len(repoSlice)-1])
+	} else if strings.Contains(imageURI, "index.docker.io") {
+		repoSlice := strings.Split(imageURI, "/")
+		imageURI = strings.Join(repoSlice[:len(repoSlice)-1], "/")
 	}
 
 	return regID, imageURI, nil

+ 2 - 0
dashboard/src/main/home/cluster-dashboard/expanded-chart/ExpandedChart.tsx

@@ -530,9 +530,11 @@ const ExpandedChart: React.FC<Props> = (props) => {
     let leftTabOptions = [] as any[];
     leftTabOptions.push({ label: "Status", value: "status" });
 
+    /* Temporarily disable incident detection
     if (!DisabledNamespacesForIncidents.includes(currentChart.namespace)) {
       leftTabOptions.push({ label: "Incidents", value: "incidents" });
     }
+    */
 
     if (props.isMetricsInstalled) {
       leftTabOptions.push({ label: "Metrics", value: "metrics" });

+ 1 - 1
dashboard/src/main/home/provisioner/ProvisionerSettings.tsx

@@ -27,7 +27,7 @@ type Props = {
   provisioner?: boolean;
 };
 
-const providers = ["aws", "gcp", "do"];
+const providers = ["aws", "gcp"];
 
 const ProvisionerSettings: React.FC<Props> = ({
   provisioner,