瀏覽代碼

Stacks image info hotfix (#3322)

Feroze Mohideen 2 年之前
父節點
當前提交
d1e512fd75

+ 7 - 3
dashboard/src/main/home/app-dashboard/expanded-app/ExpandedApp.tsx

@@ -29,7 +29,7 @@ import { ChartType, CreateUpdatePorterAppOptions } from "shared/types";
 import BuildSettingsTab from "../build-settings/BuildSettingsTab";
 import Button from "components/porter/Button";
 import Services from "../new-app-flow/Services";
-import { Service } from "../new-app-flow/serviceTypes";
+import { ImageInfo, Service } from "../new-app-flow/serviceTypes";
 import Fieldset from "components/porter/Fieldset";
 import { PorterJson, createFinalPorterYaml } from "../new-app-flow/schema";
 import { KeyValueType } from "main/home/cluster-dashboard/env-groups/EnvGroupArray";
@@ -253,8 +253,12 @@ const ExpandedApp: React.FC<Props> = ({ ...props }) => {
       );
       setPorterYaml(finalPorterYaml);
       // Only check GHA status if no built image is set
-      const hasBuiltImage = !!resChartData.data.config?.global?.image
-        ?.repository;
+      const globalImage = resChartData.data.config?.global?.image
+      const hasBuiltImage = globalImage != null &&
+        globalImage.repository != null &&
+        globalImage.tag != null &&
+        globalImage.repository !== ImageInfo.BASE_IMAGE.repository &&
+        globalImage.tag !== ImageInfo.BASE_IMAGE.tag
       if (hasBuiltImage || !resPorterApp.data.repo_name) {
         setWorkflowCheckPassed(true);
         setHasBuiltImage(true);

+ 2 - 5
dashboard/src/main/home/app-dashboard/new-app-flow/NewAppFlow.tsx

@@ -25,7 +25,7 @@ import EnvGroupArray, { KeyValueType } from "main/home/cluster-dashboard/env-gro
 import GithubActionModal from "./GithubActionModal";
 import Error from "components/porter/Error";
 import { PorterJson, PorterYamlSchema, createFinalPorterYaml } from "./schema";
-import { Service } from "./serviceTypes";
+import { ImageInfo, Service } from "./serviceTypes";
 import GithubConnectModal from "./GithubConnectModal";
 import Link from "components/porter/Link";
 import { BuildMethod, PorterApp } from "../types/porterApp";
@@ -322,10 +322,7 @@ const NewAppFlow: React.FC<Props> = ({ ...props }) => {
 
       const yamlString = yaml.dump(finalPorterYaml);
       const base64Encoded = btoa(yamlString);
-      const imageInfo = {
-        repository: "",
-        tag: "",
-      };
+      const imageInfo: ImageInfo = ImageInfo.BASE_IMAGE;
 
       const porterAppRequest = {
         porter_yaml: base64Encoded,

+ 12 - 0
dashboard/src/main/home/app-dashboard/new-app-flow/serviceTypes.ts

@@ -3,6 +3,18 @@ import { overrideObjectValues } from "./utils";
 import { KeyValueType } from "main/home/cluster-dashboard/env-groups/EnvGroupArray";
 import { PorterJson } from "./schema";
 
+export type ImageInfo = {
+    repository: string;
+    tag: string;
+}
+export const ImageInfo = {
+    BASE_IMAGE: {
+        repository: "public.ecr.aws/o1j4x7p4/hello-porter",
+        tag: "latest",
+    } as const,
+}
+
+
 export type Service = WorkerService | WebService | JobService | ReleaseService;
 export type ServiceType = 'web' | 'worker' | 'job' | 'release';