Skip to content

Commit

Permalink
feat(crd): Add default value trait in CRDs when declared in doc
Browse files Browse the repository at this point in the history
  • Loading branch information
gansheer committed Oct 31, 2023
1 parent 221571f commit 8e06154
Show file tree
Hide file tree
Showing 42 changed files with 716 additions and 130 deletions.
3 changes: 3 additions & 0 deletions addons/master/master.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,16 @@ type Trait struct {
// When this flag is active, the operator analyzes the source code to add dependencies required by delegate endpoints.
// E.g. when using `master:lockname:timer`, then `camel:timer` is automatically added to the set of dependencies.
// It's enabled by default.
// +kubebuilder:default=true
IncludeDelegateDependencies *bool `property:"include-delegate-dependencies" json:"includeDelegateDependencies,omitempty"`
// Name of the configmap that will be used to store the lock. Defaults to "<integration-name>-lock".
// Name of the configmap/lease resource that will be used to store the lock. Defaults to "<integration-name>-lock".
ResourceName *string `property:"resource-name" json:"resourceName,omitempty"`
// Type of Kubernetes resource to use for locking ("ConfigMap" or "Lease"). Defaults to "Lease".
// +kubebuilder:default="Lease"
ResourceType *string `property:"resource-type" json:"resourceType,omitempty"`
// Label that will be used to identify all pods contending the lock. Defaults to "camel.apache.org/integration".
// +kubebuilder:default="camel.apache.org/integration"
LabelKey *string `property:"label-key" json:"labelKey,omitempty"`
// Label value that will be used to identify all pods contending the lock. Defaults to the integration name.
LabelValue *string `property:"label-value" json:"labelValue,omitempty"`
Expand Down
3 changes: 3 additions & 0 deletions addons/telemetry/telemetry.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,19 @@ import (
type Trait struct {
traitv1.Trait `property:",squash" json:",inline"`
// Enables automatic configuration of the trait, including automatic discovery of the telemetry endpoint.
// +kubebuilder:default=true
Auto *bool `property:"auto" json:"auto,omitempty"`
// The name of the service that publishes telemetry data (defaults to the integration name)
ServiceName string `property:"service-name" json:"serviceName,omitempty"`
// The target endpoint of the Telemetry service (automatically discovered by default)
Endpoint string `property:"endpoint" json:"endpoint,omitempty"`
// The sampler of the telemetry used for tracing (default "on")
// +kubebuilder:default="on"
Sampler string `property:"sampler" json:"sampler,omitempty"`
// The sampler ratio of the telemetry used for tracing
SamplerRatio string `property:"sampler-ratio" json:"sampler-ratio,omitempty"`
// The sampler of the telemetry used for tracing is parent based (default "true")
// +kubebuilder:default=true
SamplerParentBased *bool `property:"sampler-parent-based" json:"sampler-parent-based,omitempty"`
}

Expand Down
4 changes: 4 additions & 0 deletions addons/threescale/3scale.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,16 @@ type Trait struct {
// Enables automatic configuration of the trait.
Auto *bool `property:"auto" json:"auto,omitempty"`
// The scheme to use to contact the service (default `http`)
// +kubebuilder:default="http"
Scheme string `property:"scheme" json:"scheme,omitempty"`
// The path where the API is published (default `/`)
// +kubebuilder:default="/"
Path string `property:"path" json:"path,omitempty"`
// The port where the service is exposed (default `80`)
// +kubebuilder:default=80
Port int `property:"port" json:"port,omitempty"`
// The path where the Open-API specification is published (default `/openapi.json`)
// +kubebuilder:default="/openapi.json"
DescriptionPath *string `property:"description-path" json:"descriptionPath,omitempty"`
}

Expand Down
3 changes: 3 additions & 0 deletions addons/tracing/tracing.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,17 @@ import (
type Trait struct {
traitv1.Trait `property:",squash" json:",inline"`
// Enables automatic configuration of the trait, including automatic discovery of the tracing endpoint.
// +kubebuilder:default=true
Auto *bool `property:"auto" json:"auto,omitempty"`
// The name of the service that publishes tracing data (defaults to the integration name)
ServiceName string `property:"service-name" json:"serviceName,omitempty"`
// The target endpoint of the OpenTracing service (automatically discovered by default)
Endpoint string `property:"endpoint" json:"endpoint,omitempty"`
// The sampler type (default "const")
// +kubebuilder:default="const"
SamplerType *string `property:"sampler-type" json:"samplerType,omitempty"`
// The sampler specific param (default "1")
// +kubebuilder:default="1"
SamplerParam *string `property:"sampler-param" json:"samplerParam,omitempty"`
}

Expand Down
17 changes: 15 additions & 2 deletions config/crd/bases/camel.apache.org_integrationkits.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ spec:
description: 'Deprecated: no longer in use.'
type: boolean
incrementalImageBuild:
default: true
description: Use the incremental image build option, to reuse
existing containers (default `true`)
type: boolean
Expand All @@ -239,8 +240,13 @@ spec:
type: string
type: array
orderStrategy:
default: sequential
description: The build order strategy to use, either `dependencies`,
`fifo` or `sequential` (default sequential)
`fifo` or `sequential` (default `sequential`)
enum:
- dependencies
- fifo
- sequential
type: string
properties:
description: A list of properties to be provided to the build
Expand All @@ -259,8 +265,12 @@ spec:
instead with task name `builder`.'
type: string
strategy:
default: routine
description: The strategy to use, either `pod` or `routine`
(default routine)
(default `routine`)
enum:
- pod
- routine
type: string
tasks:
description: A list of tasks to be executed (available only
Expand Down Expand Up @@ -327,6 +337,7 @@ spec:
build must have enough memory available.'
properties:
buildMode:
default: jvm
description: 'The Quarkus mode to run: either `jvm` or `native`
(default `jvm`). In case both `jvm` and `native` are specified,
two `IntegrationKit` resources are created, with the `native`
Expand All @@ -347,6 +358,7 @@ spec:
description: 'Deprecated: no longer in use.'
type: boolean
nativeBaseImage:
default: quay.io/quarkus/quarkus-micro-image:2.0
description: The base image to use when running a native build
(default `quay.io/quarkus/quarkus-micro-image:2.0`)
type: string
Expand All @@ -356,6 +368,7 @@ spec:
in the runtime catalog)
type: string
packageTypes:
default: fast-jar
description: 'The Quarkus package types, `fast-jar` or `native`
(default `fast-jar`). In case both `fast-jar` and `native`
are specified, two `IntegrationKit` resources are created,
Expand Down
Loading

0 comments on commit 8e06154

Please sign in to comment.