Skip to content

Commit bfc8fb2

Browse files
feat: add priority field to functions config (#529)
1 parent f0713b5 commit bfc8fb2

File tree

4 files changed

+9
-1
lines changed

4 files changed

+9
-1
lines changed

go/models/function_config.go

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

go/porcelain/deploy.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -822,12 +822,14 @@ func bundleFromManifest(ctx context.Context, manifestFile *os.File, observer Dep
822822
}
823823
}
824824

825-
if function.DisplayName != "" || function.Generator != "" || len(routes) > 0 || len(function.BuildData) > 0 {
825+
hasConfig := function.DisplayName != "" || function.Generator != "" || len(routes) > 0 || len(function.BuildData) > 0 || function.Priority != 0
826+
if hasConfig {
826827
functionsConfig[file.Name] = models.FunctionConfig{
827828
DisplayName: function.DisplayName,
828829
Generator: function.Generator,
829830
Routes: routes,
830831
BuildData: function.BuildData,
832+
Priority: int64(function.Priority),
831833
}
832834
}
833835

go/porcelain/functions_manifest.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ type functionsManifestEntry struct {
1818
BuildData map[string]interface{} `json:"buildData"`
1919
InvocationMode string `json:"invocationMode"`
2020
Routes []functionRoute `json:"routes"`
21+
Priority int `json:"priority"`
2122
}
2223

2324
type functionRoute struct {

swagger.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3714,6 +3714,8 @@ definitions:
37143714
type: array
37153715
items:
37163716
$ref: '#/definitions/functionRoute'
3717+
priority:
3718+
type: integer
37173719
functionRoute:
37183720
type: object
37193721
properties:

0 commit comments

Comments
 (0)