Add method and subpath flags to timetrigger object for triggering a function (#3017)

* Update timetrigger crd and add method and subpath fields in spec.
Update fission-cli to accept user input for method and subpath fields.
Update publisher package to utilize these fields for triggering a function.
Update timer controller to use method and subpath fields for publishing a request.
Add a new test TestPublisherSubpath in pulisher package.

Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>

* Use kubebuilder default annotation.
Update test for fission-cli timetrigger create, update command to support method and subpath flags.

Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>

---------

Signed-off-by: Md Soharab Ansari <soharab.ansari@infracloud.io>
This commit is contained in:
soharab-ic
2024-09-16 17:15:54 +05:30
committed by GitHub
parent 5d580e01aa
commit 93869d3bc8
16 changed files with 107 additions and 14 deletions
+11
View File
@@ -821,6 +821,17 @@ type (
// The reference to function
FunctionReference `json:"functionref"`
// HTTP Method for trigger, ex : GET, POST, PUT, DELETE, HEAD (default: "POST")
// +kubebuilder:default:="POST"
// +optional
Method string `json:"method,omitempty"`
// Subpath to trigger a specific route if function
// internally supports routing, (default: "/")
// +kubebuilder:default:="/"
// +optional
Subpath string `json:"subpath,omitempty"`
}
// FailureType refers to the type of failure
FailureType string
@@ -428,6 +428,8 @@ var map_TimeTriggerSpec = map[string]string{
"": "TimeTriggerSpec invokes the specific function at a time or times specified by a cron string.",
"cron": "Cron schedule",
"functionref": "The reference to function",
"method": "HTTP Method for trigger, ex : GET, POST, PUT, DELETE, HEAD (default: \"POST\")",
"subpath": "Subpath to trigger a specific route if function internally supports routing, (default: \"/\")",
}
func (TimeTriggerSpec) SwaggerDoc() map[string]string {