Skip to content

Commit

Permalink
feat: knative service trait annotation support (apache#4729)
Browse files Browse the repository at this point in the history
* feat: annotation support for knative svc trait

* doc: annotation documentation

* chore: test fix, annotation append, doc edit

* chore: generated docs

---------

Co-authored-by: Martin Olsiak <[email protected]>
  • Loading branch information
2 people authored and squakez committed Oct 11, 2023
1 parent 4b7300a commit f4561fd
Show file tree
Hide file tree
Showing 28 changed files with 433 additions and 209 deletions.
7 changes: 5 additions & 2 deletions addons/strimzi/duck/client/internalclientset/clientset.go

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

21 changes: 0 additions & 21 deletions addons/strimzi/duck/client/internalclientset/doc.go

This file was deleted.

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

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

30 changes: 30 additions & 0 deletions config/crd/bases/camel.apache.org_integrationplatforms.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1165,6 +1165,13 @@ spec:
knative-service:
description: The configuration of Knative Service trait
properties:
annotations:
additionalProperties:
type: string
description: 'The annotations added to route. This can be
used to set knative service specific annotations CLI usage
example: -t "knative-service.annotations.''haproxy.router.openshift.io/balance''=true"'
type: object
auto:
description: "Automatically deploy the integration as Knative
service when all conditions hold: \n * Integration is using
Expand Down Expand Up @@ -1504,6 +1511,14 @@ spec:
route:
description: The configuration of Route trait
properties:
annotations:
additionalProperties:
type: string
description: 'The annotations added to route. This can be
used to set route specific annotations For annotations options
see https://docs.openshift.com/container-platform/3.11/architecture/networking/routes.html#route-specific-annotations
CLI usage example: -t "route.annotations.''haproxy.router.openshift.io/balance''=true"'
type: object
configuration:
description: 'Legacy trait configuration parameters. Deprecated:
for backward compatibility.'
Expand Down Expand Up @@ -2811,6 +2826,13 @@ spec:
knative-service:
description: The configuration of Knative Service trait
properties:
annotations:
additionalProperties:
type: string
description: 'The annotations added to route. This can be
used to set knative service specific annotations CLI usage
example: -t "knative-service.annotations.''haproxy.router.openshift.io/balance''=true"'
type: object
auto:
description: "Automatically deploy the integration as Knative
service when all conditions hold: \n * Integration is using
Expand Down Expand Up @@ -3150,6 +3172,14 @@ spec:
route:
description: The configuration of Route trait
properties:
annotations:
additionalProperties:
type: string
description: 'The annotations added to route. This can be
used to set route specific annotations For annotations options
see https://docs.openshift.com/container-platform/3.11/architecture/networking/routes.html#route-specific-annotations
CLI usage example: -t "route.annotations.''haproxy.router.openshift.io/balance''=true"'
type: object
configuration:
description: 'Legacy trait configuration parameters. Deprecated:
for backward compatibility.'
Expand Down
15 changes: 15 additions & 0 deletions config/crd/bases/camel.apache.org_integrations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6851,6 +6851,13 @@ spec:
knative-service:
description: The configuration of Knative Service trait
properties:
annotations:
additionalProperties:
type: string
description: 'The annotations added to route. This can be
used to set knative service specific annotations CLI usage
example: -t "knative-service.annotations.''haproxy.router.openshift.io/balance''=true"'
type: object
auto:
description: "Automatically deploy the integration as Knative
service when all conditions hold: \n * Integration is using
Expand Down Expand Up @@ -7190,6 +7197,14 @@ spec:
route:
description: The configuration of Route trait
properties:
annotations:
additionalProperties:
type: string
description: 'The annotations added to route. This can be
used to set route specific annotations For annotations options
see https://docs.openshift.com/container-platform/3.11/architecture/networking/routes.html#route-specific-annotations
CLI usage example: -t "route.annotations.''haproxy.router.openshift.io/balance''=true"'
type: object
configuration:
description: 'Legacy trait configuration parameters. Deprecated:
for backward compatibility.'
Expand Down
15 changes: 15 additions & 0 deletions config/crd/bases/camel.apache.org_kameletbindings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7140,6 +7140,13 @@ spec:
knative-service:
description: The configuration of Knative Service trait
properties:
annotations:
additionalProperties:
type: string
description: 'The annotations added to route. This can
be used to set knative service specific annotations
CLI usage example: -t "knative-service.annotations.''haproxy.router.openshift.io/balance''=true"'
type: object
auto:
description: "Automatically deploy the integration as
Knative service when all conditions hold: \n * Integration
Expand Down Expand Up @@ -7483,6 +7490,14 @@ spec:
route:
description: The configuration of Route trait
properties:
annotations:
additionalProperties:
type: string
description: 'The annotations added to route. This can
be used to set route specific annotations For annotations
options see https://docs.openshift.com/container-platform/3.11/architecture/networking/routes.html#route-specific-annotations
CLI usage example: -t "route.annotations.''haproxy.router.openshift.io/balance''=true"'
type: object
configuration:
description: 'Legacy trait configuration parameters. Deprecated:
for backward compatibility.'
Expand Down
9 changes: 9 additions & 0 deletions docs/modules/ROOT/partials/apis/camel-k-crds.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4846,6 +4846,15 @@ are only relevant when the Camel route(s) use(s) an HTTP endpoint consumer.
|`annotations` +
map[string]string
|
The annotations added to route.
This can be used to set knative service specific annotations
CLI usage example: -t "knative-service.annotations.'haproxy.router.openshift.io/balance'=true"
|`class` +
string
|
Expand Down
6 changes: 6 additions & 0 deletions docs/modules/traits/pages/knative-service.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ The following configuration options are available:
| bool
| Can be used to enable or disable a trait. All traits share this common property.

| knative-service.annotations
| map[string]string
| The annotations added to route.
This can be used to set knative service specific annotations
CLI usage example: -t "knative-service.annotations.'haproxy.router.openshift.io/balance'=true"

| knative-service.autoscaling-class
| string
| Configures the Knative autoscaling class property (e.g. to set `hpa.autoscaling.knative.dev` or `kpa.autoscaling.knative.dev` autoscaling).
Expand Down
7 changes: 7 additions & 0 deletions docs/modules/traits/pages/route.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ The following configuration options are available:
| bool
| Can be used to enable or disable a trait. All traits share this common property.

| route.annotations
| map[string]string
| The annotations added to route.
This can be used to set route specific annotations
For annotations options see https://docs.openshift.com/container-platform/3.11/architecture/networking/routes.html#route-specific-annotations
CLI usage example: -t "route.annotations.'haproxy.router.openshift.io/balance'=true"

| route.host
| string
| To configure the host exposed by the route.
Expand Down
30 changes: 30 additions & 0 deletions helm/camel-k/crds/crd-integration-platform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1165,6 +1165,13 @@ spec:
knative-service:
description: The configuration of Knative Service trait
properties:
annotations:
additionalProperties:
type: string
description: 'The annotations added to route. This can be
used to set knative service specific annotations CLI usage
example: -t "knative-service.annotations.''haproxy.router.openshift.io/balance''=true"'
type: object
auto:
description: "Automatically deploy the integration as Knative
service when all conditions hold: \n * Integration is using
Expand Down Expand Up @@ -1504,6 +1511,14 @@ spec:
route:
description: The configuration of Route trait
properties:
annotations:
additionalProperties:
type: string
description: 'The annotations added to route. This can be
used to set route specific annotations For annotations options
see https://docs.openshift.com/container-platform/3.11/architecture/networking/routes.html#route-specific-annotations
CLI usage example: -t "route.annotations.''haproxy.router.openshift.io/balance''=true"'
type: object
configuration:
description: 'Legacy trait configuration parameters. Deprecated:
for backward compatibility.'
Expand Down Expand Up @@ -2811,6 +2826,13 @@ spec:
knative-service:
description: The configuration of Knative Service trait
properties:
annotations:
additionalProperties:
type: string
description: 'The annotations added to route. This can be
used to set knative service specific annotations CLI usage
example: -t "knative-service.annotations.''haproxy.router.openshift.io/balance''=true"'
type: object
auto:
description: "Automatically deploy the integration as Knative
service when all conditions hold: \n * Integration is using
Expand Down Expand Up @@ -3150,6 +3172,14 @@ spec:
route:
description: The configuration of Route trait
properties:
annotations:
additionalProperties:
type: string
description: 'The annotations added to route. This can be
used to set route specific annotations For annotations options
see https://docs.openshift.com/container-platform/3.11/architecture/networking/routes.html#route-specific-annotations
CLI usage example: -t "route.annotations.''haproxy.router.openshift.io/balance''=true"'
type: object
configuration:
description: 'Legacy trait configuration parameters. Deprecated:
for backward compatibility.'
Expand Down
15 changes: 15 additions & 0 deletions helm/camel-k/crds/crd-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6851,6 +6851,13 @@ spec:
knative-service:
description: The configuration of Knative Service trait
properties:
annotations:
additionalProperties:
type: string
description: 'The annotations added to route. This can be
used to set knative service specific annotations CLI usage
example: -t "knative-service.annotations.''haproxy.router.openshift.io/balance''=true"'
type: object
auto:
description: "Automatically deploy the integration as Knative
service when all conditions hold: \n * Integration is using
Expand Down Expand Up @@ -7190,6 +7197,14 @@ spec:
route:
description: The configuration of Route trait
properties:
annotations:
additionalProperties:
type: string
description: 'The annotations added to route. This can be
used to set route specific annotations For annotations options
see https://docs.openshift.com/container-platform/3.11/architecture/networking/routes.html#route-specific-annotations
CLI usage example: -t "route.annotations.''haproxy.router.openshift.io/balance''=true"'
type: object
configuration:
description: 'Legacy trait configuration parameters. Deprecated:
for backward compatibility.'
Expand Down
15 changes: 15 additions & 0 deletions helm/camel-k/crds/crd-kamelet-binding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7140,6 +7140,13 @@ spec:
knative-service:
description: The configuration of Knative Service trait
properties:
annotations:
additionalProperties:
type: string
description: 'The annotations added to route. This can
be used to set knative service specific annotations
CLI usage example: -t "knative-service.annotations.''haproxy.router.openshift.io/balance''=true"'
type: object
auto:
description: "Automatically deploy the integration as
Knative service when all conditions hold: \n * Integration
Expand Down Expand Up @@ -7483,6 +7490,14 @@ spec:
route:
description: The configuration of Route trait
properties:
annotations:
additionalProperties:
type: string
description: 'The annotations added to route. This can
be used to set route specific annotations For annotations
options see https://docs.openshift.com/container-platform/3.11/architecture/networking/routes.html#route-specific-annotations
CLI usage example: -t "route.annotations.''haproxy.router.openshift.io/balance''=true"'
type: object
configuration:
description: 'Legacy trait configuration parameters. Deprecated:
for backward compatibility.'
Expand Down
4 changes: 4 additions & 0 deletions pkg/apis/camel/v1/trait/knative_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ package trait
// +camel-k:trait=knative-service.
type KnativeServiceTrait struct {
Trait `property:",squash" json:",inline"`
// The annotations added to route.
// This can be used to set knative service specific annotations
// CLI usage example: -t "knative-service.annotations.'haproxy.router.openshift.io/balance'=true"
Annotations map[string]string `property:"annotations" json:"annotations,omitempty"`
// Configures the Knative autoscaling class property (e.g. to set `hpa.autoscaling.knative.dev` or `kpa.autoscaling.knative.dev` autoscaling).
//
// Refer to the Knative documentation for more information.
Expand Down
Loading

0 comments on commit f4561fd

Please sign in to comment.