Skip to content

Commit

Permalink
Added TimeoutSeconds to knative-serving trait
Browse files Browse the repository at this point in the history
  • Loading branch information
hernanDatgDev committed Jun 17, 2024
1 parent 736910c commit 99c40fc
Show file tree
Hide file tree
Showing 15 changed files with 128 additions and 0 deletions.
10 changes: 10 additions & 0 deletions docs/modules/ROOT/partials/apis/camel-k-crds.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -7619,6 +7619,16 @@ Automatically deploy the integration as Knative service when all conditions hold
* Integration is using the Knative profile
* All routes are either starting from an HTTP based consumer or a passive consumer (e.g. `direct` is a passive consumer)
|`timeoutSeconds` +
int64
|
The maximum duration in seconds that the request instance is allowed to respond to a request.
This field propagates to the integration pod's terminationGracePeriodSeconds
Refer to the Knative documentation for more information.
|===
Expand Down
7 changes: 7 additions & 0 deletions docs/modules/traits/pages/knative-service.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,13 @@ Refer to the Knative documentation for more information.
* Integration is using the Knative profile
* All routes are either starting from an HTTP based consumer or a passive consumer (e.g. `direct` is a passive consumer)

| knative-service.timeout-seconds
| int64
| The maximum duration in seconds that the request instance is allowed to respond to a request.
This field propagates to the integration pod's terminationGracePeriodSeconds

Refer to the Knative documentation for more information.

|===

// End of autogenerated code - DO NOT EDIT! (configuration)
14 changes: 14 additions & 0 deletions helm/camel-k/crds/crd-integration-platform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1496,6 +1496,13 @@ spec:
default and must be expressed as a Golang `time.Duration`
string representation, rounded to a second precision.
type: string
timeoutSeconds:
description: "The maximum duration in seconds that the request
instance is allowed to respond to a request. This field
propagates to the integration pod's terminationGracePeriodSeconds
\n Refer to the Knative documentation for more information."
format: int64
type: integer
visibility:
description: "Setting `cluster-local`, Knative service becomes
a private service. Specifically, this option applies the
Expand Down Expand Up @@ -3510,6 +3517,13 @@ spec:
default and must be expressed as a Golang `time.Duration`
string representation, rounded to a second precision.
type: string
timeoutSeconds:
description: "The maximum duration in seconds that the request
instance is allowed to respond to a request. This field
propagates to the integration pod's terminationGracePeriodSeconds
\n Refer to the Knative documentation for more information."
format: int64
type: integer
visibility:
description: "Setting `cluster-local`, Knative service becomes
a private service. Specifically, this option applies the
Expand Down
14 changes: 14 additions & 0 deletions helm/camel-k/crds/crd-integration-profile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1373,6 +1373,13 @@ spec:
default and must be expressed as a Golang `time.Duration`
string representation, rounded to a second precision.
type: string
timeoutSeconds:
description: "The maximum duration in seconds that the request
instance is allowed to respond to a request. This field
propagates to the integration pod's terminationGracePeriodSeconds
\n Refer to the Knative documentation for more information."
format: int64
type: integer
visibility:
description: "Setting `cluster-local`, Knative service becomes
a private service. Specifically, this option applies the
Expand Down Expand Up @@ -3270,6 +3277,13 @@ spec:
default and must be expressed as a Golang `time.Duration`
string representation, rounded to a second precision.
type: string
timeoutSeconds:
description: "The maximum duration in seconds that the request
instance is allowed to respond to a request. This field
propagates to the integration pod's terminationGracePeriodSeconds
\n Refer to the Knative documentation for more information."
format: int64
type: integer
visibility:
description: "Setting `cluster-local`, Knative service becomes
a private service. Specifically, this option applies the
Expand Down
7 changes: 7 additions & 0 deletions helm/camel-k/crds/crd-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7437,6 +7437,13 @@ spec:
default and must be expressed as a Golang `time.Duration`
string representation, rounded to a second precision.
type: string
timeoutSeconds:
description: "The maximum duration in seconds that the request
instance is allowed to respond to a request. This field
propagates to the integration pod's terminationGracePeriodSeconds
\n Refer to the Knative documentation for more information."
format: int64
type: integer
visibility:
description: "Setting `cluster-local`, Knative service becomes
a private service. Specifically, this option applies the
Expand Down
7 changes: 7 additions & 0 deletions helm/camel-k/crds/crd-kamelet-binding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7730,6 +7730,13 @@ spec:
`time.Duration` string representation, rounded to a
second precision.
type: string
timeoutSeconds:
description: "The maximum duration in seconds that the
request instance is allowed to respond to a request.
This field propagates to the integration pod's terminationGracePeriodSeconds
\n Refer to the Knative documentation for more information."
format: int64
type: integer
visibility:
description: "Setting `cluster-local`, Knative service
becomes a private service. Specifically, this option
Expand Down
7 changes: 7 additions & 0 deletions helm/camel-k/crds/crd-pipe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7728,6 +7728,13 @@ spec:
`time.Duration` string representation, rounded to a
second precision.
type: string
timeoutSeconds:
description: "The maximum duration in seconds that the
request instance is allowed to respond to a request.
This field propagates to the integration pod's terminationGracePeriodSeconds
\n Refer to the Knative documentation for more information."
format: int64
type: integer
visibility:
description: "Setting `cluster-local`, Knative service
becomes a private service. Specifically, this option
Expand Down
5 changes: 5 additions & 0 deletions pkg/apis/camel/v1/trait/knative_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,9 @@ type KnativeServiceTrait struct {
// * Integration is using the Knative profile
// * All routes are either starting from an HTTP based consumer or a passive consumer (e.g. `direct` is a passive consumer)
Auto *bool `property:"auto" json:"auto,omitempty"`
// The maximum duration in seconds that the request instance is allowed to respond to a request.
// This field propagates to the integration pod's terminationGracePeriodSeconds
//
// Refer to the Knative documentation for more information.
TimeoutSeconds *int64 `property:"timeout-seconds" json:"timeoutSeconds,omitempty"`
}
5 changes: 5 additions & 0 deletions pkg/apis/camel/v1/trait/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -1496,6 +1496,13 @@ spec:
default and must be expressed as a Golang `time.Duration`
string representation, rounded to a second precision.
type: string
timeoutSeconds:
description: "The maximum duration in seconds that the request
instance is allowed to respond to a request. This field
propagates to the integration pod's terminationGracePeriodSeconds
\n Refer to the Knative documentation for more information."
format: int64
type: integer
visibility:
description: "Setting `cluster-local`, Knative service becomes
a private service. Specifically, this option applies the
Expand Down Expand Up @@ -3510,6 +3517,13 @@ spec:
default and must be expressed as a Golang `time.Duration`
string representation, rounded to a second precision.
type: string
timeoutSeconds:
description: "The maximum duration in seconds that the request
instance is allowed to respond to a request. This field
propagates to the integration pod's terminationGracePeriodSeconds
\n Refer to the Knative documentation for more information."
format: int64
type: integer
visibility:
description: "Setting `cluster-local`, Knative service becomes
a private service. Specifically, this option applies the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1373,6 +1373,13 @@ spec:
default and must be expressed as a Golang `time.Duration`
string representation, rounded to a second precision.
type: string
timeoutSeconds:
description: "The maximum duration in seconds that the request
instance is allowed to respond to a request. This field
propagates to the integration pod's terminationGracePeriodSeconds
\n Refer to the Knative documentation for more information."
format: int64
type: integer
visibility:
description: "Setting `cluster-local`, Knative service becomes
a private service. Specifically, this option applies the
Expand Down Expand Up @@ -3270,6 +3277,13 @@ spec:
default and must be expressed as a Golang `time.Duration`
string representation, rounded to a second precision.
type: string
timeoutSeconds:
description: "The maximum duration in seconds that the request
instance is allowed to respond to a request. This field
propagates to the integration pod's terminationGracePeriodSeconds
\n Refer to the Knative documentation for more information."
format: int64
type: integer
visibility:
description: "Setting `cluster-local`, Knative service becomes
a private service. Specifically, this option applies the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7437,6 +7437,13 @@ spec:
default and must be expressed as a Golang `time.Duration`
string representation, rounded to a second precision.
type: string
timeoutSeconds:
description: "The maximum duration in seconds that the request
instance is allowed to respond to a request. This field
propagates to the integration pod's terminationGracePeriodSeconds
\n Refer to the Knative documentation for more information."
format: int64
type: integer
visibility:
description: "Setting `cluster-local`, Knative service becomes
a private service. Specifically, this option applies the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7730,6 +7730,13 @@ spec:
`time.Duration` string representation, rounded to a
second precision.
type: string
timeoutSeconds:
description: "The maximum duration in seconds that the
request instance is allowed to respond to a request.
This field propagates to the integration pod's terminationGracePeriodSeconds
\n Refer to the Knative documentation for more information."
format: int64
type: integer
visibility:
description: "Setting `cluster-local`, Knative service
becomes a private service. Specifically, this option
Expand Down
7 changes: 7 additions & 0 deletions pkg/resources/config/crd/bases/camel.apache.org_pipes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7728,6 +7728,13 @@ spec:
`time.Duration` string representation, rounded to a
second precision.
type: string
timeoutSeconds:
description: "The maximum duration in seconds that the
request instance is allowed to respond to a request.
This field propagates to the integration pod's terminationGracePeriodSeconds
\n Refer to the Knative documentation for more information."
format: int64
type: integer
visibility:
description: "Setting `cluster-local`, Knative service
becomes a private service. Specifically, this option
Expand Down
3 changes: 3 additions & 0 deletions pkg/trait/knative_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,9 @@ func (t *knativeServiceTrait) getServiceFor(e *Environment) (*serving.Service, e
},
}

if t.TimeoutSeconds != nil {
svc.Spec.ConfigurationSpec.Template.Spec.TimeoutSeconds = t.TimeoutSeconds
}
replicas := e.Integration.Spec.Replicas

isUpdateRequired := false
Expand Down

0 comments on commit 99c40fc

Please sign in to comment.