Przeglądaj źródła

[POR-1868] remove launcher when converting to client service (#3862)

Feroze Mohideen 2 lat temu
rodzic
commit
231901578d
1 zmienionych plików z 10 dodań i 0 usunięć
  1. 10 0
      dashboard/src/lib/porter-apps/services.ts

+ 10 - 0
dashboard/src/lib/porter-apps/services.ts

@@ -21,6 +21,8 @@ import {
 } from "./values";
 import _ from "lodash";
 
+const LAUNCHER_PREFIX = "/cnb/lifecycle/launcher ";
+
 export type DetectedServices = {
   services: ClientService[];
   predeploy?: ClientService;
@@ -330,6 +332,14 @@ export function deserializeService({
     ingressAnnotationDeletions: [],
   };
 
+  if (!baseService.run.readOnly && baseService.run.value.startsWith(LAUNCHER_PREFIX)) {
+    // trim launcher prefix from run command
+    baseService.run = ServiceField.string(
+      baseService.run.value.substring(LAUNCHER_PREFIX.length),
+      override?.run
+    );
+  }
+
   return match(service.config)
     .with({ type: "web" }, (config) => {
       const overrideWebConfig =