Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openfaas-faas
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Team Jaz CS 598 CCC Final Project
openfaas-faas
Commits
feb649be
Commit
feb649be
authored
3 years ago
by
Alex Ellis (OpenFaaS Ltd)
Browse files
Options
Downloads
Patches
Plain Diff
Turn off query for usage for invocations
Signed-off-by:
Alex Ellis (OpenFaaS Ltd)
<
alexellis2@gmail.com
>
parent
d85d5e72
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
gateway/plugin/external.go
+9
-1
9 additions, 1 deletion
gateway/plugin/external.go
gateway/types/handler_set.go
+3
-1
3 additions, 1 deletion
gateway/types/handler_set.go
with
12 additions
and
2 deletions
gateway/plugin/external.go
+
9
−
1
View file @
feb649be
...
...
@@ -25,6 +25,9 @@ type ExternalServiceQuery struct {
URL
url
.
URL
ProxyClient
http
.
Client
AuthInjector
middleware
.
AuthInjector
// IncludeUsage includes usage metrics in the response
IncludeUsage
bool
}
// NewExternalServiceQuery proxies service queries to external plugin via HTTP
...
...
@@ -49,6 +52,7 @@ func NewExternalServiceQuery(externalURL url.URL, authInjector middleware.AuthIn
URL
:
externalURL
,
ProxyClient
:
proxyClient
,
AuthInjector
:
authInjector
,
IncludeUsage
:
false
,
}
}
...
...
@@ -61,7 +65,11 @@ func (s ExternalServiceQuery) GetReplicas(serviceName, serviceNamespace string)
function
:=
types
.
FunctionStatus
{}
urlPath
:=
fmt
.
Sprintf
(
"%ssystem/function/%s?namespace=%s"
,
s
.
URL
.
String
(),
serviceName
,
serviceNamespace
)
urlPath
:=
fmt
.
Sprintf
(
"%ssystem/function/%s?namespace=%s&usage=%v"
,
s
.
URL
.
String
(),
serviceName
,
serviceNamespace
,
s
.
IncludeUsage
)
req
,
err
:=
http
.
NewRequest
(
http
.
MethodGet
,
urlPath
,
nil
)
if
err
!=
nil
{
...
...
This diff is collapsed.
Click to expand it.
gateway/types/handler_set.go
+
3
−
1
View file @
feb649be
...
...
@@ -15,7 +15,9 @@ type HandlerSet struct {
// ListFunctions lists all deployed functions in a namespace
ListFunctions
http
.
HandlerFunc
Alert
http
.
HandlerFunc
// Alert handles alerts triggered from AlertManager
Alert
http
.
HandlerFunc
// UpdateFunction updates an existing function
UpdateFunction
http
.
HandlerFunc
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment