Skip to content

Commit 74266f0

Browse files
committed
1 parent 9f57a81 commit 74266f0

2 files changed

Lines changed: 5 additions & 30 deletions

File tree

polycode/env.go

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package polycode
33
import (
44
"fmt"
55
"gopkg.in/ini.v1"
6-
"log"
76
"os"
87
)
98

@@ -44,19 +43,9 @@ func initClientEnv() {
4443

4544
loadIni()
4645

47-
orgId := os.Getenv("polycode_ORG_ID")
48-
if orgId == "" {
49-
log.Fatal("sidecar: org id not provided")
50-
}
51-
52-
envId := os.Getenv("polycode_ENV_ID")
53-
if envId == "" {
54-
log.Fatal("sidecar: env id not provided")
55-
}
56-
5746
appName := os.Getenv("polycode_APP_NAME")
5847
if appName == "" {
59-
log.Fatal("sidecar: app name not provided")
48+
appName = "overridden"
6049
}
6150

6251
appPortStr := os.Getenv("polycode_APP_PORT")
@@ -71,15 +60,8 @@ func initClientEnv() {
7160
}
7261

7362
clientEnv = &ClientEnv{
74-
OrgId: os.Getenv("polycode_ORG_ID"),
75-
EnvId: os.Getenv("polycode_ENV_ID"),
76-
AppName: os.Getenv("polycode_APP_NAME"),
77-
AppPort: appPort,
78-
WorkflowTableName: "polycode-workflows",
79-
LogTableName: "polycode-logs",
80-
DataTableName: fmt.Sprintf("polycode-%s-%s-data", envId, appName),
81-
GlobalDataTableName: fmt.Sprintf("polycode-%s-data", envId),
82-
FileStorePath: fmt.Sprintf("polycode-%s-%s-files", orgId, envId),
63+
AppName: os.Getenv("polycode_APP_NAME"),
64+
AppPort: appPort,
8365
}
8466
}
8567

polycode/model.go

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -105,15 +105,8 @@ type MethodDescription struct {
105105
}
106106

107107
type ClientEnv struct {
108-
OrgId string `json:"orgId"`
109-
EnvId string `json:"envId"`
110-
AppName string `json:"appName"`
111-
AppPort uint `json:"appPort"`
112-
WorkflowTableName string `json:"workflowTableName"`
113-
LogTableName string `json:"logTableName"`
114-
FileStorePath string `json:"fileStorePath"`
115-
DataTableName string `json:"dataTableName"`
116-
GlobalDataTableName string `json:"globalDataTableName"`
108+
AppName string `json:"appName"`
109+
AppPort uint `json:"appPort"`
117110
}
118111

119112
type ContextMeta struct {

0 commit comments

Comments
 (0)