Skip to content

Commit 465657a

Browse files
committed
Avoids variable-package name conflict
1 parent 60a1c15 commit 465657a

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

internal/api/api.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,12 +176,13 @@ func CreateOrUpdateFunction(c echo.Context) error {
176176

177177
// Check that the selected runtime exists
178178
if f.Runtime != container.CUSTOM_RUNTIME {
179-
runtime, ok := container.RuntimeToInfo[f.Runtime]
179+
selectedRuntime, ok := container.RuntimeToInfo[f.Runtime]
180180
if !ok {
181-
return c.JSON(http.StatusNotFound, "Invalid runtime.")
181+
log.Printf("User indicated unknown runtime: %s\n", f.Runtime)
182+
return c.String(http.StatusNotFound, "Invalid runtime.")
182183
}
183184
f.SupportedArchs = []string{container.X86, container.ARM}
184-
if f.MaxConcurrency > 1 && !runtime.ConcurrencySupported {
185+
if f.MaxConcurrency > 1 && !selectedRuntime.ConcurrencySupported {
185186
log.Printf("Forcing max concurrency = 1 for runtime %s\n", f.Runtime)
186187
f.MaxConcurrency = 1
187188
}

internal/container/runtimes.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,10 @@ var refreshedImages = map[string]bool{}
1616

1717
var RuntimeToInfo = map[string]RuntimeInfo{
1818
"python314": {"fmuschera/serverledge-python314", []string{"python", "/entrypoint.py"}, true, []string{X86, ARM}},
19-
"python-numpy": {"fmuschera/serverledge-python-numpy", []string{"python", "/entrypoint.py"}, true, []string{X86, ARM}},
2019
"nodejs17ng": {"fmuschera/serverledge-nodejs17ng", []string{}, false, []string{X86, ARM}},
2120
"java21": {"fmuschera/serverledge-java21", []string{}, false, []string{X86, ARM}},
2221
"go125": {"fmuschera/serverledge-go125", []string{"/entrypoint.sh"}, true, []string{X86, ARM}},
23-
"go125-bench": {"fmuschera/serverledge-go-bench", []string{"/entrypoint.sh"}, true, []string{X86, ARM}},
22+
"python-numpy": {"fmuschera/serverledge-python-numpy", []string{"python", "/entrypoint.py"}, true, []string{X86, ARM}},
2423
"python312ml": {"fmuschera/serverledge-python312ml", []string{"python", "/entrypoint.py"}, true, []string{X86, ARM}},
2524
}
2625

0 commit comments

Comments
 (0)