You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by pc...@apache.org on 2023/10/18 07:22:54 UTC
[camel-k] branch release-2.0.x updated: chore: fixed lint errors.
This is an automated email from the ASF dual-hosted git repository.
pcongiusti pushed a commit to branch release-2.0.x
in repository https://gitbox.apache.org/repos/asf/camel-k.git
The following commit(s) were added to refs/heads/release-2.0.x by this push:
new 16cc9e95a chore: fixed lint errors.
16cc9e95a is described below
commit 16cc9e95ad4e4a30e77abd002b4521e22a4990ae
Author: Andrea Tarocchi <an...@gmail.com>
AuthorDate: Tue Oct 17 18:23:38 2023 +0200
chore: fixed lint errors.
---
pkg/apis/camel/v1/build_types.go | 116 ++++-----
pkg/apis/camel/v1/camelcatalog_types.go | 80 +++----
pkg/apis/camel/v1/camelcatalog_types_support.go | 26 +--
pkg/apis/camel/v1/common_types.go | 258 ++++++++++-----------
pkg/apis/camel/v1/common_types_support.go | 6 +-
pkg/apis/camel/v1/common_types_support_test.go | 29 +--
pkg/apis/camel/v1/error_handler_types.go | 18 +-
pkg/apis/camel/v1/error_handler_types_support.go | 36 +--
pkg/apis/camel/v1/integration_types.go | 184 +++++++--------
pkg/apis/camel/v1/integration_types_support.go | 10 +-
pkg/apis/camel/v1/integrationkit_types.go | 52 ++---
pkg/apis/camel/v1/integrationkit_types_support.go | 2 +-
pkg/apis/camel/v1/integrationplatform_types.go | 56 ++---
.../camel/v1/integrationplatform_types_support.go | 38 +--
pkg/apis/camel/v1/kamelet_types.go | 120 +++++-----
pkg/apis/camel/v1/kamelet_types_support.go | 28 +--
pkg/apis/camel/v1/knative/types.go | 22 +-
pkg/apis/camel/v1/knative/types_support.go | 10 +-
pkg/apis/camel/v1/maven_types.go | 8 +-
pkg/apis/camel/v1/pipe_types.go | 48 ++--
pkg/apis/camel/v1/pipe_types_support.go | 28 +--
pkg/apis/camel/v1/register.go | 8 +-
pkg/apis/camel/v1alpha1/error_handler_types.go | 18 +-
.../camel/v1alpha1/error_handler_types_support.go | 36 +--
pkg/apis/camel/v1alpha1/jsonschema_types.go | 2 +-
pkg/apis/camel/v1alpha1/kamelet_binding_types.go | 56 ++---
.../v1alpha1/kamelet_binding_types_support.go | 26 +--
pkg/apis/camel/v1alpha1/kamelet_types.go | 112 ++++-----
pkg/apis/camel/v1alpha1/kamelet_types_support.go | 28 +--
pkg/apis/camel/v1alpha1/register.go | 8 +-
pkg/controller/pipe/error_handler_test.go | 2 +-
pkg/kamelet/repository/composite_repository.go | 8 +-
pkg/kamelet/repository/empty_repository.go | 4 +-
pkg/kamelet/repository/github_repository.go | 9 +-
pkg/kamelet/repository/github_repository_test.go | 2 +-
pkg/kamelet/repository/kubernetes_repository.go | 2 +-
pkg/kamelet/repository/repository.go | 18 +-
pkg/kamelet/repository/repository_test.go | 3 +-
38 files changed, 747 insertions(+), 770 deletions(-)
diff --git a/pkg/apis/camel/v1/build_types.go b/pkg/apis/camel/v1/build_types.go
index e928c66c9..d23916247 100644
--- a/pkg/apis/camel/v1/build_types.go
+++ b/pkg/apis/camel/v1/build_types.go
@@ -25,7 +25,7 @@ import (
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
// Important: Run "make generate-deepcopy" to regenerate code after modifying this file
-// BuildSpec defines the list of tasks to be execute for a Build. From Camel K version 2, it would be more appropiate
+// BuildSpec defines the list of tasks to be execute for a Build. From Camel K version 2, it would be more appropriate
// to think it as pipeline.
type BuildSpec struct {
// The sequence of tasks (pipeline) to be performed.
@@ -73,94 +73,94 @@ type Task struct {
Custom *UserTask `json:"custom,omitempty"`
}
-// BaseTask is a base for the struct hierarchy
+// BaseTask is a base for the struct hierarchy.
type BaseTask struct {
// name of the task
Name string `json:"name,omitempty"`
}
-// BuilderTask is the generic task in charge of building the application image
+// BuilderTask is the generic task in charge of building the application image.
type BuilderTask struct {
BaseTask `json:",inline"`
// The configuration that should be used to perform the Build.
Configuration BuildConfiguration `json:"configuration,omitempty"`
- // the base image layer
+ // the base image layer.
BaseImage string `json:"baseImage,omitempty"`
- // the configuration required for the runtime application
+ // the configuration required for the runtime application.
Runtime RuntimeSpec `json:"runtime,omitempty"`
- // the list of dependencies to use for this build
+ // the list of dependencies to use for this build.
Dependencies []string `json:"dependencies,omitempty"`
- // the list of steps to execute (see pkg/builder/)
+ // the list of steps to execute (see pkg/builder/).
Steps []string `json:"steps,omitempty"`
- // the configuration required by Maven for the application build phase
+ // the configuration required by Maven for the application build phase.
Maven MavenBuildSpec `json:"maven,omitempty"`
- // workspace directory to use
+ // workspace directory to use.
BuildDir string `json:"buildDir,omitempty"`
- // the sources to add at build time
+ // the sources to add at build time.
Sources []SourceSpec `json:"sources,omitempty"`
}
-// MavenBuildSpec defines the Maven configuration plus additional repositories to use
+// MavenBuildSpec defines the Maven configuration plus additional repositories to use.
type MavenBuildSpec struct {
- // base Maven specification
+ // base Maven specification.
MavenSpec `json:",inline"`
- // additional repositories
+ // additional repositories.
Repositories []Repository `json:"repositories,omitempty"`
- // Servers (auth)
+ // Servers (auth).
Servers []Server `json:"servers,omitempty"`
}
-// PublishTask image publish configuration
+// PublishTask image publish configuration.
type PublishTask struct {
- // can be useful to share info with other tasks
+ // can be useful to share info with other tasks.
ContextDir string `json:"contextDir,omitempty"`
- // base image layer
+ // base image layer.
BaseImage string `json:"baseImage,omitempty"`
- // final image name
+ // final image name.
Image string `json:"image,omitempty"`
- // where to publish the final image
+ // where to publish the final image.
Registry RegistrySpec `json:"registry,omitempty"`
}
-// BuildahTask is used to configure Buildah
+// BuildahTask is used to configure Buildah.
type BuildahTask struct {
BaseTask `json:",inline"`
PublishTask `json:",inline"`
- // The platform of build image
+ // The platform of build image.
Platform string `json:"platform,omitempty"`
- // log more information
+ // log more information.
Verbose *bool `json:"verbose,omitempty"`
- // docker image to use
+ // docker image to use.
ExecutorImage string `json:"executorImage,omitempty"`
}
-// KanikoTask is used to configure Kaniko
+// KanikoTask is used to configure Kaniko.
type KanikoTask struct {
BaseTask `json:",inline"`
PublishTask `json:",inline"`
- // log more information
+ // log more information.
Verbose *bool `json:"verbose,omitempty"`
- // use a cache
+ // use a cache.
Cache KanikoTaskCache `json:"cache,omitempty"`
- // docker image to use
+ // docker image to use.
ExecutorImage string `json:"executorImage,omitempty"`
}
-// KanikoTaskCache is used to configure Kaniko cache
+// KanikoTaskCache is used to configure Kaniko cache.
type KanikoTaskCache struct {
- // true if a cache is enabled
+ // true if a cache is enabled.
Enabled *bool `json:"enabled,omitempty"`
- // the PVC used to store the cache
+ // the PVC used to store the cache.
PersistentVolumeClaim string `json:"persistentVolumeClaim,omitempty"`
}
-// SpectrumTask is used to configure Spectrum
+// SpectrumTask is used to configure Spectrum.
type SpectrumTask struct {
BaseTask `json:",inline"`
PublishTask `json:",inline"`
}
-// S2iTask is used to configure S2I
+// S2iTask is used to configure S2I.
type S2iTask struct {
BaseTask `json:",inline"`
// can be useful to share info with other tasks
@@ -169,7 +169,7 @@ type S2iTask struct {
Tag string `json:"tag,omitempty"`
}
-// UserTask is used to execute any generic custom operation
+// UserTask is used to execute any generic custom operation.
type UserTask struct {
BaseTask `json:",inline"`
// the container image to use
@@ -178,61 +178,61 @@ type UserTask struct {
ContainerCommand string `json:"command,omitempty"`
}
-// BuildStatus defines the observed state of Build
+// BuildStatus defines the observed state of Build.
type BuildStatus struct {
// ObservedGeneration is the most recent generation observed for this Build.
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
- // describes the phase
+ // describes the phase.
Phase BuildPhase `json:"phase,omitempty"`
- // the image name built
+ // the image name built.
Image string `json:"image,omitempty"`
- // the digest from image
+ // the digest from image.
Digest string `json:"digest,omitempty"`
- // the base image used for this build
+ // the base image used for this build.
BaseImage string `json:"baseImage,omitempty"`
- // a list of artifacts contained in the build
+ // a list of artifacts contained in the build.
Artifacts []Artifact `json:"artifacts,omitempty"`
- // the error description (if any)
+ // the error description (if any).
Error string `json:"error,omitempty"`
- // the reason of the failure (if any)
+ // the reason of the failure (if any).
Failure *Failure `json:"failure,omitempty"`
- // the time when it started
+ // the time when it started.
StartedAt *metav1.Time `json:"startedAt,omitempty"`
- // a list of conditions occurred during the build
+ // a list of conditions occurred during the build.
Conditions []BuildCondition `json:"conditions,omitempty"`
// how long it took for the build
// Change to Duration / ISO 8601 when CRD uses OpenAPI spec v3
- // https://github.com/OAI/OpenAPI-Specification/issues/845
+ // https://github.com/OAI/OpenAPI-Specification/issues/845 .
Duration string `json:"duration,omitempty"`
}
-// BuildPhase --
+// BuildPhase --.
type BuildPhase string
-// BuildConditionType --
+// BuildConditionType --.
type BuildConditionType string
const (
- // BuildKind --
+ // BuildKind --.
BuildKind string = "Build"
- // BuildPhaseNone --
+ // BuildPhaseNone --.
BuildPhaseNone BuildPhase = ""
- // BuildPhaseInitialization --
+ // BuildPhaseInitialization --.
BuildPhaseInitialization BuildPhase = "Initialization"
- // BuildPhaseScheduling --
+ // BuildPhaseScheduling --.
BuildPhaseScheduling BuildPhase = "Scheduling"
- // BuildPhasePending --
+ // BuildPhasePending --.
BuildPhasePending BuildPhase = "Pending"
- // BuildPhaseRunning --
+ // BuildPhaseRunning --.
BuildPhaseRunning BuildPhase = "Running"
- // BuildPhaseSucceeded --
+ // BuildPhaseSucceeded --.
BuildPhaseSucceeded BuildPhase = "Succeeded"
- // BuildPhaseFailed --
+ // BuildPhaseFailed --.
BuildPhaseFailed BuildPhase = "Failed"
- // BuildPhaseInterrupted --
+ // BuildPhaseInterrupted --.
BuildPhaseInterrupted = "Interrupted"
- // BuildPhaseError --
+ // BuildPhaseError --.
BuildPhaseError BuildPhase = "Error"
)
@@ -248,7 +248,7 @@ const (
// +kubebuilder:printcolumn:name="Duration",type=string,JSONPath=`.status.duration`,description="The build last execution duration"
// +kubebuilder:printcolumn:name="Attempts",type=integer,JSONPath=`.status.failure.recovery.attempt`,description="The number of execution attempts"
-// Build is the Schema for the builds API
+// Build is the Schema for the builds API.
type Build struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
@@ -259,7 +259,7 @@ type Build struct {
// +kubebuilder:object:root=true
-// BuildList contains a list of Build
+// BuildList contains a list of Build.
type BuildList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
diff --git a/pkg/apis/camel/v1/camelcatalog_types.go b/pkg/apis/camel/v1/camelcatalog_types.go
index cf23a23df..46435ea44 100644
--- a/pkg/apis/camel/v1/camelcatalog_types.go
+++ b/pkg/apis/camel/v1/camelcatalog_types.go
@@ -23,7 +23,7 @@ import (
)
const (
- // CamelCatalogKind --
+ // CamelCatalogKind --.
CamelCatalogKind string = "CamelCatalog"
)
@@ -50,20 +50,20 @@ type CamelCatalog struct {
// +kubebuilder:object:root=true
-// CamelCatalogList contains a list of CamelCatalog
+// CamelCatalogList contains a list of CamelCatalog.
type CamelCatalogList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []CamelCatalog `json:"items"`
}
-// CamelCatalogSpec specify what features a Camel runtime provides
+// CamelCatalogSpec specify what features a Camel runtime provides.
type CamelCatalogSpec struct {
- // the runtime targeted for the catalog
+ // the runtime targeted for the catalog.
Runtime RuntimeSpec `json:"runtime" yaml:"runtime"`
- // artifacts required by this catalog
+ // artifacts required by this catalog.
Artifacts map[string]CamelArtifact `json:"artifacts" yaml:"artifacts"`
- // loaders required by this catalog
+ // loaders required by this catalog.
Loaders map[string]CamelLoader `json:"loaders" yaml:"loaders"`
}
@@ -71,23 +71,23 @@ type CamelCatalogSpec struct {
type CamelCatalogStatus struct {
// ObservedGeneration is the most recent generation observed for this Catalog.
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
- // the actual phase
+ // the actual phase.
Phase CamelCatalogPhase `json:"phase,omitempty"`
// a list of events happened for the CamelCatalog
Conditions []CamelCatalogCondition `json:"conditions,omitempty"`
- // the container image available for building an application with this catalog
+ // the container image available for building an application with this catalog.
Image string `json:"image,omitempty"`
}
-// CamelCatalogPhase --
+// CamelCatalogPhase --.
type CamelCatalogPhase string
const (
- // CamelCatalogPhaseNone --
+ // CamelCatalogPhaseNone --.
CamelCatalogPhaseNone CamelCatalogPhase = ""
- // CamelCatalogPhaseReady --
+ // CamelCatalogPhaseReady --.
CamelCatalogPhaseReady CamelCatalogPhase = "Ready"
- // CamelCatalogPhaseError --
+ // CamelCatalogPhaseError --.
CamelCatalogPhaseError CamelCatalogPhase = "Error"
)
@@ -107,74 +107,74 @@ type CamelCatalogCondition struct {
Message string `json:"message,omitempty"`
}
-// CamelCatalogConditionType --
+// CamelCatalogConditionType --.
type CamelCatalogConditionType string
const (
- // CamelCatalogConditionReady --
+ // CamelCatalogConditionReady --.
CamelCatalogConditionReady CamelCatalogConditionType = "Ready"
)
-// CamelScheme represents the scheme used to identify a component in a URI (ie, timer in a timer:xyz endpoint URI)
+// CamelScheme represents the scheme used to identify a component in a URI (ie, timer in a timer:xyz endpoint URI).
type CamelScheme struct {
- // the ID (ie, timer in a timer:xyz URI)
+ // the ID (ie, timer in a timer:xyz URI).
ID string `json:"id" yaml:"id"`
- // is a passive scheme
+ // is a passive scheme.
Passive bool `json:"passive" yaml:"passive"`
- // is a HTTP based scheme
+ // is a HTTP based scheme.
HTTP bool `json:"http" yaml:"http"`
- // required scope for consumer
+ // required scope for consumer.
Consumer CamelSchemeScope `json:"consumer,omitempty" yaml:"consumer,omitempty"`
- // required scope for producers
+ // required scope for producers.
Producer CamelSchemeScope `json:"producer,omitempty" yaml:"producer,omitempty"`
}
-// CamelSchemeScope contains scoped information about a scheme
+// CamelSchemeScope contains scoped information about a scheme.
type CamelSchemeScope struct {
- // list of dependencies needed for this scope
+ // list of dependencies needed for this scope.
Dependencies []CamelArtifactDependency `json:"dependencies,omitempty" yaml:"dependencies,omitempty"`
}
-// CamelArtifactExclusion represents an exclusion clause
+// CamelArtifactExclusion represents an exclusion clause.
type CamelArtifactExclusion struct {
- // Maven Group
+ // Maven Group.
GroupID string `json:"groupId" yaml:"groupId"`
- // Maven Artifact
+ // Maven Artifact.
ArtifactID string `json:"artifactId" yaml:"artifactId"`
}
-// CamelArtifactDependency represent a maven's dependency
+// CamelArtifactDependency represent a maven's dependency.
type CamelArtifactDependency struct {
- // the maven dependency
+ // the maven dependency.
MavenArtifact `json:",inline" yaml:",inline"`
- // provide a list of artifacts to exclude for this dependency
+ // provide a list of artifacts to exclude for this dependency.
Exclusions []CamelArtifactExclusion `json:"exclusions,omitempty" yaml:"exclusions,omitempty"`
}
-// CamelArtifact represent the configuration for a feature offered by Camel
+// CamelArtifact represent the configuration for a feature offered by Camel.
type CamelArtifact struct {
- // Base Camel Artifact dependency
+ // Base Camel Artifact dependency.
CamelArtifactDependency `json:",inline" yaml:",inline"`
- // accepted URI schemes
+ // accepted URI schemes.
Schemes []CamelScheme `json:"schemes,omitempty" yaml:"schemes,omitempty"`
- // accepted languages
+ // accepted languages.
Languages []string `json:"languages,omitempty" yaml:"languages,omitempty"`
- // accepted data formats
+ // accepted data formats.
DataFormats []string `json:"dataformats,omitempty" yaml:"dataformats,omitempty"`
- // required dependencies
+ // required dependencies.
Dependencies []CamelArtifactDependency `json:"dependencies,omitempty" yaml:"dependencies,omitempty"`
- // the Java types used by the artifact feature (ie, component, data format, ...)
+ // the Java types used by the artifact feature (ie, component, data format, ...).
JavaTypes []string `json:"javaTypes,omitempty" yaml:"javaTypes,omitempty"`
}
-// CamelLoader represents the configuration required to load a DSL
+// CamelLoader represents the configuration required to load a DSL.
type CamelLoader struct {
- // the base Maven artifact required
+ // the base Maven artifact required.
MavenArtifact `json:",inline" yaml:",inline"`
- // a list of DSLs supported
+ // a list of DSLs supported.
Languages []string `json:"languages,omitempty" yaml:"languages,omitempty"`
- // a list of additional dependencies required beside the base one
+ // a list of additional dependencies required beside the base one.
Dependencies []MavenArtifact `json:"dependencies,omitempty" yaml:"dependencies,omitempty"`
- // the metadata of the loader
+ // the metadata of the loader.
Metadata map[string]string `json:"metadata,omitempty" yaml:"metadata,omitempty"`
}
diff --git a/pkg/apis/camel/v1/camelcatalog_types_support.go b/pkg/apis/camel/v1/camelcatalog_types_support.go
index 347e666d9..ddc597c6b 100644
--- a/pkg/apis/camel/v1/camelcatalog_types_support.go
+++ b/pkg/apis/camel/v1/camelcatalog_types_support.go
@@ -24,7 +24,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
-// NewCamelCatalog --
+// NewCamelCatalog --.
func NewCamelCatalog(namespace string, name string) CamelCatalog {
return CamelCatalog{
TypeMeta: metav1.TypeMeta{
@@ -38,7 +38,7 @@ func NewCamelCatalog(namespace string, name string) CamelCatalog {
}
}
-// NewCamelCatalogWithSpecs --
+// NewCamelCatalogWithSpecs --.
func NewCamelCatalogWithSpecs(namespace string, name string, spec CamelCatalogSpec) CamelCatalog {
return CamelCatalog{
TypeMeta: metav1.TypeMeta{
@@ -53,7 +53,7 @@ func NewCamelCatalogWithSpecs(namespace string, name string, spec CamelCatalogSp
}
}
-// NewCamelCatalogList --
+// NewCamelCatalogList --.
func NewCamelCatalogList() CamelCatalogList {
return CamelCatalogList{
TypeMeta: metav1.TypeMeta{
@@ -63,37 +63,37 @@ func NewCamelCatalogList() CamelCatalogList {
}
}
-// GetType --
+// GetType --.
func (c CamelCatalogCondition) GetType() string {
return string(c.Type)
}
-// GetStatus --
+// GetStatus --.
func (c CamelCatalogCondition) GetStatus() corev1.ConditionStatus {
return c.Status
}
-// GetLastUpdateTime --
+// GetLastUpdateTime --.
func (c CamelCatalogCondition) GetLastUpdateTime() metav1.Time {
return c.LastUpdateTime
}
-// GetLastTransitionTime --
+// GetLastTransitionTime --.
func (c CamelCatalogCondition) GetLastTransitionTime() metav1.Time {
return c.LastTransitionTime
}
-// GetReason --
+// GetReason --.
func (c CamelCatalogCondition) GetReason() string {
return c.Reason
}
-// GetMessage --
+// GetMessage --.
func (c CamelCatalogCondition) GetMessage() string {
return c.Message
}
-// GetConditions --
+// GetConditions --.
func (in *CamelCatalogStatus) GetConditions() []ResourceCondition {
res := make([]ResourceCondition, 0, len(in.Conditions))
for _, c := range in.Conditions {
@@ -113,7 +113,7 @@ func (in *CamelCatalogStatus) GetCondition(condType CamelCatalogConditionType) *
return nil
}
-// SetCondition --
+// SetCondition --.
func (in *CamelCatalogStatus) SetCondition(condType CamelCatalogConditionType, status corev1.ConditionStatus, reason string, message string) {
in.SetConditions(CamelCatalogCondition{
Type: condType,
@@ -125,7 +125,7 @@ func (in *CamelCatalogStatus) SetCondition(condType CamelCatalogConditionType, s
})
}
-// SetErrorCondition --
+// SetErrorCondition --.
func (in *CamelCatalogStatus) SetErrorCondition(condType CamelCatalogConditionType, reason string, err error) {
in.SetConditions(CamelCatalogCondition{
Type: condType,
@@ -209,7 +209,7 @@ func (c *CamelCatalogSpec) HasCapability(capability string) bool {
return ok
}
-// GetDependencyID returns a Camel K recognizable maven dependency for the artifact
+// GetDependencyID returns a Camel K recognizable maven dependency for the artifact.
func (in *CamelArtifact) GetDependencyID() string {
switch {
case in.GroupID == "org.apache.camel.quarkus" && strings.HasPrefix(in.ArtifactID, "camel-quarkus-"):
diff --git a/pkg/apis/camel/v1/common_types.go b/pkg/apis/camel/v1/common_types.go
index e535e45bb..6d0b2bf33 100644
--- a/pkg/apis/camel/v1/common_types.go
+++ b/pkg/apis/camel/v1/common_types.go
@@ -25,33 +25,33 @@ import (
)
const (
- // TraitAnnotationPrefix represents the prefix used for traits annotations
+ // TraitAnnotationPrefix represents the prefix used for traits annotations.
TraitAnnotationPrefix = "trait.camel.apache.org/"
- // OperatorIDAnnotation operator id annotation label
+ // OperatorIDAnnotation operator id annotation label.
OperatorIDAnnotation = "camel.apache.org/operator.id"
- // SecondaryPlatformAnnotation secondary platform annotation label
+ // SecondaryPlatformAnnotation secondary platform annotation label.
SecondaryPlatformAnnotation = "camel.apache.org/secondary.platform"
- // PlatformSelectorAnnotation platform id annotation label
+ // PlatformSelectorAnnotation platform id annotation label.
PlatformSelectorAnnotation = "camel.apache.org/platform.id"
)
-// BuildConfiguration represent the configuration required to build the runtime
+// BuildConfiguration represent the configuration required to build the runtime.
type BuildConfiguration struct {
// The container image to be used to run the build.
ToolImage string `json:"toolImage,omitempty"`
// The namespace where to run the builder Pod (must be the same of the operator in charge of this Build reconciliation).
BuilderPodNamespace string `json:"operatorNamespace,omitempty"`
- // the strategy to adopt
+ // the strategy to adopt.
Strategy BuildStrategy `property:"strategy" json:"strategy,omitempty"`
- // the build order strategy to adopt
+ // the build order strategy to adopt.
OrderStrategy BuildOrderStrategy `property:"order-strategy" json:"orderStrategy,omitempty"`
- // The minimum amount of CPU required. Only used for `pod` strategy
+ // The minimum amount of CPU required. Only used for `pod` strategy.
RequestCPU string `property:"request-cpu" json:"requestCPU,omitempty"`
- // The minimum amount of memory required. Only used for `pod` strategy
+ // The minimum amount of memory required. Only used for `pod` strategy.
RequestMemory string `property:"request-memory" json:"requestMemory,omitempty"`
- // The maximum amount of CPU required. Only used for `pod` strategy
+ // The maximum amount of CPU required. Only used for `pod` strategy.
LimitCPU string `property:"limit-cpu" json:"limitCPU,omitempty"`
- // The maximum amount of memory required. Only used for `pod` strategy
+ // The maximum amount of memory required. Only used for `pod` strategy.
LimitMemory string `property:"limit-memory" json:"limitMemory,omitempty"`
}
@@ -84,7 +84,7 @@ const (
BuildOrderStrategySequential BuildOrderStrategy = "sequential"
)
-// BuildStrategies is a list of strategies allowed for the build
+// BuildStrategies is a list of strategies allowed for the build.
var BuildStrategies = []BuildStrategy{
BuildStrategyRoutine,
BuildStrategyPod,
@@ -94,143 +94,143 @@ var BuildStrategies = []BuildStrategy{
// +kubebuilder:validation:Enum=dependencies;fifo;sequential
type BuildOrderStrategy string
-// BuildOrderStrategies is a list of order strategies allowed for the build
+// BuildOrderStrategies is a list of order strategies allowed for the build.
var BuildOrderStrategies = []BuildOrderStrategy{
BuildOrderStrategyFIFO,
BuildOrderStrategyDependencies,
BuildOrderStrategySequential,
}
-// ConfigurationSpec represents a generic configuration specification
+// ConfigurationSpec represents a generic configuration specification.
type ConfigurationSpec struct {
// represents the type of configuration, ie: property, configmap, secret, ...
Type string `json:"type"`
- // the value to assign to the configuration (syntax may vary depending on the `Type`)
+ // the value to assign to the configuration (syntax may vary depending on the `Type`).
Value string `json:"value"`
}
-// Artifact represents a materialized artifact (a jar dependency or in general a file used by the build)
+// Artifact represents a materialized artifact (a jar dependency or in general a file used by the build).
type Artifact struct {
- // the identification (GAV for maven dependencies or file name for other file types)
+ // the identification (GAV for maven dependencies or file name for other file types).
ID string `json:"id" yaml:"id"`
- // where it is located in the builder `Pod`
+ // where it is located in the builder `Pod`.
Location string `json:"location,omitempty" yaml:"location,omitempty"`
- // the expected location in the runtime
+ // the expected location in the runtime.
Target string `json:"target,omitempty" yaml:"target,omitempty"`
- // a checksum (SHA1) of the content
+ // a checksum (SHA1) of the content.
Checksum string `json:"checksum,omitempty" yaml:"checksum,omitempty"`
}
-// Failure represent a message specifying the reason and the time of an event failure
+// Failure represent a message specifying the reason and the time of an event failure.
type Failure struct {
- // a short text specifying the reason
+ // a short text specifying the reason.
Reason string `json:"reason"`
- // the time when the failure has happened
+ // the time when the failure has happened.
Time metav1.Time `json:"time"`
- // the recovery attempted for this failure
+ // the recovery attempted for this failure.
Recovery FailureRecovery `json:"recovery"`
}
-// FailureRecovery defines the attempts to recover a failure
+// FailureRecovery defines the attempts to recover a failure.
type FailureRecovery struct {
- // attempt number
+ // attempt number.
Attempt int `json:"attempt"`
- // maximum number of attempts
+ // maximum number of attempts.
AttemptMax int `json:"attemptMax"`
- // time of the attempt execution
+ // time of the attempt execution.
// +optional
AttemptTime metav1.Time `json:"attemptTime"`
}
-// TraitProfile represents lists of traits that are enabled for the specific installation/integration
+// TraitProfile represents lists of traits that are enabled for the specific installation/integration.
type TraitProfile string
const (
- // TraitProfileOpenShift is used by default on OpenShift clusters
+ // TraitProfileOpenShift is used by default on OpenShift clusters.
TraitProfileOpenShift TraitProfile = "OpenShift"
- // TraitProfileKubernetes is used by default on Kubernetes clusters
+ // TraitProfileKubernetes is used by default on Kubernetes clusters.
TraitProfileKubernetes TraitProfile = "Kubernetes"
- // TraitProfileKnative is used by default on OpenShift/Kubernetes clusters powered by Knative
+ // TraitProfileKnative is used by default on OpenShift/Kubernetes clusters powered by Knative.
TraitProfileKnative TraitProfile = "Knative"
- // DefaultTraitProfile is the trait profile used as default when no other profile is set
+ // DefaultTraitProfile is the trait profile used as default when no other profile is set.
DefaultTraitProfile = TraitProfileKubernetes
)
-// AllTraitProfiles contains all allowed profiles
+// AllTraitProfiles contains all allowed profiles.
var AllTraitProfiles = []TraitProfile{TraitProfileKubernetes, TraitProfileKnative, TraitProfileOpenShift}
-// Traits represents the collection of trait configurations
+// Traits represents the collection of trait configurations.
type Traits struct {
- // The configuration of Affinity trait
+ // The configuration of Affinity trait.
Affinity *trait.AffinityTrait `property:"affinity" json:"affinity,omitempty"`
- // The configuration of Builder trait
+ // The configuration of Builder trait.
Builder *trait.BuilderTrait `property:"builder" json:"builder,omitempty"`
- // The configuration of Camel trait
+ // The configuration of Camel trait.
Camel *trait.CamelTrait `property:"camel" json:"camel,omitempty"`
- // The configuration of Container trait
+ // The configuration of Container trait.
Container *trait.ContainerTrait `property:"container" json:"container,omitempty"`
- // The configuration of Cron trait
+ // The configuration of Cron trait.
Cron *trait.CronTrait `property:"cron" json:"cron,omitempty"`
- // The configuration of Dependencies trait
+ // The configuration of Dependencies trait.
Dependencies *trait.DependenciesTrait `property:"dependencies" json:"dependencies,omitempty"`
- // The configuration of Deployer trait
+ // The configuration of Deployer trait.
Deployer *trait.DeployerTrait `property:"deployer" json:"deployer,omitempty"`
- // The configuration of Deployment trait
+ // The configuration of Deployment trait.
Deployment *trait.DeploymentTrait `property:"deployment" json:"deployment,omitempty"`
- // The configuration of Environment trait
+ // The configuration of Environment trait.
Environment *trait.EnvironmentTrait `property:"environment" json:"environment,omitempty"`
- // The configuration of Error Handler trait
+ // The configuration of Error Handler trait.
ErrorHandler *trait.ErrorHandlerTrait `property:"error-handler" json:"error-handler,omitempty"`
- // The configuration of GC trait
+ // The configuration of GC trait.
GC *trait.GCTrait `property:"gc" json:"gc,omitempty"`
- // The configuration of Health trait
+ // The configuration of Health trait.
Health *trait.HealthTrait `property:"health" json:"health,omitempty"`
- // The configuration of Ingress trait
+ // The configuration of Ingress trait.
Ingress *trait.IngressTrait `property:"ingress" json:"ingress,omitempty"`
- // The configuration of Istio trait
+ // The configuration of Istio trait.
Istio *trait.IstioTrait `property:"istio" json:"istio,omitempty"`
- // The configuration of Jolokia trait
+ // The configuration of Jolokia trait.
Jolokia *trait.JolokiaTrait `property:"jolokia" json:"jolokia,omitempty"`
- // The configuration of JVM trait
+ // The configuration of JVM trait.
JVM *trait.JVMTrait `property:"jvm" json:"jvm,omitempty"`
- // The configuration of Kamelets trait
+ // The configuration of Kamelets trait.
Kamelets *trait.KameletsTrait `property:"kamelets" json:"kamelets,omitempty"`
- // The configuration of Knative trait
+ // The configuration of Knative trait.
Knative *trait.KnativeTrait `property:"knative" json:"knative,omitempty"`
- // The configuration of Knative Service trait
+ // The configuration of Knative Service trait.
KnativeService *trait.KnativeServiceTrait `property:"knative-service" json:"knative-service,omitempty"`
- // The configuration of Logging trait
+ // The configuration of Logging trait.
Logging *trait.LoggingTrait `property:"logging" json:"logging,omitempty"`
- // The configuration of Mount trait
+ // The configuration of Mount trait.
Mount *trait.MountTrait `property:"mount" json:"mount,omitempty"`
- // The configuration of OpenAPI trait
+ // The configuration of OpenAPI trait.
OpenAPI *trait.OpenAPITrait `property:"openapi" json:"openapi,omitempty"`
- // The configuration of Owner trait
+ // The configuration of Owner trait.
Owner *trait.OwnerTrait `property:"owner" json:"owner,omitempty"`
- // The configuration of PDB trait
+ // The configuration of PDB trait.
PDB *trait.PDBTrait `property:"pdb" json:"pdb,omitempty"`
- // The configuration of Platform trait
+ // The configuration of Platform trait.
Platform *trait.PlatformTrait `property:"platform" json:"platform,omitempty"`
- // The configuration of Pod trait
+ // The configuration of Pod trait.
Pod *trait.PodTrait `property:"pod" json:"pod,omitempty"`
- // The configuration of Prometheus trait
+ // The configuration of Prometheus trait.
Prometheus *trait.PrometheusTrait `property:"prometheus" json:"prometheus,omitempty"`
- // The configuration of Pull Secret trait
+ // The configuration of Pull Secret trait.
PullSecret *trait.PullSecretTrait `property:"pull-secret" json:"pull-secret,omitempty"`
- // The configuration of Quarkus trait
+ // The configuration of Quarkus trait.
Quarkus *trait.QuarkusTrait `property:"quarkus" json:"quarkus,omitempty"`
- // The configuration of Registry trait
+ // The configuration of Registry trait.
Registry *trait.RegistryTrait `property:"registry" json:"registry,omitempty"`
- // The configuration of Route trait
+ // The configuration of Route trait.
Route *trait.RouteTrait `property:"route" json:"route,omitempty"`
- // The configuration of Service trait
+ // The configuration of Service trait.
Service *trait.ServiceTrait `property:"service" json:"service,omitempty"`
- // The configuration of Service Binding trait
+ // The configuration of Service Binding trait.
ServiceBinding *trait.ServiceBindingTrait `property:"service-binding" json:"service-binding,omitempty"`
- // The configuration of Toleration trait
+ // The configuration of Toleration trait.
Toleration *trait.TolerationTrait `property:"toleration" json:"toleration,omitempty"`
- // The extension point with addon traits
+ // The extension point with addon traits.
Addons map[string]AddonTrait `json:"addons,omitempty"`
// Deprecated: for backward compatibility.
@@ -245,9 +245,9 @@ type Traits struct {
Tracing *TraitSpec `property:"tracing" json:"tracing,omitempty"`
}
-// AddonTrait represents the configuration of an addon trait
+// AddonTrait represents the configuration of an addon trait.
type AddonTrait struct {
- // Generic raw message, typically a map containing the keys (trait parameters) and the values (either single text or array)
+ // Generic raw message, typically a map containing the keys (trait parameters) and the values (either single text or array).
RawMessage `json:",inline"`
}
@@ -275,12 +275,12 @@ type RawMessage []byte
// +kubebuilder:object:generate=false
-// Configurable --
+// Configurable --.
type Configurable interface {
Configurations() []ConfigurationSpec
}
-// RegistrySpec provides the configuration for the container registry
+// RegistrySpec provides the configuration for the container registry.
type RegistrySpec struct {
// if the container registry is insecure (ie, http only)
Insecure bool `json:"insecure,omitempty"`
@@ -294,7 +294,7 @@ type RegistrySpec struct {
Organization string `json:"organization,omitempty"`
}
-// ValueSource --
+// ValueSource --.
type ValueSource struct {
// Selects a key of a ConfigMap.
ConfigMapKeyRef *corev1.ConfigMapKeySelector `json:"configMapKeyRef,omitempty"`
@@ -302,15 +302,15 @@ type ValueSource struct {
SecretKeyRef *corev1.SecretKeySelector `json:"secretKeyRef,omitempty"`
}
-// RuntimeSpec represents the configuration for the Java runtime in charge to execute the Camel application
+// RuntimeSpec represents the configuration for the Java runtime in charge to execute the Camel application.
type RuntimeSpec struct {
// Camel K Runtime version
Version string `json:"version" yaml:"version"`
- // Camel main application provider, ie, Camel Quarkus
+ // Camel main application provider, ie, Camel Quarkus.
Provider RuntimeProvider `json:"provider" yaml:"provider"`
- // application entry point (main) to be executed
+ // application entry point (main) to be executed.
ApplicationClass string `json:"applicationClass" yaml:"applicationClass"`
- // list of dependencies needed to run the application
+ // list of dependencies needed to run the application.
Dependencies []MavenArtifact `json:"dependencies" yaml:"dependencies"`
// set of metadata
Metadata map[string]string `json:"metadata,omitempty" yaml:"metadata,omitempty"`
@@ -318,46 +318,46 @@ type RuntimeSpec struct {
Capabilities map[string]Capability `json:"capabilities,omitempty" yaml:"capabilities,omitempty"`
}
-// Capability is a particular feature which requires a well known set of dependencies
+// Capability is a particular feature which requires a well known set of dependencies.
type Capability struct {
Dependencies []MavenArtifact `json:"dependencies" yaml:"dependencies"`
}
const (
- // ServiceTypeUser service user type label marker
+ // ServiceTypeUser service user type label marker.
ServiceTypeUser = "user"
- // CapabilityRest defines the REST API service exposure capability
+ // CapabilityRest defines the REST API service exposure capability.
CapabilityRest = "rest"
- // CapabilityHealth defines the health monitoring capability
+ // CapabilityHealth defines the health monitoring capability.
CapabilityHealth = "health"
- // CapabilityCron defines the cron execution capability
+ // CapabilityCron defines the cron execution capability.
CapabilityCron = "cron"
- // CapabilityPlatformHTTP defines the http service exposure capability
+ // CapabilityPlatformHTTP defines the http service exposure capability.
CapabilityPlatformHTTP = "platform-http"
- // CapabilityCircuitBreaker defines the circuit breaker capability
+ // CapabilityCircuitBreaker defines the circuit breaker capability.
CapabilityCircuitBreaker = "circuit-breaker"
- // CapabilityTracing defines the tracing (opentracing) capability
+ // CapabilityTracing defines the tracing (opentracing) capability.
CapabilityTracing = "tracing"
- // CapabilityTelemetry defines the telemetry (opentelemetry) capability
+ // CapabilityTelemetry defines the telemetry (opentelemetry) capability.
CapabilityTelemetry = "telemetry"
- // CapabilityMaster defines the master capability
+ // CapabilityMaster defines the master capability.
CapabilityMaster = "master"
- // CapabilityResumeKafka defines the resume capability
+ // CapabilityResumeKafka defines the resume capability.
CapabilityResumeKafka = "resume-kafka"
- // CapabilityAwsSecretsManager defines the aws secrets manager capability
+ // CapabilityAwsSecretsManager defines the aws secrets manager capability.
CapabilityAwsSecretsManager = "aws-secrets-manager"
- // CapabilityGcpSecretManager defines the gcp secret manager capability
- CapabilityGcpSecretManager = "gcp-secret-manager"
- // CapabilityAzureKeyVault defines the azure key vault capability
+ // CapabilityGcpSecretManager defines the gcp secret manager capability.
+ CapabilityGcpSecretManager = "gcp-secret-manager" // nolint: gosec
+ // CapabilityAzureKeyVault defines the azure key vault capability.
CapabilityAzureKeyVault = "azure-key-vault"
- // CapabilityHashicorpVault defines the Hashicorp Vault capability
+ // CapabilityHashicorpVault defines the Hashicorp Vault capability.
CapabilityHashicorpVault = "hashicorp-vault"
)
// +kubebuilder:object:generate=false
-// ResourceCondition is a common type for all conditions
+// ResourceCondition is a common type for all conditions.
type ResourceCondition interface {
GetType() string
GetStatus() corev1.ConditionStatus
@@ -367,92 +367,92 @@ type ResourceCondition interface {
GetMessage() string
}
-// Flow is an unstructured object representing a Camel Flow in YAML/JSON DSL
+// Flow is an unstructured object representing a Camel Flow in YAML/JSON DSL.
type Flow struct {
RawMessage `json:",inline"`
}
-// RuntimeProvider is the provider chosen for the runtime
+// RuntimeProvider is the provider chosen for the runtime.
type RuntimeProvider string
const (
- // RuntimeProviderQuarkus Camel Quarkus runtime
+ // RuntimeProviderQuarkus Camel Quarkus runtime.
RuntimeProviderQuarkus RuntimeProvider = "quarkus"
)
-// SourceSpec defines the configuration for one or more routes to be executed in a certain Camel DSL language
+// SourceSpec defines the configuration for one or more routes to be executed in a certain Camel DSL language.
type SourceSpec struct {
- // contains configuration related to the source code
+ // contains configuration related to the source code.
DataSpec `json:",inline"`
- // specify which is the language (Camel DSL) used to interpret this source code
+ // specify which is the language (Camel DSL) used to interpret this source code.
Language Language `json:"language,omitempty"`
// Loader is an optional id of the org.apache.camel.k.RoutesLoader that will
- // interpret this source at runtime
+ // interpret this source at runtime.
Loader string `json:"loader,omitempty"`
// Interceptors are optional identifiers the org.apache.camel.k.RoutesLoader
- // uses to pre/post process sources
+ // uses to pre/post process sources.
Interceptors []string `json:"interceptors,omitempty"`
- // Type defines the kind of source described by this object
+ // Type defines the kind of source described by this object.
Type SourceType `json:"type,omitempty"`
- // List of property names defined in the source (e.g. if type is "template")
+ // List of property names defined in the source (e.g. if type is "template").
PropertyNames []string `json:"property-names,omitempty"`
}
-// SourceType represents an available source type
+// SourceType represents an available source type.
type SourceType string
const (
- // SourceTypeDefault is used to represent a source code
+ // SourceTypeDefault is used to represent a source code.
SourceTypeDefault SourceType = ""
- // SourceTypeTemplate is used to represent a template
+ // SourceTypeTemplate is used to represent a template.
SourceTypeTemplate SourceType = "template"
- // SourceTypeErrorHandler is used to represent an error handler
+ // SourceTypeErrorHandler is used to represent an error handler.
SourceTypeErrorHandler SourceType = "errorHandler"
)
-// DataSpec represents the way the source is materialized in the running `Pod`
+// DataSpec represents the way the source is materialized in the running `Pod`.
type DataSpec struct {
- // the name of the specification
+ // the name of the specification.
Name string `json:"name,omitempty"`
- // the path where the file is stored
+ // the path where the file is stored.
Path string `json:"path,omitempty"`
- // the source code (plain text)
+ // the source code (plain text).
Content string `json:"content,omitempty"`
- // the source code (binary)
+ // the source code (binary).
RawContent []byte `json:"rawContent,omitempty"`
- // the confimap reference holding the source content
+ // the confimap reference holding the source content.
ContentRef string `json:"contentRef,omitempty"`
- // the confimap key holding the source content
+ // the confimap key holding the source content.
ContentKey string `json:"contentKey,omitempty"`
- // the content type (tipically text or binary)
+ // the content type (tipically text or binary).
ContentType string `json:"contentType,omitempty"`
- // if the content is compressed (base64 encrypted)
+ // if the content is compressed (base64 encrypted).
Compression bool `json:"compression,omitempty"`
}
-// Language represents a supported language (Camel DSL)
+// Language represents a supported language (Camel DSL).
type Language string
const (
- // LanguageJavaSource used for Java
+ // LanguageJavaSource used for Java.
LanguageJavaSource Language = "java"
- // LanguageGroovy used for Groovy
+ // LanguageGroovy used for Groovy.
LanguageGroovy Language = "groovy"
- // LanguageJavaScript used for Javascript
+ // LanguageJavaScript used for Javascript.
LanguageJavaScript Language = "js"
- // LanguageXML used for XML
+ // LanguageXML used for XML.
LanguageXML Language = "xml"
- // LanguageKotlin used for Kotlin
+ // LanguageKotlin used for Kotlin.
LanguageKotlin Language = "kts"
- // LanguageYaml used for YAML
+ // LanguageYaml used for YAML.
LanguageYaml Language = "yaml"
- // LanguageKamelet used for Kamelets
+ // LanguageKamelet used for Kamelets.
LanguageKamelet Language = "kamelet"
- // LanguageJavaShell used for Java Shell
+ // LanguageJavaShell used for Java Shell.
LanguageJavaShell Language = "jsh"
)
-// Languages is the list of all supported languages
+// Languages is the list of all supported languages.
var Languages = []Language{
LanguageJavaSource,
LanguageGroovy,
diff --git a/pkg/apis/camel/v1/common_types_support.go b/pkg/apis/camel/v1/common_types_support.go
index 6b48170d3..79160d16c 100644
--- a/pkg/apis/camel/v1/common_types_support.go
+++ b/pkg/apis/camel/v1/common_types_support.go
@@ -116,7 +116,7 @@ func (m *RawMessage) UnmarshalJSON(data []byte) error {
return nil
}
-// String returns a string representation of RawMessage
+// String returns a string representation of RawMessage.
func (m *RawMessage) String() string {
if m == nil {
return ""
@@ -137,8 +137,8 @@ func GetOperatorIDAnnotation(obj metav1.Object) string {
return ""
}
- if operatorId, ok := obj.GetAnnotations()[OperatorIDAnnotation]; ok {
- return operatorId
+ if operatorID, ok := obj.GetAnnotations()[OperatorIDAnnotation]; ok {
+ return operatorID
}
return ""
diff --git a/pkg/apis/camel/v1/common_types_support_test.go b/pkg/apis/camel/v1/common_types_support_test.go
index a5ff49572..19be32952 100644
--- a/pkg/apis/camel/v1/common_types_support_test.go
+++ b/pkg/apis/camel/v1/common_types_support_test.go
@@ -31,11 +31,7 @@ import (
func TestTraitsMerge(t *testing.T) {
t1 := Traits{
Container: &trait.ContainerTrait{
- Trait: trait.Trait{
- Configuration: configurationFromMap(t, map[string]interface{}{
- "name": "test-container",
- }),
- },
+ Name: "test-container",
Auto: pointer.Bool(false),
ServicePort: 81,
},
@@ -54,11 +50,7 @@ func TestTraitsMerge(t *testing.T) {
}
t2 := Traits{
Container: &trait.ContainerTrait{
- Trait: trait.Trait{
- Configuration: configurationFromMap(t, map[string]interface{}{
- "port": 8081,
- }),
- },
+ Port: 8081,
PortName: "http-8081",
},
Logging: &trait.LoggingTrait{
@@ -80,12 +72,6 @@ func TestTraitsMerge(t *testing.T) {
assert.False(t, pointer.BoolDeref(t1.Container.Auto, true))
assert.Equal(t, "http-8081", t1.Container.PortName)
assert.Equal(t, 81, t1.Container.ServicePort)
- assert.Equal(t,
- configurationFromMap(t, map[string]interface{}{
- "name": "test-container",
- "port": 8081,
- }),
- t1.Container.Configuration)
// values from merged trait take precedence over the original ones
assert.NotNil(t, t1.Logging)
@@ -106,17 +92,6 @@ func TestTraitsMerge(t *testing.T) {
t1.Addons["telemetry"])
}
-func configurationFromMap(t *testing.T, configMap map[string]interface{}) *trait.Configuration {
- t.Helper()
-
- data, err := json.Marshal(configMap)
- require.NoError(t, err)
-
- return &trait.Configuration{
- RawMessage: data,
- }
-}
-
func toAddonTrait(t *testing.T, config map[string]interface{}) AddonTrait {
t.Helper()
diff --git a/pkg/apis/camel/v1/error_handler_types.go b/pkg/apis/camel/v1/error_handler_types.go
index 14a3721cd..49b93d20d 100644
--- a/pkg/apis/camel/v1/error_handler_types.go
+++ b/pkg/apis/camel/v1/error_handler_types.go
@@ -18,37 +18,37 @@ limitations under the License.
package v1
const (
- // ErrorHandlerRefName the reference name to use when looking for an error handler
+ // ErrorHandlerRefName the reference name to use when looking for an error handler.
ErrorHandlerRefName = "camel.k.errorHandler.ref"
- // ErrorHandlerRefDefaultName the default name of the error handler
+ // ErrorHandlerRefDefaultName the default name of the error handler.
ErrorHandlerRefDefaultName = "defaultErrorHandler"
- // ErrorHandlerAppPropertiesPrefix the prefix used for the error handler bean
+ // ErrorHandlerAppPropertiesPrefix the prefix used for the error handler bean.
ErrorHandlerAppPropertiesPrefix = "camel.beans.defaultErrorHandler"
)
-// ErrorHandlerSpec represents an unstructured object for an error handler
+// ErrorHandlerSpec represents an unstructured object for an error handler.
type ErrorHandlerSpec struct {
RawMessage `json:",inline,omitempty"`
}
-// ErrorHandlerParameters represent an unstructured object for error handler parameters
+// ErrorHandlerParameters represent an unstructured object for error handler parameters.
type ErrorHandlerParameters struct {
RawMessage `json:",inline,omitempty"`
}
-// BeanProperties represent an unstructured object properties to be set on a bean
+// BeanProperties represent an unstructured object properties to be set on a bean.
type BeanProperties struct {
RawMessage `json:",inline,omitempty"`
}
-// ErrorHandlerType a type of error handler (ie, sink)
+// ErrorHandlerType a type of error handler (ie, sink).
type ErrorHandlerType string
const (
errorHandlerTypeBase ErrorHandlerType = ""
- // ErrorHandlerTypeNone used to ignore any error event
+ // ErrorHandlerTypeNone used to ignore any error event.
ErrorHandlerTypeNone ErrorHandlerType = "none"
- // ErrorHandlerTypeLog used to log the event producing the error
+ // ErrorHandlerTypeLog used to log the event producing the error.
ErrorHandlerTypeLog ErrorHandlerType = "log"
// ErrorHandlerTypeSink used to send the event to a further sink (for future processing). This was previously known as dead-letter-channel.
ErrorHandlerTypeSink ErrorHandlerType = "sink"
diff --git a/pkg/apis/camel/v1/error_handler_types_support.go b/pkg/apis/camel/v1/error_handler_types_support.go
index c7bd7d0b0..483c39319 100644
--- a/pkg/apis/camel/v1/error_handler_types_support.go
+++ b/pkg/apis/camel/v1/error_handler_types_support.go
@@ -24,7 +24,7 @@ import (
// +kubebuilder:object:generate=false
-// ErrorHandler is a generic interface that represent any type of error handler specification
+// ErrorHandler is a generic interface that represent any type of error handler specification.
type ErrorHandler interface {
Type() ErrorHandlerType
Endpoint() *Endpoint
@@ -32,41 +32,41 @@ type ErrorHandler interface {
Validate() error
}
-// baseErrorHandler is the base used for the Error Handler hierarchy
+// baseErrorHandler is the base used for the Error Handler hierarchy.
type baseErrorHandler struct {
}
-// Type --
+// Type --.
func (e baseErrorHandler) Type() ErrorHandlerType {
return errorHandlerTypeBase
}
-// Endpoint --
+// Endpoint --.
func (e baseErrorHandler) Endpoint() *Endpoint {
return nil
}
-// Configuration --
+// Configuration --.
func (e baseErrorHandler) Configuration() (map[string]interface{}, error) {
return nil, nil
}
-// Validate --
+// Validate --.
func (e baseErrorHandler) Validate() error {
return nil
}
-// ErrorHandlerNone --
+// ErrorHandlerNone --.
type ErrorHandlerNone struct {
baseErrorHandler
}
-// Type --
+// Type --.
func (e ErrorHandlerNone) Type() ErrorHandlerType {
return ErrorHandlerTypeNone
}
-// Configuration --
+// Configuration --.
func (e ErrorHandlerNone) Configuration() (map[string]interface{}, error) {
return map[string]interface{}{
ErrorHandlerAppPropertiesPrefix: "#class:org.apache.camel.builder.NoErrorHandlerBuilder",
@@ -74,18 +74,18 @@ func (e ErrorHandlerNone) Configuration() (map[string]interface{}, error) {
}, nil
}
-// ErrorHandlerLog represent a default (log) error handler type
+// ErrorHandlerLog represent a default (log) error handler type.
type ErrorHandlerLog struct {
ErrorHandlerNone
Parameters *ErrorHandlerParameters `json:"parameters,omitempty"`
}
-// Type --
+// Type --.
func (e ErrorHandlerLog) Type() ErrorHandlerType {
return ErrorHandlerTypeLog
}
-// Configuration --
+// Configuration --.
func (e ErrorHandlerLog) Configuration() (map[string]interface{}, error) {
properties, err := e.ErrorHandlerNone.Configuration()
if err != nil {
@@ -107,23 +107,23 @@ func (e ErrorHandlerLog) Configuration() (map[string]interface{}, error) {
return properties, nil
}
-// ErrorHandlerSink represents a sink error handler type which behave like a dead letter channel
+// ErrorHandlerSink represents a sink error handler type which behave like a dead letter channel.
type ErrorHandlerSink struct {
ErrorHandlerLog
DLCEndpoint *Endpoint `json:"endpoint,omitempty"`
}
-// Type --
+// Type --.
func (e ErrorHandlerSink) Type() ErrorHandlerType {
return ErrorHandlerTypeSink
}
-// Endpoint --
+// Endpoint --.
func (e ErrorHandlerSink) Endpoint() *Endpoint {
return e.DLCEndpoint
}
-// Configuration --
+// Configuration --.
func (e ErrorHandlerSink) Configuration() (map[string]interface{}, error) {
properties, err := e.ErrorHandlerLog.Configuration()
if err != nil {
@@ -134,10 +134,10 @@ func (e ErrorHandlerSink) Configuration() (map[string]interface{}, error) {
return properties, err
}
-// Validate --
+// Validate --.
func (e ErrorHandlerSink) Validate() error {
if e.DLCEndpoint == nil {
- return fmt.Errorf("Missing endpoint in Error Handler Sink")
+ return fmt.Errorf("missing endpoint in Error Handler Sink")
}
return nil
}
diff --git a/pkg/apis/camel/v1/integration_types.go b/pkg/apis/camel/v1/integration_types.go
index 1aa7be885..a837a4814 100644
--- a/pkg/apis/camel/v1/integration_types.go
+++ b/pkg/apis/camel/v1/integration_types.go
@@ -39,27 +39,27 @@ import (
// +kubebuilder:printcolumn:name="Kit",type=string,JSONPath=`.status.integrationKit.name`,description="The integration kit"
// +kubebuilder:printcolumn:name="Replicas",type=integer,JSONPath=`.status.replicas`,description="The number of pods"
-// Integration is the Schema for the integrations API
+// Integration is the Schema for the integrations API.
type Integration struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
- // the desired Integration specification
+ // the desired Integration specification.
Spec IntegrationSpec `json:"spec,omitempty"`
- // the status of the Integration
+ // the status of the Integration.
Status IntegrationStatus `json:"status,omitempty"`
}
// IntegrationSpec specifies the configuration of an Integration.
// The Integration will be watched by the operator which will be in charge to run the related application, according to the configuration specified.
type IntegrationSpec struct {
- // the number of `Pods` needed for the running Integration
+ // the number of `Pods` needed for the running Integration.
Replicas *int32 `json:"replicas,omitempty"`
- // the sources which contain the Camel routes to run
+ // the sources which contain the Camel routes to run.
Sources []SourceSpec `json:"sources,omitempty"`
- // a source in YAML DSL language which contain the routes to run
+ // a source in YAML DSL language which contain the routes to run.
Flows []Flow `json:"flows,omitempty"`
- // the reference of the `IntegrationKit` which is used for this Integration
+ // the reference of the `IntegrationKit` which is used for this Integration.
IntegrationKit *corev1.ObjectReference `json:"integrationKit,omitempty"`
// the list of Camel or Maven dependencies required by the Integration
Dependencies []string `json:"dependencies,omitempty"`
@@ -81,42 +81,42 @@ type IntegrationSpec struct {
ServiceAccountName string `json:"serviceAccountName,omitempty"`
}
-// IntegrationStatus defines the observed state of Integration
+// IntegrationStatus defines the observed state of Integration.
type IntegrationStatus struct {
// ObservedGeneration is the most recent generation observed for this Integration.
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
- // the actual phase
+ // the actual phase.
Phase IntegrationPhase `json:"phase,omitempty"`
- // the digest calculated for this Integration
+ // the digest calculated for this Integration.
Digest string `json:"digest,omitempty"`
- // the container image used
+ // the container image used.
Image string `json:"image,omitempty"`
// a list of dependencies needed by the application
Dependencies []string `json:"dependencies,omitempty"`
// the profile needed to run this Integration
Profile TraitProfile `json:"profile,omitempty"`
- // the reference of the `IntegrationKit` which is used for this Integration
+ // the reference of the `IntegrationKit` which is used for this Integration.
IntegrationKit *corev1.ObjectReference `json:"integrationKit,omitempty"`
- // The IntegrationPlatform watching this Integration
+ // The IntegrationPlatform watching this Integration.
Platform string `json:"platform,omitempty"`
- // a list of sources generated for this Integration
+ // a list of sources generated for this Integration.
GeneratedSources []SourceSpec `json:"generatedSources,omitempty"`
- // the runtime version targeted for this Integration
+ // the runtime version targeted for this Integration.
RuntimeVersion string `json:"runtimeVersion,omitempty"`
- // the runtime provider targeted for this Integration
+ // the runtime provider targeted for this Integration.
RuntimeProvider RuntimeProvider `json:"runtimeProvider,omitempty"`
// Deprecated:
- // a list of configuration specification
+ // a list of configuration specification.
Configuration []ConfigurationSpec `json:"configuration,omitempty"`
- // a list of events happened for the Integration
+ // a list of events happened for the Integration.
Conditions []IntegrationCondition `json:"conditions,omitempty"`
- // the operator version
+ // the operator version.
Version string `json:"version,omitempty"`
- // the number of replicas
+ // the number of replicas.
Replicas *int32 `json:"replicas,omitempty"`
- // label selector
+ // label selector.
Selector string `json:"selector,omitempty"`
- // features offered by the Integration
+ // features offered by the Integration.
Capabilities []string `json:"capabilities,omitempty"`
// the timestamp representing the last time when this integration was initialized.
InitializationTimestamp *metav1.Time `json:"lastInitTimestamp,omitempty"`
@@ -124,131 +124,131 @@ type IntegrationStatus struct {
// +kubebuilder:object:root=true
-// IntegrationList contains a list of Integration
+// IntegrationList contains a list of Integration.
type IntegrationList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []Integration `json:"items"`
}
-// IntegrationPhase --
+// IntegrationPhase --.
type IntegrationPhase string
-// IntegrationConditionType --
+// IntegrationConditionType --.
type IntegrationConditionType string
const (
- // IntegrationKind --
+ // IntegrationKind --.
IntegrationKind string = "Integration"
- // IntegrationPhaseNone --
+ // IntegrationPhaseNone --.
IntegrationPhaseNone IntegrationPhase = ""
- // IntegrationPhaseWaitingForPlatform --
+ // IntegrationPhaseWaitingForPlatform --.
IntegrationPhaseWaitingForPlatform IntegrationPhase = "Waiting For Platform"
- // IntegrationPhaseInitialization --
+ // IntegrationPhaseInitialization --.
IntegrationPhaseInitialization IntegrationPhase = "Initialization"
- // IntegrationPhaseBuildingKit --
+ // IntegrationPhaseBuildingKit --.
IntegrationPhaseBuildingKit IntegrationPhase = "Building Kit"
- // IntegrationPhaseDeploying --
+ // IntegrationPhaseDeploying --.
IntegrationPhaseDeploying IntegrationPhase = "Deploying"
- // IntegrationPhaseRunning --
+ // IntegrationPhaseRunning --.
IntegrationPhaseRunning IntegrationPhase = "Running"
- // IntegrationPhaseError --
+ // IntegrationPhaseError --.
IntegrationPhaseError IntegrationPhase = "Error"
- // IntegrationConditionKitAvailable --
+ // IntegrationConditionKitAvailable --.
IntegrationConditionKitAvailable IntegrationConditionType = "IntegrationKitAvailable"
- // IntegrationConditionPlatformAvailable --
+ // IntegrationConditionPlatformAvailable --.
IntegrationConditionPlatformAvailable IntegrationConditionType = "IntegrationPlatformAvailable"
- // IntegrationConditionDeploymentAvailable --
+ // IntegrationConditionDeploymentAvailable --.
IntegrationConditionDeploymentAvailable IntegrationConditionType = "DeploymentAvailable"
- // IntegrationConditionServiceAvailable --
+ // IntegrationConditionServiceAvailable --.
IntegrationConditionServiceAvailable IntegrationConditionType = "ServiceAvailable"
- // IntegrationConditionKnativeServiceAvailable --
+ // IntegrationConditionKnativeServiceAvailable --.
IntegrationConditionKnativeServiceAvailable IntegrationConditionType = "KnativeServiceAvailable"
- // IntegrationConditionKnativeAvailable --
+ // IntegrationConditionKnativeAvailable --.
IntegrationConditionKnativeAvailable IntegrationConditionType = "KnativeAvailable"
- // IntegrationConditionCronJobAvailable --
+ // IntegrationConditionCronJobAvailable --.
IntegrationConditionCronJobAvailable IntegrationConditionType = "CronJobAvailable"
- // IntegrationConditionExposureAvailable --
+ // IntegrationConditionExposureAvailable --.
IntegrationConditionExposureAvailable IntegrationConditionType = "ExposureAvailable"
- // IntegrationConditionPrometheusAvailable --
+ // IntegrationConditionPrometheusAvailable --.
IntegrationConditionPrometheusAvailable IntegrationConditionType = "PrometheusAvailable"
- // IntegrationConditionJolokiaAvailable --
+ // IntegrationConditionJolokiaAvailable --.
IntegrationConditionJolokiaAvailable IntegrationConditionType = "JolokiaAvailable"
- // IntegrationConditionProbesAvailable --
+ // IntegrationConditionProbesAvailable --.
IntegrationConditionProbesAvailable IntegrationConditionType = "ProbesAvailable"
- // IntegrationConditionReady --
+ // IntegrationConditionReady --.
IntegrationConditionReady IntegrationConditionType = "Ready"
- // IntegrationConditionKitAvailableReason --
+ // IntegrationConditionKitAvailableReason --.
IntegrationConditionKitAvailableReason string = "IntegrationKitAvailable"
- // IntegrationConditionPlatformAvailableReason --
+ // IntegrationConditionPlatformAvailableReason --.
IntegrationConditionPlatformAvailableReason string = "IntegrationPlatformAvailable"
- // IntegrationConditionDeploymentAvailableReason --
+ // IntegrationConditionDeploymentAvailableReason --.
IntegrationConditionDeploymentAvailableReason string = "DeploymentAvailable"
- // IntegrationConditionDeploymentNotAvailableReason --
+ // IntegrationConditionDeploymentNotAvailableReason --.
IntegrationConditionDeploymentNotAvailableReason string = "DeploymentNotAvailable"
- // IntegrationConditionServiceAvailableReason --
+ // IntegrationConditionServiceAvailableReason --.
IntegrationConditionServiceAvailableReason string = "ServiceAvailable"
- // IntegrationConditionServiceNotAvailableReason --
+ // IntegrationConditionServiceNotAvailableReason --.
IntegrationConditionServiceNotAvailableReason string = "ServiceNotAvailable"
- // IntegrationConditionContainerNotAvailableReason --
+ // IntegrationConditionContainerNotAvailableReason --.
IntegrationConditionContainerNotAvailableReason string = "ContainerNotAvailable"
- // IntegrationConditionRouteAvailableReason --
+ // IntegrationConditionRouteAvailableReason --.
IntegrationConditionRouteAvailableReason string = "RouteAvailable"
- // IntegrationConditionRouteNotAvailableReason --
+ // IntegrationConditionRouteNotAvailableReason --.
IntegrationConditionRouteNotAvailableReason string = "RouteNotAvailable"
- // IntegrationConditionIngressAvailableReason --
+ // IntegrationConditionIngressAvailableReason --.
IntegrationConditionIngressAvailableReason string = "IngressAvailable"
- // IntegrationConditionIngressNotAvailableReason --
+ // IntegrationConditionIngressNotAvailableReason --.
IntegrationConditionIngressNotAvailableReason string = "IngressNotAvailable"
- // IntegrationConditionKnativeServiceAvailableReason --
+ // IntegrationConditionKnativeServiceAvailableReason --.
IntegrationConditionKnativeServiceAvailableReason string = "KnativeServiceAvailable"
- // IntegrationConditionKnativeServiceNotAvailableReason --
+ // IntegrationConditionKnativeServiceNotAvailableReason --.
IntegrationConditionKnativeServiceNotAvailableReason string = "KnativeServiceNotAvailable"
- // IntegrationConditionKnativeNotInstalledReason --
+ // IntegrationConditionKnativeNotInstalledReason --.
IntegrationConditionKnativeNotInstalledReason string = "KnativeNotInstalled"
- // IntegrationConditionCronJobAvailableReason --
+ // IntegrationConditionCronJobAvailableReason --.
IntegrationConditionCronJobAvailableReason string = "CronJobAvailableReason"
- // IntegrationConditionCronJobNotAvailableReason --
+ // IntegrationConditionCronJobNotAvailableReason --.
IntegrationConditionCronJobNotAvailableReason string = "CronJobNotAvailableReason"
- // IntegrationConditionPrometheusAvailableReason --
+ // IntegrationConditionPrometheusAvailableReason --.
IntegrationConditionPrometheusAvailableReason string = "PrometheusAvailable"
- // IntegrationConditionJolokiaAvailableReason --
+ // IntegrationConditionJolokiaAvailableReason --.
IntegrationConditionJolokiaAvailableReason string = "JolokiaAvailable"
- // IntegrationConditionProbesAvailableReason --
+ // IntegrationConditionProbesAvailableReason --.
IntegrationConditionProbesAvailableReason string = "ProbesAvailable"
- // IntegrationConditionKnativeServiceReadyReason --
+ // IntegrationConditionKnativeServiceReadyReason --.
IntegrationConditionKnativeServiceReadyReason string = "KnativeServiceReady"
- // IntegrationConditionDeploymentReadyReason --
+ // IntegrationConditionDeploymentReadyReason --.
IntegrationConditionDeploymentReadyReason string = "DeploymentReady"
- // IntegrationConditionDeploymentProgressingReason --
+ // IntegrationConditionDeploymentProgressingReason --.
IntegrationConditionDeploymentProgressingReason string = "DeploymentProgressing"
- // IntegrationConditionCronJobCreatedReason --
+ // IntegrationConditionCronJobCreatedReason --.
IntegrationConditionCronJobCreatedReason string = "CronJobCreated"
- // IntegrationConditionCronJobActiveReason --
+ // IntegrationConditionCronJobActiveReason --.
IntegrationConditionCronJobActiveReason string = "CronJobActive"
- // IntegrationConditionLastJobSucceededReason --
+ // IntegrationConditionLastJobSucceededReason --.
IntegrationConditionLastJobSucceededReason string = "LastJobSucceeded"
- // IntegrationConditionLastJobFailedReason --
+ // IntegrationConditionLastJobFailedReason --.
IntegrationConditionLastJobFailedReason string = "LastJobFailed"
- // IntegrationConditionRuntimeNotReadyReason --
+ // IntegrationConditionRuntimeNotReadyReason --.
IntegrationConditionRuntimeNotReadyReason string = "RuntimeNotReady"
- // IntegrationConditionErrorReason --
+ // IntegrationConditionErrorReason --.
IntegrationConditionErrorReason string = "Error"
- // IntegrationConditionInitializationFailedReason --
+ // IntegrationConditionInitializationFailedReason --.
IntegrationConditionInitializationFailedReason string = "InitializationFailed"
- // IntegrationConditionUnsupportedLanguageReason --
+ // IntegrationConditionUnsupportedLanguageReason --.
IntegrationConditionUnsupportedLanguageReason string = "UnsupportedLanguage"
- // IntegrationConditionKameletsAvailable --
+ // IntegrationConditionKameletsAvailable --.
IntegrationConditionKameletsAvailable IntegrationConditionType = "KameletsAvailable"
- // IntegrationConditionKameletsAvailableReason --
+ // IntegrationConditionKameletsAvailableReason --.
IntegrationConditionKameletsAvailableReason string = "KameletsAvailable"
- // IntegrationConditionKameletsNotAvailableReason --
+ // IntegrationConditionKameletsNotAvailableReason --.
IntegrationConditionKameletsNotAvailableReason string = "KameletsNotAvailable"
)
@@ -272,35 +272,35 @@ type IntegrationCondition struct {
Pods []PodCondition `json:"pods,omitempty"`
}
-// PodSpecTemplate represent a template used to deploy an Integration `Pod`
+// PodSpecTemplate represent a template used to deploy an Integration `Pod`.
type PodSpecTemplate struct {
- // the specification
+ // the specification.
Spec PodSpec `json:"spec,omitempty"`
}
-// PodSpec defines a group of Kubernetes resources
+// PodSpec defines a group of Kubernetes resources.
type PodSpec struct {
- // Volumes
+ // Volumes.
Volumes []corev1.Volume `json:"volumes,omitempty" patchStrategy:"merge,retainKeys" patchMergeKey:"name" protobuf:"bytes,1,rep,name=volumes"`
- // InitContainers
+ // InitContainers.
InitContainers []corev1.Container `json:"initContainers,omitempty" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,20,rep,name=initContainers"`
- // Containers
+ // Containers.
Containers []corev1.Container `json:"containers" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,2,rep,name=containers"`
- // EphemeralContainers
+ // EphemeralContainers.
EphemeralContainers []corev1.EphemeralContainer `json:"ephemeralContainers,omitempty" patchStrategy:"merge" patchMergeKey:"name" protobuf:"bytes,34,rep,name=ephemeralContainers"`
- // RestartPolicy
+ // RestartPolicy.
RestartPolicy corev1.RestartPolicy `json:"restartPolicy,omitempty" protobuf:"bytes,3,opt,name=restartPolicy,casttype=RestartPolicy"`
- // TerminationGracePeriodSeconds
+ // TerminationGracePeriodSeconds.
TerminationGracePeriodSeconds *int64 `json:"terminationGracePeriodSeconds,omitempty" protobuf:"varint,4,opt,name=terminationGracePeriodSeconds"`
- // ActiveDeadlineSeconds
+ // ActiveDeadlineSeconds.
ActiveDeadlineSeconds *int64 `json:"activeDeadlineSeconds,omitempty" protobuf:"varint,5,opt,name=activeDeadlineSeconds"`
- // DNSPolicy
+ // DNSPolicy.
DNSPolicy corev1.DNSPolicy `json:"dnsPolicy,omitempty" protobuf:"bytes,6,opt,name=dnsPolicy,casttype=DNSPolicy"`
- // NodeSelector
+ // NodeSelector.
NodeSelector map[string]string `json:"nodeSelector,omitempty" protobuf:"bytes,7,rep,name=nodeSelector"`
- // TopologySpreadConstraints
+ // TopologySpreadConstraints.
TopologySpreadConstraints []corev1.TopologySpreadConstraint `json:"topologySpreadConstraints,omitempty" patchStrategy:"merge" patchMergeKey:"topologyKey" protobuf:"bytes,33,opt,name=topologySpreadConstraints"`
- // PodSecurityContext
+ // PodSecurityContext.
SecurityContext corev1.PodSecurityContext `json:"securityContext,omitempty" protobuf:"bytes,34,opt,name=securityContext"`
}
diff --git a/pkg/apis/camel/v1/integration_types_support.go b/pkg/apis/camel/v1/integration_types_support.go
index d74145b7e..553c4ae2c 100644
--- a/pkg/apis/camel/v1/integration_types_support.go
+++ b/pkg/apis/camel/v1/integration_types_support.go
@@ -60,7 +60,7 @@ func (in *Integration) Initialize() {
}
}
-// Sources return a new slice containing all the sources associated to the integration
+// Sources return a new slice containing all the sources associated to the integration.
func (in *Integration) Sources() []SourceSpec {
sources := make([]SourceSpec, 0, len(in.Spec.Sources)+len(in.Status.GeneratedSources))
sources = append(sources, in.Spec.Sources...)
@@ -100,7 +100,7 @@ func (in *IntegrationSpec) AddDependency(dependency string) {
in.Dependencies = append(in.Dependencies, dependency)
}
-// GetConfigurationProperty returns a configuration property
+// GetConfigurationProperty returns a configuration property.
func (in *IntegrationSpec) GetConfigurationProperty(property string) string {
for _, confSpec := range in.Configuration {
if confSpec.Type == "property" && strings.HasPrefix(confSpec.Value, property) {
@@ -192,7 +192,7 @@ func NewSourceSpec(name string, content string, language Language) SourceSpec {
}
}
-// InferLanguage returns the language of the source or discovers it from file extension if not set
+// InferLanguage returns the language of the source or discovers it from file extension if not set.
func (in *SourceSpec) InferLanguage() Language {
if in.Language != "" {
return in.Language
@@ -205,7 +205,7 @@ func (in *SourceSpec) InferLanguage() Language {
return ""
}
-// SetOperatorID sets the given operator id as an annotation
+// SetOperatorID sets the given operator id as an annotation.
func (in *Integration) SetOperatorID(operatorID string) {
SetAnnotation(&in.ObjectMeta, OperatorIDAnnotation, operatorID)
}
@@ -232,7 +232,7 @@ func (in *Integration) SetIntegrationKit(kit *IntegrationKit) {
if kit.Status.Phase != IntegrationKitPhaseReady {
cs = corev1.ConditionFalse
if kit.Status.Phase == IntegrationKitPhaseNone {
- message = fmt.Sprintf("creating a new integration kit")
+ message = "creating a new integration kit"
} else {
message = fmt.Sprintf("integration kit %s/%s is in state %q", kit.Namespace, kit.Name, kit.Status.Phase)
}
diff --git a/pkg/apis/camel/v1/integrationkit_types.go b/pkg/apis/camel/v1/integrationkit_types.go
index abe34684f..561217f31 100644
--- a/pkg/apis/camel/v1/integrationkit_types.go
+++ b/pkg/apis/camel/v1/integrationkit_types.go
@@ -52,7 +52,7 @@ type IntegrationKit struct {
Status IntegrationKitStatus `json:"status,omitempty"`
}
-// IntegrationKitSpec defines a container image and additional configurations required to kick off an `Integration` with certain features
+// IntegrationKitSpec defines a container image and additional configurations required to kick off an `Integration` with certain features.
type IntegrationKitSpec struct {
// the container image as identified in the container registry
Image string `json:"image,omitempty"`
@@ -75,7 +75,7 @@ type IntegrationKitSpec struct {
Sources []SourceSpec `json:"sources,omitempty"`
}
-// IntegrationKitTraits defines traits assigned to an `IntegrationKit`
+// IntegrationKitTraits defines traits assigned to an `IntegrationKit`.
type IntegrationKitTraits struct {
// The builder trait is internally used to determine the best strategy to build and configure IntegrationKits.
Builder *trait.BuilderTrait `property:"builder" json:"builder,omitempty"`
@@ -91,7 +91,7 @@ type IntegrationKitTraits struct {
Addons map[string]AddonTrait `json:"addons,omitempty"`
}
-// IntegrationKitStatus defines the observed state of IntegrationKit
+// IntegrationKitStatus defines the observed state of IntegrationKit.
type IntegrationKitStatus struct {
// ObservedGeneration is the most recent generation observed for this IntegrationKit.
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
@@ -121,66 +121,66 @@ type IntegrationKitStatus struct {
// +kubebuilder:object:root=true
-// IntegrationKitList contains a list of IntegrationKit
+// IntegrationKitList contains a list of IntegrationKit.
type IntegrationKitList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []IntegrationKit `json:"items"`
}
-// IntegrationKitPhase --
+// IntegrationKitPhase --.
type IntegrationKitPhase string
-// IntegrationKitConditionType --
+// IntegrationKitConditionType --.
type IntegrationKitConditionType string
const (
- // IntegrationKitKind --
+ // IntegrationKitKind --.
IntegrationKitKind string = "IntegrationKit"
- // IntegrationKitTypeLabel labels the kit type
+ // IntegrationKitTypeLabel labels the kit type.
IntegrationKitTypeLabel = "camel.apache.org/kit.type"
- // IntegrationKitTypePlatform identifies a kit created by the platform
+ // IntegrationKitTypePlatform identifies a kit created by the platform.
IntegrationKitTypePlatform = "platform"
- // IntegrationKitTypeUser identifies a kit created by the user
+ // IntegrationKitTypeUser identifies a kit created by the user.
IntegrationKitTypeUser = "user"
- // IntegrationKitTypeExternal identifies a kit created by any third party
+ // IntegrationKitTypeExternal identifies a kit created by any third party.
IntegrationKitTypeExternal = "external"
- // IntegrationKitLayoutLabel labels the kit layout
+ // IntegrationKitLayoutLabel labels the kit layout.
IntegrationKitLayoutLabel = "camel.apache.org/kit.layout"
- // IntegrationKitLayoutFastJar labels a kit using the Quarkus fast-jar packaging
+ // IntegrationKitLayoutFastJar labels a kit using the Quarkus fast-jar packaging.
IntegrationKitLayoutFastJar = "fast-jar"
- // IntegrationKitLayoutNative labels a kit using the Quarkus native packaging
+ // IntegrationKitLayoutNative labels a kit using the Quarkus native packaging.
IntegrationKitLayoutNative = "native"
- // IntegrationKitPriorityLabel labels the kit priority
+ // IntegrationKitPriorityLabel labels the kit priority.
IntegrationKitPriorityLabel = "camel.apache.org/kit.priority"
- // IntegrationKitPhaseNone --
+ // IntegrationKitPhaseNone --.
IntegrationKitPhaseNone IntegrationKitPhase = ""
- // IntegrationKitPhaseInitialization --
+ // IntegrationKitPhaseInitialization --.
IntegrationKitPhaseInitialization IntegrationKitPhase = "Initialization"
- // IntegrationKitPhaseWaitingForPlatform --
+ // IntegrationKitPhaseWaitingForPlatform --.
IntegrationKitPhaseWaitingForPlatform IntegrationKitPhase = "Waiting For Platform"
- // IntegrationKitPhaseBuildSubmitted --
+ // IntegrationKitPhaseBuildSubmitted --.
IntegrationKitPhaseBuildSubmitted IntegrationKitPhase = "Build Submitted"
- // IntegrationKitPhaseBuildRunning --
+ // IntegrationKitPhaseBuildRunning --.
IntegrationKitPhaseBuildRunning IntegrationKitPhase = "Build Running"
- // IntegrationKitPhaseWaitingForCatalog --
+ // IntegrationKitPhaseWaitingForCatalog --.
IntegrationKitPhaseWaitingForCatalog IntegrationKitPhase = "Waiting For Catalog"
- // IntegrationKitPhaseReady --
+ // IntegrationKitPhaseReady --.
IntegrationKitPhaseReady IntegrationKitPhase = "Ready"
- // IntegrationKitPhaseError --
+ // IntegrationKitPhaseError --.
IntegrationKitPhaseError IntegrationKitPhase = "Error"
- // IntegrationKitConditionPlatformAvailable --
+ // IntegrationKitConditionPlatformAvailable --.
IntegrationKitConditionPlatformAvailable IntegrationKitConditionType = "IntegrationPlatformAvailable"
- // IntegrationKitConditionCatalogAvailable --
+ // IntegrationKitConditionCatalogAvailable --.
IntegrationKitConditionCatalogAvailable IntegrationKitConditionType = "CamelCatalogAvailable"
- // IntegrationKitConditionPlatformAvailableReason --
+ // IntegrationKitConditionPlatformAvailableReason --.
IntegrationKitConditionPlatformAvailableReason string = "IntegrationPlatformAvailable"
)
diff --git a/pkg/apis/camel/v1/integrationkit_types_support.go b/pkg/apis/camel/v1/integrationkit_types_support.go
index 87d7667be..7ee0c0328 100644
--- a/pkg/apis/camel/v1/integrationkit_types_support.go
+++ b/pkg/apis/camel/v1/integrationkit_types_support.go
@@ -54,7 +54,7 @@ func (in *IntegrationKitSpec) Configurations() []ConfigurationSpec {
return in.Configuration
}
-// SetOperatorID sets the given operator id as an annotation
+// SetOperatorID sets the given operator id as an annotation.
func (in *IntegrationKit) SetOperatorID(operatorID string) {
SetAnnotation(&in.ObjectMeta, OperatorIDAnnotation, operatorID)
}
diff --git a/pkg/apis/camel/v1/integrationplatform_types.go b/pkg/apis/camel/v1/integrationplatform_types.go
index d87737358..87014032a 100644
--- a/pkg/apis/camel/v1/integrationplatform_types.go
+++ b/pkg/apis/camel/v1/integrationplatform_types.go
@@ -23,18 +23,18 @@ import (
)
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
-// Important: Run "make generate-deepcopy" to regenerate code after modifying this file
+// Important: Run "make generate-deepcopy" to regenerate code after modifying this file.
-// IntegrationPlatformSpec defines the desired state of IntegrationPlatform
+// IntegrationPlatformSpec defines the desired state of IntegrationPlatform.
type IntegrationPlatformSpec struct {
- // what kind of cluster you're running (ie, plain Kubernetes or OpenShift)
+ // what kind of cluster you're running (ie, plain Kubernetes or OpenShift).
Cluster IntegrationPlatformCluster `json:"cluster,omitempty"`
// the profile you wish to use. It will apply certain traits which are required by the specific profile chosen.
- // It usually relates the Cluster with the optional definition of special profiles (ie, Knative)
+ // It usually relates the Cluster with the optional definition of special profiles (ie, Knative).
Profile TraitProfile `json:"profile,omitempty"`
- // specify how to build the Integration/IntegrationKits
+ // specify how to build the Integration/IntegrationKits.
Build IntegrationPlatformBuildSpec `json:"build,omitempty"`
- // list of traits to be executed for all the Integration/IntegrationKits built from this IntegrationPlatform
+ // list of traits to be executed for all the Integration/IntegrationKits built from this IntegrationPlatform.
Traits Traits `json:"traits,omitempty"`
// Deprecated:
// Use camel trait (camel.properties) to manage properties
@@ -47,7 +47,7 @@ type IntegrationPlatformSpec struct {
Kamelet IntegrationPlatformKameletSpec `json:"kamelet,omitempty"`
}
-// IntegrationPlatformStatus defines the observed state of IntegrationPlatform
+// IntegrationPlatformStatus defines the observed state of IntegrationPlatform.
type IntegrationPlatformStatus struct {
IntegrationPlatformSpec `json:",inline"`
// ObservedGeneration is the most recent generation observed for this IntegrationPlatform.
@@ -76,7 +76,7 @@ type IntegrationPlatformStatus struct {
// IntegrationPlatform is the resource used to drive the Camel K operator behavior.
// It defines the behavior of all Custom Resources (`IntegrationKit`, `Integration`, `Kamelet`) in the given namespace.
// When the Camel K operator is installed in `global` mode,
-// you will need to specify an `IntegrationPlatform` in each namespace where you want the Camel K operator to be executed
+// you will need to specify an `IntegrationPlatform` in each namespace where you want the Camel K operator to be executed.
type IntegrationPlatform struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
@@ -87,24 +87,24 @@ type IntegrationPlatform struct {
// +kubebuilder:object:root=true
-// IntegrationPlatformList contains a list of IntegrationPlatform
+// IntegrationPlatformList contains a list of IntegrationPlatform.
type IntegrationPlatformList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []IntegrationPlatform `json:"items"`
}
-// IntegrationPlatformCluster is the kind of orchestration cluster the platform is installed into
+// IntegrationPlatformCluster is the kind of orchestration cluster the platform is installed into.
type IntegrationPlatformCluster string
const (
- // IntegrationPlatformClusterOpenShift is used when targeting an OpenShift cluster
+ // IntegrationPlatformClusterOpenShift is used when targeting an OpenShift cluster.
IntegrationPlatformClusterOpenShift IntegrationPlatformCluster = "OpenShift"
- // IntegrationPlatformClusterKubernetes is used when targeting a Kubernetes cluster
+ // IntegrationPlatformClusterKubernetes is used when targeting a Kubernetes cluster.
IntegrationPlatformClusterKubernetes IntegrationPlatformCluster = "Kubernetes"
)
-// AllIntegrationPlatformClusters --
+// AllIntegrationPlatformClusters --.
var AllIntegrationPlatformClusters = []IntegrationPlatformCluster{IntegrationPlatformClusterOpenShift, IntegrationPlatformClusterKubernetes}
// IntegrationPlatformBuildSpec contains platform related build information.
@@ -136,19 +136,19 @@ type IntegrationPlatformBuildSpec struct {
MaxRunningBuilds int32 `json:"maxRunningBuilds,omitempty"`
}
-// IntegrationPlatformKameletSpec define the behavior for all the Kamelets controller by the IntegrationPlatform
+// IntegrationPlatformKameletSpec define the behavior for all the Kamelets controller by the IntegrationPlatform.
type IntegrationPlatformKameletSpec struct {
// remote repository used to retrieve Kamelet catalog
Repositories []IntegrationPlatformKameletRepositorySpec `json:"repositories,omitempty"`
}
-// IntegrationPlatformKameletRepositorySpec defines the location of the Kamelet catalog to use
+// IntegrationPlatformKameletRepositorySpec defines the location of the Kamelet catalog to use.
type IntegrationPlatformKameletRepositorySpec struct {
// the remote repository in the format github:ORG/REPO/PATH_TO_KAMELETS_FOLDER
URI string `json:"uri,omitempty"`
}
-// IntegrationPlatformBuildPublishStrategy defines the strategy used to package and publish an Integration base image
+// IntegrationPlatformBuildPublishStrategy defines the strategy used to package and publish an Integration base image.
type IntegrationPlatformBuildPublishStrategy string
const (
@@ -160,14 +160,14 @@ const (
IntegrationPlatformBuildPublishStrategyKaniko IntegrationPlatformBuildPublishStrategy = "Kaniko"
// IntegrationPlatformBuildPublishStrategyS2I uses the Source to Images (S2I) feature
// (https://docs.openshift.com/container-platform/4.9/openshift_images/create-images.html#images-create-s2i_create-images)
- // provided by an OpenShift cluster in order to create and push the images to the registry. It is the default choice on OpenShift cluster
+ // provided by an OpenShift cluster in order to create and push the images to the registry. It is the default choice on OpenShift cluster.
IntegrationPlatformBuildPublishStrategyS2I IntegrationPlatformBuildPublishStrategy = "S2I"
// IntegrationPlatformBuildPublishStrategySpectrum uses Spectrum project (https://github.com/container-tools/spectrum)
- // in order to push the incremental images to the image repository. It is the default choice on vanilla Kubernetes cluster
+ // in order to push the incremental images to the image repository. It is the default choice on vanilla Kubernetes cluster.
IntegrationPlatformBuildPublishStrategySpectrum IntegrationPlatformBuildPublishStrategy = "Spectrum"
)
-// IntegrationPlatformBuildPublishStrategies the list of all available publish strategies
+// IntegrationPlatformBuildPublishStrategies the list of all available publish strategies.
var IntegrationPlatformBuildPublishStrategies = []IntegrationPlatformBuildPublishStrategy{
IntegrationPlatformBuildPublishStrategyBuildah,
IntegrationPlatformBuildPublishStrategyKaniko,
@@ -175,27 +175,27 @@ var IntegrationPlatformBuildPublishStrategies = []IntegrationPlatformBuildPublis
IntegrationPlatformBuildPublishStrategySpectrum,
}
-// IntegrationPlatformPhase is the phase of an IntegrationPlatform
+// IntegrationPlatformPhase is the phase of an IntegrationPlatform.
type IntegrationPlatformPhase string
-// IntegrationPlatformConditionType defines the type of condition
+// IntegrationPlatformConditionType defines the type of condition.
type IntegrationPlatformConditionType string
const (
- // IntegrationPlatformKind is the Kind name of the IntegrationPlatform CR
+ // IntegrationPlatformKind is the Kind name of the IntegrationPlatform CR.
IntegrationPlatformKind string = "IntegrationPlatform"
- // IntegrationPlatformPhaseNone when the IntegrationPlatform does not exist
+ // IntegrationPlatformPhaseNone when the IntegrationPlatform does not exist.
IntegrationPlatformPhaseNone IntegrationPlatformPhase = ""
- // IntegrationPlatformPhaseCreating when the IntegrationPlatform is under creation process
+ // IntegrationPlatformPhaseCreating when the IntegrationPlatform is under creation process.
IntegrationPlatformPhaseCreating IntegrationPlatformPhase = "Creating"
- // IntegrationPlatformPhaseWarming when the IntegrationPlatform is warming (ie, creating Kaniko cache)
+ // IntegrationPlatformPhaseWarming when the IntegrationPlatform is warming (ie, creating Kaniko cache).
IntegrationPlatformPhaseWarming IntegrationPlatformPhase = "Warming"
- // IntegrationPlatformPhaseReady when the IntegrationPlatform is ready
+ // IntegrationPlatformPhaseReady when the IntegrationPlatform is ready.
IntegrationPlatformPhaseReady IntegrationPlatformPhase = "Ready"
- // IntegrationPlatformPhaseError when the IntegrationPlatform had some error (see Conditions)
+ // IntegrationPlatformPhaseError when the IntegrationPlatform had some error (see Conditions).
IntegrationPlatformPhaseError IntegrationPlatformPhase = "Error"
- // IntegrationPlatformPhaseDuplicate when the IntegrationPlatform is duplicated
+ // IntegrationPlatformPhaseDuplicate when the IntegrationPlatform is duplicated.
IntegrationPlatformPhaseDuplicate IntegrationPlatformPhase = "Duplicate"
// IntegrationPlatformConditionReady is the condition if the IntegrationPlatform is ready.
diff --git a/pkg/apis/camel/v1/integrationplatform_types_support.go b/pkg/apis/camel/v1/integrationplatform_types_support.go
index 599f40ef7..c421bbfbb 100644
--- a/pkg/apis/camel/v1/integrationplatform_types_support.go
+++ b/pkg/apis/camel/v1/integrationplatform_types_support.go
@@ -24,7 +24,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
-// NewIntegrationPlatformList --
+// NewIntegrationPlatformList --.
func NewIntegrationPlatformList() IntegrationPlatformList {
return IntegrationPlatformList{
TypeMeta: metav1.TypeMeta{
@@ -34,7 +34,7 @@ func NewIntegrationPlatformList() IntegrationPlatformList {
}
}
-// NewIntegrationPlatform --
+// NewIntegrationPlatform --.
func NewIntegrationPlatform(namespace string, name string) IntegrationPlatform {
return IntegrationPlatform{
TypeMeta: metav1.TypeMeta{
@@ -48,7 +48,7 @@ func NewIntegrationPlatform(namespace string, name string) IntegrationPlatform {
}
}
-// Configurations --
+// Configurations --.
func (in *IntegrationPlatformSpec) Configurations() []ConfigurationSpec {
if in == nil {
return []ConfigurationSpec{}
@@ -57,12 +57,12 @@ func (in *IntegrationPlatformSpec) Configurations() []ConfigurationSpec {
return in.Configuration
}
-// SetOperatorID sets the given operator id as an annotation
+// SetOperatorID sets the given operator id as an annotation.
func (in *IntegrationPlatform) SetOperatorID(operatorID string) {
SetAnnotation(&in.ObjectMeta, OperatorIDAnnotation, operatorID)
}
-// Configurations --
+// Configurations --.
func (in *IntegrationPlatform) Configurations() []ConfigurationSpec {
if in == nil {
return []ConfigurationSpec{}
@@ -75,7 +75,7 @@ func (in *IntegrationPlatform) Configurations() []ConfigurationSpec {
return in.Spec.Configuration
}
-// AddConfiguration --
+// AddConfiguration --.
func (in *IntegrationPlatform) AddConfiguration(confType string, confValue string) {
in.Spec.Configuration = append(in.Spec.Configuration, ConfigurationSpec{
Type: confType,
@@ -83,7 +83,7 @@ func (in *IntegrationPlatform) AddConfiguration(confType string, confValue strin
})
}
-// GetActualValue can be used to extract information the platform spec or its derived config in the status
+// GetActualValue can be used to extract information the platform spec or its derived config in the status.
func (in *IntegrationPlatform) GetActualValue(extractor func(spec IntegrationPlatformSpec) string) string {
res := extractor(in.Status.IntegrationPlatformSpec)
if res == "" {
@@ -173,9 +173,9 @@ func (in *IntegrationPlatformStatus) RemoveCondition(condType IntegrationPlatfor
in.Conditions = newConditions
}
-// IsOptionEnabled tells if provided option key is present in PublishStrategyOptions and enabled
+// IsOptionEnabled tells if provided option key is present in PublishStrategyOptions and enabled.
func (b IntegrationPlatformBuildSpec) IsOptionEnabled(option string) bool {
- //Key defined in builder/kaniko.go
+ // Key defined in builder/kaniko.go
if enabled, ok := b.PublishStrategyOptions[option]; ok {
res, err := strconv.ParseBool(enabled)
if err != nil {
@@ -186,7 +186,7 @@ func (b IntegrationPlatformBuildSpec) IsOptionEnabled(option string) bool {
return false
}
-// AddOption add a publish strategy option
+// AddOption add a publish strategy option.
func (b *IntegrationPlatformBuildSpec) AddOption(option string, value string) {
options := b.PublishStrategyOptions
if options == nil {
@@ -196,7 +196,7 @@ func (b *IntegrationPlatformBuildSpec) AddOption(option string, value string) {
options[option] = value
}
-// GetTimeout returns the specified duration or a default one
+// GetTimeout returns the specified duration or a default one.
func (b IntegrationPlatformBuildSpec) GetTimeout() metav1.Duration {
if b.Timeout == nil {
return metav1.Duration{}
@@ -204,7 +204,7 @@ func (b IntegrationPlatformBuildSpec) GetTimeout() metav1.Duration {
return *b.Timeout
}
-// GetBuildCatalogToolTimeout returns the specified duration or a default one
+// GetBuildCatalogToolTimeout returns the specified duration or a default one.
func (b IntegrationPlatformBuildSpec) GetBuildCatalogToolTimeout() metav1.Duration {
if b.BuildCatalogToolTimeout == nil {
return metav1.Duration{}
@@ -214,7 +214,7 @@ func (b IntegrationPlatformBuildSpec) GetBuildCatalogToolTimeout() metav1.Durati
var _ ResourceCondition = IntegrationPlatformCondition{}
-// GetConditions --
+// GetConditions --.
func (in *IntegrationPlatformStatus) GetConditions() []ResourceCondition {
res := make([]ResourceCondition, 0, len(in.Conditions))
for _, c := range in.Conditions {
@@ -223,32 +223,32 @@ func (in *IntegrationPlatformStatus) GetConditions() []ResourceCondition {
return res
}
-// GetType --
+// GetType --.
func (c IntegrationPlatformCondition) GetType() string {
return string(c.Type)
}
-// GetStatus --
+// GetStatus --.
func (c IntegrationPlatformCondition) GetStatus() corev1.ConditionStatus {
return c.Status
}
-// GetLastUpdateTime --
+// GetLastUpdateTime --.
func (c IntegrationPlatformCondition) GetLastUpdateTime() metav1.Time {
return c.LastUpdateTime
}
-// GetLastTransitionTime --
+// GetLastTransitionTime --.
func (c IntegrationPlatformCondition) GetLastTransitionTime() metav1.Time {
return c.LastTransitionTime
}
-// GetReason --
+// GetReason --.
func (c IntegrationPlatformCondition) GetReason() string {
return c.Reason
}
-// GetMessage --
+// GetMessage --.
func (c IntegrationPlatformCondition) GetMessage() string {
return c.Message
}
diff --git a/pkg/apis/camel/v1/kamelet_types.go b/pkg/apis/camel/v1/kamelet_types.go
index 9d224b8fd..1395cc12e 100644
--- a/pkg/apis/camel/v1/kamelet_types.go
+++ b/pkg/apis/camel/v1/kamelet_types.go
@@ -23,29 +23,29 @@ import (
)
const (
- // AnnotationIcon label used by icons
+ // AnnotationIcon label used by icons.
AnnotationIcon = "camel.apache.org/kamelet.icon"
- // KameletBundledLabel label used by bundling
+ // KameletBundledLabel label used by bundling.
KameletBundledLabel = "camel.apache.org/kamelet.bundled"
- // KameletReadOnlyLabel label used to identify readonly Kamelets
+ // KameletReadOnlyLabel label used to identify readonly Kamelets.
KameletReadOnlyLabel = "camel.apache.org/kamelet.readonly"
- // KameletTypeLabel label used to identify Kamelet type
+ // KameletTypeLabel label used to identify Kamelet type.
KameletTypeLabel = "camel.apache.org/kamelet.type"
- // KameletGroupLabel label used to group Kamelets
+ // KameletGroupLabel label used to group Kamelets.
KameletGroupLabel = "camel.apache.org/kamelet.group"
- // KameletTypeSink type Sink
+ // KameletTypeSink type Sink.
KameletTypeSink = "sink"
- // KameletTypeSource type Source
+ // KameletTypeSource type Source.
KameletTypeSource = "source"
- // KameletTypeAction type Action
+ // KameletTypeAction type Action.
KameletTypeAction = "action"
)
var (
- // reservedKameletNames used to mark reserved names
+ // reservedKameletNames used to mark reserved names.
reservedKameletNames = map[string]bool{"source": true, "sink": true}
- // KameletIDProperty used to identify
+ // KameletIDProperty used to identify.
KameletIDProperty = "id"
)
@@ -56,98 +56,98 @@ var (
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="Phase",type=string,JSONPath=`.status.phase`,description="The Kamelet phase"
-// Kamelet is the Schema for the kamelets API
+// Kamelet is the Schema for the kamelets API.
type Kamelet struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
- // the desired specification
+ // the desired specification.
Spec KameletSpec `json:"spec,omitempty"`
- // the actual status of the resource
+ // the actual status of the resource.
Status KameletStatus `json:"status,omitempty"`
}
-// KameletSpec specifies the configuration required to execute a Kamelet
+// KameletSpec specifies the configuration required to execute a Kamelet.
type KameletSpec struct {
- // defines the formal configuration of the Kamelet
+ // defines the formal configuration of the Kamelet.
Definition *JSONSchemaProps `json:"definition,omitempty"`
- // sources in any Camel DSL supported
+ // sources in any Camel DSL supported.
Sources []SourceSpec `json:"sources,omitempty"`
- // the main source in YAML DSL
+ // the main source in YAML DSL.
Template *Template `json:"template,omitempty"`
// data specification types for the events consumed/produced by the Kamelet
- // Deprecated: In favor of using DataTypes
+ // Deprecated: In favor of using DataTypes.
Types map[TypeSlot]EventTypeSpec `json:"types,omitempty"`
- // data specification types for the events consumed/produced by the Kamelet
+ // data specification types for the events consumed/produced by the Kamelet.
DataTypes map[TypeSlot]DataTypesSpec `json:"dataTypes,omitempty"`
- // Camel dependencies needed by the Kamelet
+ // Camel dependencies needed by the Kamelet.
Dependencies []string `json:"dependencies,omitempty"`
}
-// Template is an unstructured object representing a Kamelet template in YAML/JSON DSL
+// Template is an unstructured object representing a Kamelet template in YAML/JSON DSL.
type Template struct {
- // an unstructured raw message
+ // an unstructured raw message.
RawMessage `json:",inline"`
}
-// TypeSlot represent a kind of data (ie, input, output, ...)
+// TypeSlot represent a kind of data (ie, input, output, ...).
type TypeSlot string
const (
- // TypeSlotIn is used for the input events
+ // TypeSlotIn is used for the input events.
TypeSlotIn TypeSlot = "in"
- // TypeSlotOut is used for the output events
+ // TypeSlotOut is used for the output events.
TypeSlotOut TypeSlot = "out"
- // TypeSlotError is used for the error events
+ // TypeSlotError is used for the error events.
TypeSlotError TypeSlot = "error"
)
// EventTypeSpec represents a specification for an event type
-// Deprecated: In favor of using DataTypeSpec
+// Deprecated: In favor of using DataTypeSpec.
type EventTypeSpec struct {
- // media type as expected for HTTP media types (ie, application/json)
+ // media type as expected for HTTP media types (ie, application/json).
MediaType string `json:"mediaType,omitempty"`
- // the expected schema for the event
+ // the expected schema for the event.
Schema *JSONSchemaProps `json:"schema,omitempty"`
}
-// DataTypesSpec represents the specification for a set of data types
+// DataTypesSpec represents the specification for a set of data types.
type DataTypesSpec struct {
- // the default data type for this Kamelet
+ // the default data type for this Kamelet.
Default string `json:"default,omitempty"`
- // one to many data type specifications
+ // one to many data type specifications.
Types map[string]DataTypeSpec `json:"types,omitempty"`
- // one to many header specifications
+ // one to many header specifications.
Headers map[string]HeaderSpec `json:"headers,omitempty"`
}
-// DataTypeSpec represents the specification for a data type
+// DataTypeSpec represents the specification for a data type.
type DataTypeSpec struct {
- // the data type component scheme
+ // the data type component scheme.
Scheme string `json:"scheme,omitempty"`
- // the data type format name
+ // the data type format name.
Format string `json:"format,omitempty"`
- // optional description
+ // optional description.
Description string `json:"description,omitempty"`
- // media type as expected for HTTP media types (ie, application/json)
+ // media type as expected for HTTP media types (ie, application/json).
MediaType string `json:"mediaType,omitempty"`
- // the list of Camel or Maven dependencies required by the data type
+ // the list of Camel or Maven dependencies required by the data type.
Dependencies []string `json:"dependencies,omitempty"`
- // one to many header specifications
+ // one to many header specifications.
Headers map[string]HeaderSpec `json:"headers,omitempty"`
- // the expected schema for the data type
+ // the expected schema for the data type.
Schema *JSONSchemaProps `json:"schema,omitempty"`
}
-// DataTypeReference references to the specification of a data type by its scheme and format name
+// DataTypeReference references to the specification of a data type by its scheme and format name.
type DataTypeReference struct {
- // the data type component scheme
+ // the data type component scheme.
Scheme string `json:"scheme,omitempty"`
- // the data type format name
+ // the data type format name.
Format string `json:"format,omitempty"`
}
-// HeaderSpec represents the specification for a header used in the Kamelet
+// HeaderSpec represents the specification for a header used in the Kamelet.
type HeaderSpec struct {
Type string `json:"type,omitempty"`
Title string `json:"title,omitempty"`
@@ -156,7 +156,7 @@ type HeaderSpec struct {
Default string `json:"default,omitempty"`
}
-// KameletStatus defines the observed state of Kamelet
+// KameletStatus defines the observed state of Kamelet.
type KameletStatus struct {
// ObservedGeneration is the most recent generation observed for this Kamelet.
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
@@ -168,11 +168,11 @@ type KameletStatus struct {
Properties []KameletProperty `json:"properties,omitempty"`
}
-// KameletProperty specify the behavior of a property in a Kamelet
+// KameletProperty specify the behavior of a property in a Kamelet.
type KameletProperty struct {
- // the name of the property
+ // the name of the property.
Name string `json:"name,omitempty"`
- // the default value of the property (if any)
+ // the default value of the property (if any).
Default string `json:"default,omitempty"`
}
@@ -192,41 +192,41 @@ type KameletCondition struct {
Message string `json:"message,omitempty"`
}
-// KameletConditionType --
+// KameletConditionType --.
type KameletConditionType string
const (
- // KameletConditionReady --
+ // KameletConditionReady --.
KameletConditionReady KameletConditionType = "Ready"
)
const (
- // KameletConditionReasonInvalidName --
+ // KameletConditionReasonInvalidName --.
KameletConditionReasonInvalidName string = "InvalidName"
- // KameletConditionReasonInvalidProperty --
+ // KameletConditionReasonInvalidProperty --.
KameletConditionReasonInvalidProperty string = "InvalidProperty"
- // KameletConditionReasonInvalidTemplate --
+ // KameletConditionReasonInvalidTemplate --.
KameletConditionReasonInvalidTemplate string = "InvalidTemplate"
)
-// KameletPhase --
+// KameletPhase --.
type KameletPhase string
const (
- // KameletKind --
+ // KameletKind --.
KameletKind string = "Kamelet"
- // KameletPhaseNone --
+ // KameletPhaseNone --.
KameletPhaseNone KameletPhase = ""
- // KameletPhaseReady --
+ // KameletPhaseReady --.
KameletPhaseReady KameletPhase = "Ready"
- // KameletPhaseError --
+ // KameletPhaseError --.
KameletPhaseError KameletPhase = "Error"
)
// +kubebuilder:object:root=true
-// KameletList contains a list of Kamelet
+// KameletList contains a list of Kamelet.
type KameletList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
diff --git a/pkg/apis/camel/v1/kamelet_types_support.go b/pkg/apis/camel/v1/kamelet_types_support.go
index c918a84eb..8aef9119c 100644
--- a/pkg/apis/camel/v1/kamelet_types_support.go
+++ b/pkg/apis/camel/v1/kamelet_types_support.go
@@ -24,7 +24,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
-// GetConditions --
+// GetConditions --.
func (in *KameletStatus) GetConditions() []ResourceCondition {
res := make([]ResourceCondition, 0, len(in.Conditions))
for _, c := range in.Conditions {
@@ -33,32 +33,32 @@ func (in *KameletStatus) GetConditions() []ResourceCondition {
return res
}
-// GetType --
+// GetType --.
func (c KameletCondition) GetType() string {
return string(c.Type)
}
-// GetStatus --
+// GetStatus --.
func (c KameletCondition) GetStatus() corev1.ConditionStatus {
return c.Status
}
-// GetLastUpdateTime --
+// GetLastUpdateTime --.
func (c KameletCondition) GetLastUpdateTime() metav1.Time {
return c.LastUpdateTime
}
-// GetLastTransitionTime --
+// GetLastTransitionTime --.
func (c KameletCondition) GetLastTransitionTime() metav1.Time {
return c.LastTransitionTime
}
-// GetReason --
+// GetReason --.
func (c KameletCondition) GetReason() string {
return c.Reason
}
-// GetMessage --
+// GetMessage --.
func (c KameletCondition) GetMessage() string {
return c.Message
}
@@ -74,7 +74,7 @@ func (in *KameletStatus) GetCondition(condType KameletConditionType) *KameletCon
return nil
}
-// SetCondition --
+// SetCondition --.
func (in *KameletStatus) SetCondition(condType KameletConditionType, status corev1.ConditionStatus, reason string, message string) {
in.SetConditions(KameletCondition{
Type: condType,
@@ -86,7 +86,7 @@ func (in *KameletStatus) SetCondition(condType KameletConditionType, status core
})
}
-// SetErrorCondition --
+// SetErrorCondition --.
func (in *KameletStatus) SetErrorCondition(condType KameletConditionType, reason string, err error) {
in.SetConditions(KameletCondition{
Type: condType,
@@ -138,7 +138,7 @@ func (in *KameletStatus) RemoveCondition(condType KameletConditionType) {
in.Conditions = newConditions
}
-// SortedDefinitionPropertiesKeys returns the sorted keys of the Kamelet definition properties
+// SortedDefinitionPropertiesKeys returns the sorted keys of the Kamelet definition properties.
func (k *Kamelet) SortedDefinitionPropertiesKeys() []string {
if k.Spec.Definition == nil {
return []string{}
@@ -150,14 +150,14 @@ func (k *Kamelet) SortedDefinitionPropertiesKeys() []string {
res := make([]string, len(props))
i := 0
for key := range props {
- res[i] = string(key)
+ res[i] = key
i++
}
sort.Strings(res)
return res
}
-// SortedTypesKeys returns the sorted keys of the Kamelet spec types
+// SortedTypesKeys returns the sorted keys of the Kamelet spec types.
func (k *Kamelet) SortedTypesKeys() []TypeSlot {
types := k.Spec.DataTypes
if len(types) == 0 {
@@ -191,7 +191,7 @@ func ValidKameletProperties(kamelet *Kamelet) bool {
return true
}
-// NewKamelet creates a new kamelet
+// NewKamelet creates a new kamelet.
func NewKamelet(namespace string, name string) Kamelet {
return Kamelet{
TypeMeta: metav1.TypeMeta{
@@ -205,7 +205,7 @@ func NewKamelet(namespace string, name string) Kamelet {
}
}
-// NewKameletList creates a new list of kamelets
+// NewKameletList creates a new list of kamelets.
func NewKameletList() KameletList {
return KameletList{
TypeMeta: metav1.TypeMeta{
diff --git a/pkg/apis/camel/v1/knative/types.go b/pkg/apis/camel/v1/knative/types.go
index 5ed1ad214..c8625b8c4 100644
--- a/pkg/apis/camel/v1/knative/types.go
+++ b/pkg/apis/camel/v1/knative/types.go
@@ -19,19 +19,19 @@ package knative
import "fmt"
-// CamelEnvironment is the top level configuration object expected by the Camel Knative component
+// CamelEnvironment is the top level configuration object expected by the Camel Knative component.
type CamelEnvironment struct {
Services []CamelServiceDefinition `json:"services"`
}
-// NewCamelEnvironment creates a new env
+// NewCamelEnvironment creates a new env.
func NewCamelEnvironment() CamelEnvironment {
return CamelEnvironment{
Services: make([]CamelServiceDefinition, 0),
}
}
-// CamelServiceDefinition defines the parameters to connect to Knative service. It's also used for exposed services
+// CamelServiceDefinition defines the parameters to connect to Knative service. It's also used for exposed services.
type CamelServiceDefinition struct {
ServiceType CamelServiceType `json:"type"`
Name string `json:"name"`
@@ -40,25 +40,25 @@ type CamelServiceDefinition struct {
Metadata map[string]string `json:"metadata,omitempty"`
}
-// CamelEndpointKind --
+// CamelEndpointKind --.
type CamelEndpointKind string
const (
- // CamelEndpointKindSource is a service that can be used to consume events
+ // CamelEndpointKindSource is a service that can be used to consume events.
CamelEndpointKindSource CamelEndpointKind = "source"
- // CamelEndpointKindSink is a service that can be used to send events to
+ // CamelEndpointKindSink is a service that can be used to send events to.
CamelEndpointKindSink CamelEndpointKind = "sink"
)
-// CamelServiceType --
+// CamelServiceType --.
type CamelServiceType string
const (
- // CamelServiceTypeEndpoint is a callable endpoint
+ // CamelServiceTypeEndpoint is a callable endpoint.
CamelServiceTypeEndpoint CamelServiceType = "endpoint"
- // CamelServiceTypeChannel is a callable endpoint that will be also associated to a subscription
+ // CamelServiceTypeChannel is a callable endpoint that will be also associated to a subscription.
CamelServiceTypeChannel CamelServiceType = "channel"
- // CamelServiceTypeEvent is used when the target service is the Knative broker
+ // CamelServiceTypeEvent is used when the target service is the Knative broker.
CamelServiceTypeEvent CamelServiceType = "event"
)
@@ -70,7 +70,7 @@ func (s CamelServiceType) ResourceDescription(subject string) string {
return fmt.Sprintf("%s%s %s", prefix, string(s), subject)
}
-// Meta Options
+// Meta Options.
const (
CamelMetaKnativeKind = "knative.kind"
CamelMetaKnativeAPIVersion = "knative.apiVersion"
diff --git a/pkg/apis/camel/v1/knative/types_support.go b/pkg/apis/camel/v1/knative/types_support.go
index c14f38639..1becb3ef8 100644
--- a/pkg/apis/camel/v1/knative/types_support.go
+++ b/pkg/apis/camel/v1/knative/types_support.go
@@ -22,7 +22,7 @@ import (
"net/url"
)
-// BuildCamelServiceDefinition creates a CamelServiceDefinition from a given URL
+// BuildCamelServiceDefinition creates a CamelServiceDefinition from a given URL.
func BuildCamelServiceDefinition(name string, endpointKind CamelEndpointKind, serviceType CamelServiceType,
serviceURL url.URL, apiVersion, kind string) (CamelServiceDefinition, error) {
@@ -41,7 +41,7 @@ func BuildCamelServiceDefinition(name string, endpointKind CamelEndpointKind, se
return definition, nil
}
-// Serialize serializes a CamelEnvironment
+// Serialize serializes a CamelEnvironment.
func (env *CamelEnvironment) Serialize() (string, error) {
res, err := json.Marshal(env)
if err != nil {
@@ -50,7 +50,7 @@ func (env *CamelEnvironment) Serialize() (string, error) {
return string(res), nil
}
-// Deserialize deserializes a camel environment into this struct
+// Deserialize deserializes a camel environment into this struct.
func (env *CamelEnvironment) Deserialize(str string) error {
if err := json.Unmarshal([]byte(str), env); err != nil {
return err
@@ -58,12 +58,12 @@ func (env *CamelEnvironment) Deserialize(str string) error {
return nil
}
-// ContainsService tells if the environment contains a service with the given name and type
+// ContainsService tells if the environment contains a service with the given name and type.
func (env *CamelEnvironment) ContainsService(name string, endpointKind CamelEndpointKind, serviceType CamelServiceType, apiVersion, kind string) bool {
return env.FindService(name, endpointKind, serviceType, apiVersion, kind) != nil
}
-// FindService --
+// FindService --.
func (env *CamelEnvironment) FindService(name string, endpointKind CamelEndpointKind, serviceType CamelServiceType, apiVersion, kind string) *CamelServiceDefinition {
for _, svc := range env.Services {
svc := svc
diff --git a/pkg/apis/camel/v1/maven_types.go b/pkg/apis/camel/v1/maven_types.go
index 378d7cfc4..e3f95d280 100644
--- a/pkg/apis/camel/v1/maven_types.go
+++ b/pkg/apis/camel/v1/maven_types.go
@@ -23,7 +23,7 @@ import (
corev1 "k8s.io/api/core/v1"
)
-// MavenSpec --
+// MavenSpec --.
type MavenSpec struct {
// The path of the local Maven repository.
LocalRepository string `json:"localRepository,omitempty"`
@@ -51,7 +51,7 @@ type MavenSpec struct {
CLIOptions []string `json:"cliOptions,omitempty"`
}
-// Repository defines a Maven repository
+// Repository defines a Maven repository.
type Repository struct {
// identifies the repository
ID string `xml:"id" json:"id"`
@@ -65,7 +65,7 @@ type Repository struct {
Releases RepositoryPolicy `xml:"releases,omitempty" json:"releases,omitempty"`
}
-// RepositoryPolicy defines the policy associated to a Maven repository
+// RepositoryPolicy defines the policy associated to a Maven repository.
type RepositoryPolicy struct {
// is the policy activated or not
Enabled bool `xml:"enabled" json:"enabled"`
@@ -78,7 +78,7 @@ type RepositoryPolicy struct {
ChecksumPolicy string `xml:"checksumPolicy,omitempty" json:"checksumPolicy,omitempty"`
}
-// MavenArtifact defines a GAV (Group:Artifact:Version) Maven artifact
+// MavenArtifact defines a GAV (Group:Artifact:Version) Maven artifact.
type MavenArtifact struct {
// Maven Group
GroupID string `json:"groupId" yaml:"groupId" xml:"groupId"`
diff --git a/pkg/apis/camel/v1/pipe_types.go b/pkg/apis/camel/v1/pipe_types.go
index 03498586e..2f35a1c3d 100644
--- a/pkg/apis/camel/v1/pipe_types.go
+++ b/pkg/apis/camel/v1/pipe_types.go
@@ -32,7 +32,7 @@ import (
// +kubebuilder:printcolumn:name="Phase",type=string,JSONPath=`.status.phase`,description="The Pipe phase"
// +kubebuilder:printcolumn:name="Replicas",type=integer,JSONPath=`.status.replicas`,description="The number of pods"
-// Pipe is the Schema for the Pipe API
+// Pipe is the Schema for the Pipe API.
type Pipe struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
@@ -51,7 +51,7 @@ type PipeSpec struct {
Source Endpoint `json:"source,omitempty"`
// Sink is the destination of the integration defined by this Pipe
Sink Endpoint `json:"sink,omitempty"`
- // ErrorHandler is an optional handler called upon an error occuring in the integration
+ // ErrorHandler is an optional handler called upon an error occurring in the integration
ErrorHandler *ErrorHandlerSpec `json:"errorHandler,omitempty"`
// Steps contains an optional list of intermediate steps that are executed between the Source and the Sink
Steps []Endpoint `json:"steps,omitempty"`
@@ -61,7 +61,7 @@ type PipeSpec struct {
ServiceAccountName string `json:"serviceAccountName,omitempty"`
}
-// Endpoint represents a source/sink external entity (could be any Kubernetes resource or Camel URI)
+// Endpoint represents a source/sink external entity (could be any Kubernetes resource or Camel URI).
type Endpoint struct {
// Ref can be used to declare a Kubernetes resource as source/sink endpoint
Ref *corev1.ObjectReference `json:"ref,omitempty"`
@@ -73,36 +73,36 @@ type Endpoint struct {
DataTypes map[TypeSlot]DataTypeReference `json:"dataTypes,omitempty"`
}
-// EndpointType represents the type (ie, source or sink)
+// EndpointType represents the type (ie, source or sink).
type EndpointType string
const (
- // EndpointTypeSource source endpoint
+ // EndpointTypeSource source endpoint.
EndpointTypeSource EndpointType = "source"
- // EndpointTypeAction action endpoint
+ // EndpointTypeAction action endpoint.
EndpointTypeAction EndpointType = "action"
- // EndpointTypeSink sink endpoint
+ // EndpointTypeSink sink endpoint.
EndpointTypeSink EndpointType = "sink"
- // EndpointTypeErrorHandler error handler endpoint
+ // EndpointTypeErrorHandler error handler endpoint.
EndpointTypeErrorHandler EndpointType = "errorHandler"
)
-// EndpointProperties is a key/value struct represented as JSON raw to allow numeric/boolean values
+// EndpointProperties is a key/value struct represented as JSON raw to allow numeric/boolean values.
type EndpointProperties struct {
RawMessage `json:",inline"`
}
-// PipeStatus specify the status of a Pipe
+// PipeStatus specify the status of a Pipe.
type PipeStatus struct {
// ObservedGeneration is the most recent generation observed for this Pipe.
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
- // Phase --
+ // Phase --.
Phase PipePhase `json:"phase,omitempty"`
- // Conditions --
+ // Conditions --.
Conditions []PipeCondition `json:"conditions,omitempty"`
- // Replicas is the number of actual replicas of the pipe
+ // Replicas is the number of actual replicas of the pipe.
Replicas *int32 `json:"replicas,omitempty"`
- // Selector allows to identify pods belonging to the pipe
+ // Selector allows to identify pods belonging to the pipe.
Selector string `json:"selector,omitempty"`
}
@@ -124,36 +124,36 @@ type PipeCondition struct {
Pods []PodCondition `json:"pods,omitempty"`
}
-// PipeConditionType --
+// PipeConditionType --.
type PipeConditionType string
const (
- // PipeConditionReady --
+ // PipeConditionReady --.
PipeConditionReady PipeConditionType = "Ready"
- // PipeIntegrationConditionError is used to report the error on the generated Integration
+ // PipeIntegrationConditionError is used to report the error on the generated Integration.
PipeIntegrationConditionError PipeConditionType = "IntegrationError"
)
-// PipePhase --
+// PipePhase --.
type PipePhase string
const (
- // PipeKind --
+ // PipeKind --.
PipeKind string = "Pipe"
- // PipePhaseNone --
+ // PipePhaseNone --.
PipePhaseNone PipePhase = ""
- // PipePhaseCreating --
+ // PipePhaseCreating --.
PipePhaseCreating PipePhase = "Creating"
- // PipePhaseError --
+ // PipePhaseError --.
PipePhaseError PipePhase = "Error"
- // PipePhaseReady --
+ // PipePhaseReady --.
PipePhaseReady PipePhase = "Ready"
)
// +kubebuilder:object:root=true
-// PipeList contains a list of Pipe
+// PipeList contains a list of Pipe.
type PipeList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
diff --git a/pkg/apis/camel/v1/pipe_types_support.go b/pkg/apis/camel/v1/pipe_types_support.go
index cc1a46bdf..5e351a57a 100644
--- a/pkg/apis/camel/v1/pipe_types_support.go
+++ b/pkg/apis/camel/v1/pipe_types_support.go
@@ -26,7 +26,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
-// GetConditions --
+// GetConditions --.
func (in *PipeStatus) GetConditions() []ResourceCondition {
res := make([]ResourceCondition, 0, len(in.Conditions))
for _, c := range in.Conditions {
@@ -35,37 +35,37 @@ func (in *PipeStatus) GetConditions() []ResourceCondition {
return res
}
-// GetType --
+// GetType --.
func (c PipeCondition) GetType() string {
return string(c.Type)
}
-// GetStatus --
+// GetStatus --.
func (c PipeCondition) GetStatus() corev1.ConditionStatus {
return c.Status
}
-// GetLastUpdateTime --
+// GetLastUpdateTime --.
func (c PipeCondition) GetLastUpdateTime() metav1.Time {
return c.LastUpdateTime
}
-// GetLastTransitionTime --
+// GetLastTransitionTime --.
func (c PipeCondition) GetLastTransitionTime() metav1.Time {
return c.LastTransitionTime
}
-// GetReason --
+// GetReason --.
func (c PipeCondition) GetReason() string {
return c.Reason
}
-// GetMessage --
+// GetMessage --.
func (c PipeCondition) GetMessage() string {
return c.Message
}
-// SetOperatorID sets the given operator id as an annotation
+// SetOperatorID sets the given operator id as an annotation.
func (in *Pipe) SetOperatorID(operatorID string) {
SetAnnotation(&in.ObjectMeta, OperatorIDAnnotation, operatorID)
}
@@ -81,7 +81,7 @@ func (in *PipeStatus) GetCondition(condType PipeConditionType) *PipeCondition {
return nil
}
-// SetCondition --
+// SetCondition --.
func (in *PipeStatus) SetCondition(condType PipeConditionType, status corev1.ConditionStatus, reason string, message string) {
in.SetConditions(PipeCondition{
Type: condType,
@@ -93,7 +93,7 @@ func (in *PipeStatus) SetCondition(condType PipeConditionType, status corev1.Con
})
}
-// SetErrorCondition --
+// SetErrorCondition --.
func (in *PipeStatus) SetErrorCondition(condType PipeConditionType, reason string, err error) {
in.SetConditions(PipeCondition{
Type: condType,
@@ -145,7 +145,7 @@ func (in *PipeStatus) RemoveCondition(condType PipeConditionType) {
in.Conditions = newConditions
}
-// GetPropertyMap returns the EndpointProperties as map
+// GetPropertyMap returns the EndpointProperties as map.
func (p *EndpointProperties) GetPropertyMap() (map[string]string, error) {
if p == nil {
return nil, nil
@@ -154,7 +154,7 @@ func (p *EndpointProperties) GetPropertyMap() (map[string]string, error) {
return nil, nil
}
- // Convert json property values to objects before getting their string representation
+ // Convert json property values to objects before getting their string representation.
var props map[string]interface{}
d := json.NewDecoder(bytes.NewReader(p.RawMessage))
d.UseNumber()
@@ -168,7 +168,7 @@ func (p *EndpointProperties) GetPropertyMap() (map[string]string, error) {
return stringProps, nil
}
-// NewPipe --
+// NewPipe --.
func NewPipe(namespace string, name string) Pipe {
return Pipe{
TypeMeta: metav1.TypeMeta{
@@ -182,7 +182,7 @@ func NewPipe(namespace string, name string) Pipe {
}
}
-// NewPipeList --
+// NewPipeList --.
func NewPipeList() PipeList {
return PipeList{
TypeMeta: metav1.TypeMeta{
diff --git a/pkg/apis/camel/v1/register.go b/pkg/apis/camel/v1/register.go
index 9c45f9fb3..42a041096 100644
--- a/pkg/apis/camel/v1/register.go
+++ b/pkg/apis/camel/v1/register.go
@@ -29,17 +29,17 @@ import (
)
var (
- // SchemeGroupVersion is group version used to register these objects
+ // SchemeGroupVersion is group version used to register these objects.
SchemeGroupVersion = schema.GroupVersion{Group: "camel.apache.org", Version: "v1"}
- // SchemeBuilder is used to add go types to the GroupVersionKind scheme
+ // SchemeBuilder is used to add go types to the GroupVersionKind scheme.
SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
- // AddToScheme is a shortcut to SchemeBuilder.AddToScheme
+ // AddToScheme is a shortcut to SchemeBuilder.AddToScheme.
AddToScheme = SchemeBuilder.AddToScheme
)
-// Resource takes an unqualified resource and returns a Group qualified GroupResource
+// Resource takes an unqualified resource and returns a Group qualified GroupResource.
func Resource(resource string) schema.GroupResource {
return SchemeGroupVersion.WithResource(resource).GroupResource()
}
diff --git a/pkg/apis/camel/v1alpha1/error_handler_types.go b/pkg/apis/camel/v1alpha1/error_handler_types.go
index 1d83d2081..b0cd4d587 100644
--- a/pkg/apis/camel/v1alpha1/error_handler_types.go
+++ b/pkg/apis/camel/v1alpha1/error_handler_types.go
@@ -20,37 +20,37 @@ limitations under the License.
package v1alpha1
const (
- // ErrorHandlerRefName the reference name to use when looking for an error handler
+ // ErrorHandlerRefName the reference name to use when looking for an error handlerl.
ErrorHandlerRefName = "camel.k.errorHandler.ref"
- // ErrorHandlerRefDefaultName the default name of the error handler
+ // ErrorHandlerRefDefaultName the default name of the error handler.
ErrorHandlerRefDefaultName = "defaultErrorHandler"
- // ErrorHandlerAppPropertiesPrefix the prefix used for the error handler bean
+ // ErrorHandlerAppPropertiesPrefix the prefix used for the error handler bean.
ErrorHandlerAppPropertiesPrefix = "camel.beans.defaultErrorHandler"
)
-// ErrorHandlerSpec represents an unstructured object for an error handler
+// ErrorHandlerSpec represents an unstructured object for an error handler.
type ErrorHandlerSpec struct {
RawMessage `json:",inline,omitempty"`
}
-// ErrorHandlerParameters represent an unstructured object for error handler parameters
+// ErrorHandlerParameters represent an unstructured object for error handler parameters.
type ErrorHandlerParameters struct {
RawMessage `json:",inline,omitempty"`
}
-// BeanProperties represent an unstructured object properties to be set on a bean
+// BeanProperties represent an unstructured object properties to be set on a bean.
type BeanProperties struct {
RawMessage `json:",inline,omitempty"`
}
-// ErrorHandlerType a type of error handler (ie, sink)
+// ErrorHandlerType a type of error handler (ie, sink).
type ErrorHandlerType string
const (
errorHandlerTypeBase ErrorHandlerType = ""
- // ErrorHandlerTypeNone used to ignore any error event
+ // ErrorHandlerTypeNone used to ignore any error event.
ErrorHandlerTypeNone ErrorHandlerType = "none"
- // ErrorHandlerTypeLog used to log the event producing the error
+ // ErrorHandlerTypeLog used to log the event producing the error.
ErrorHandlerTypeLog ErrorHandlerType = "log"
// ErrorHandlerTypeSink used to send the event to a further sink (for future processing). This was previously known as dead-letter-channel.
ErrorHandlerTypeSink ErrorHandlerType = "sink"
diff --git a/pkg/apis/camel/v1alpha1/error_handler_types_support.go b/pkg/apis/camel/v1alpha1/error_handler_types_support.go
index 09cf74826..2489cf53c 100644
--- a/pkg/apis/camel/v1alpha1/error_handler_types_support.go
+++ b/pkg/apis/camel/v1alpha1/error_handler_types_support.go
@@ -26,7 +26,7 @@ import (
// +kubebuilder:object:generate=false
-// ErrorHandler is a generic interface that represent any type of error handler specification
+// ErrorHandler is a generic interface that represent any type of error handler specification.
type ErrorHandler interface {
Type() ErrorHandlerType
Endpoint() *Endpoint
@@ -34,41 +34,41 @@ type ErrorHandler interface {
Validate() error
}
-// baseErrorHandler is the base used for the Error Handler hierarchy
+// baseErrorHandler is the base used for the Error Handler hierarchy.
type baseErrorHandler struct {
}
-// Type --
+// Type --.
func (e baseErrorHandler) Type() ErrorHandlerType {
return errorHandlerTypeBase
}
-// Endpoint --
+// Endpoint --.
func (e baseErrorHandler) Endpoint() *Endpoint {
return nil
}
-// Configuration --
+// Configuration --.
func (e baseErrorHandler) Configuration() (map[string]interface{}, error) {
return nil, nil
}
-// Validate --
+// Validate --.
func (e baseErrorHandler) Validate() error {
return nil
}
-// ErrorHandlerNone --
+// ErrorHandlerNone --.
type ErrorHandlerNone struct {
baseErrorHandler
}
-// Type --
+// Type --.
func (e ErrorHandlerNone) Type() ErrorHandlerType {
return ErrorHandlerTypeNone
}
-// Configuration --
+// Configuration --.
func (e ErrorHandlerNone) Configuration() (map[string]interface{}, error) {
return map[string]interface{}{
ErrorHandlerAppPropertiesPrefix: "#class:org.apache.camel.builder.NoErrorHandlerBuilder",
@@ -76,18 +76,18 @@ func (e ErrorHandlerNone) Configuration() (map[string]interface{}, error) {
}, nil
}
-// ErrorHandlerLog represent a default (log) error handler type
+// ErrorHandlerLog represent a default (log) error handler type.
type ErrorHandlerLog struct {
ErrorHandlerNone
Parameters *ErrorHandlerParameters `json:"parameters,omitempty"`
}
-// Type --
+// Type --.
func (e ErrorHandlerLog) Type() ErrorHandlerType {
return ErrorHandlerTypeLog
}
-// Configuration --
+// Configuration --.
func (e ErrorHandlerLog) Configuration() (map[string]interface{}, error) {
properties, err := e.ErrorHandlerNone.Configuration()
if err != nil {
@@ -109,23 +109,23 @@ func (e ErrorHandlerLog) Configuration() (map[string]interface{}, error) {
return properties, nil
}
-// ErrorHandlerSink represents a sink error handler type which behave like a dead letter channel
+// ErrorHandlerSink represents a sink error handler type which behave like a dead letter channel.
type ErrorHandlerSink struct {
ErrorHandlerLog
DLCEndpoint *Endpoint `json:"endpoint,omitempty"`
}
-// Type --
+// Type --.
func (e ErrorHandlerSink) Type() ErrorHandlerType {
return ErrorHandlerTypeSink
}
-// Endpoint --
+// Endpoint --.
func (e ErrorHandlerSink) Endpoint() *Endpoint {
return e.DLCEndpoint
}
-// Configuration --
+// Configuration --.
func (e ErrorHandlerSink) Configuration() (map[string]interface{}, error) {
properties, err := e.ErrorHandlerLog.Configuration()
if err != nil {
@@ -136,10 +136,10 @@ func (e ErrorHandlerSink) Configuration() (map[string]interface{}, error) {
return properties, err
}
-// Validate --
+// Validate --.
func (e ErrorHandlerSink) Validate() error {
if e.DLCEndpoint == nil {
- return fmt.Errorf("Missing endpoint in Error Handler Sink")
+ return fmt.Errorf("missing endpoint in Error Handler Sink")
}
return nil
}
diff --git a/pkg/apis/camel/v1alpha1/jsonschema_types.go b/pkg/apis/camel/v1alpha1/jsonschema_types.go
index c36a05bc5..0f86ba0ca 100644
--- a/pkg/apis/camel/v1alpha1/jsonschema_types.go
+++ b/pkg/apis/camel/v1alpha1/jsonschema_types.go
@@ -126,7 +126,7 @@ func (m *RawMessage) UnmarshalJSON(data []byte) error {
return nil
}
-// String returns a string representation of RawMessage
+// String returns a string representation of RawMessage.
func (m *RawMessage) String() string {
if m == nil {
return ""
diff --git a/pkg/apis/camel/v1alpha1/kamelet_binding_types.go b/pkg/apis/camel/v1alpha1/kamelet_binding_types.go
index c4ba4c53e..3338ca9d0 100644
--- a/pkg/apis/camel/v1alpha1/kamelet_binding_types.go
+++ b/pkg/apis/camel/v1alpha1/kamelet_binding_types.go
@@ -37,7 +37,7 @@ import (
// +kubebuilder:printcolumn:name="Phase",type=string,JSONPath=`.status.phase`,description="The Kamelet Binding phase"
// +kubebuilder:printcolumn:name="Replicas",type=integer,JSONPath=`.status.replicas`,description="The number of pods"
-// KameletBinding is the Schema for the kamelets binding API
+// KameletBinding is the Schema for the kamelets binding API.
type KameletBinding struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
@@ -56,7 +56,7 @@ type KameletBindingSpec struct {
Source Endpoint `json:"source,omitempty"`
// Sink is the destination of the integration defined by this binding
Sink Endpoint `json:"sink,omitempty"`
- // ErrorHandler is an optional handler called upon an error occuring in the integration
+ // ErrorHandler is an optional handler called upon an error occurring in the integration.
ErrorHandler *ErrorHandlerSpec `json:"errorHandler,omitempty"`
// Steps contains an optional list of intermediate steps that are executed between the Source and the Sink
Steps []Endpoint `json:"steps,omitempty"`
@@ -66,13 +66,13 @@ type KameletBindingSpec struct {
ServiceAccountName string `json:"serviceAccountName,omitempty"`
}
-// Endpoint represents a source/sink external entity (could be any Kubernetes resource or Camel URI)
+// Endpoint represents a source/sink external entity (could be any Kubernetes resource or Camel URI).
type Endpoint struct {
- // Ref can be used to declare a Kubernetes resource as source/sink endpoint
+ // Ref can be used to declare a Kubernetes resource as source/sink endpoint.
Ref *corev1.ObjectReference `json:"ref,omitempty"`
- // URI can be used to specify the (Camel) endpoint explicitly
+ // URI can be used to specify the (Camel) endpoint explicitly.
URI *string `json:"uri,omitempty"`
- // Properties are a key value representation of endpoint properties
+ // Properties are a key value representation of endpoint properties.
Properties *EndpointProperties `json:"properties,omitempty"`
// Types defines the data type of the data produced/consumed by the endpoint and references a given data type specification.
// Deprecated: In favor of using DataTypes
@@ -81,36 +81,36 @@ type Endpoint struct {
DataTypes map[TypeSlot]DataTypeReference `json:"dataTypes,omitempty"`
}
-// EndpointType represents the type (ie, source or sink)
+// EndpointType represents the type (ie, source or sink).
type EndpointType string
const (
- // EndpointTypeSource source endpoint
+ // EndpointTypeSource source endpoint.
EndpointTypeSource EndpointType = "source"
- // EndpointTypeAction action endpoint
+ // EndpointTypeAction action endpoint.
EndpointTypeAction EndpointType = "action"
- // EndpointTypeSink sink endpoint
+ // EndpointTypeSink sink endpoint.
EndpointTypeSink EndpointType = "sink"
- // EndpointTypeErrorHandler error handler endpoint
+ // EndpointTypeErrorHandler error handler endpoint.
EndpointTypeErrorHandler EndpointType = "errorHandler"
)
-// EndpointProperties is a key/value struct represented as JSON raw to allow numeric/boolean values
+// EndpointProperties is a key/value struct represented as JSON raw to allow numeric/boolean values.
type EndpointProperties struct {
RawMessage `json:",inline"`
}
-// KameletBindingStatus specify the status of a binding
+// KameletBindingStatus specify the status of a binding.
type KameletBindingStatus struct {
// ObservedGeneration is the most recent generation observed for this KameletBinding.
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
- // Phase --
+ // Phase --.
Phase KameletBindingPhase `json:"phase,omitempty"`
- // Conditions --
+ // Conditions --.
Conditions []KameletBindingCondition `json:"conditions,omitempty"`
- // Replicas is the number of actual replicas of the binding
+ // Replicas is the number of actual replicas of the binding.
Replicas *int32 `json:"replicas,omitempty"`
- // Selector allows to identify pods belonging to the binding
+ // Selector allows to identify pods belonging to the binding.
Selector string `json:"selector,omitempty"`
}
@@ -128,40 +128,40 @@ type KameletBindingCondition struct {
Reason string `json:"reason,omitempty"`
// A human readable message indicating details about the transition.
Message string `json:"message,omitempty"`
- // Pods collect health and conditions information from the owned PODs
+ // Pods collect health and conditions information from the owned PODs.
Pods []v1.PodCondition `json:"pods,omitempty"`
}
-// KameletBindingConditionType --
+// KameletBindingConditionType --.
type KameletBindingConditionType string
const (
- // KameletBindingConditionReady --
+ // KameletBindingConditionReady --.
KameletBindingConditionReady KameletBindingConditionType = "Ready"
- // KameletBindingIntegrationConditionError is used to report the error on the generated Integration
+ // KameletBindingIntegrationConditionError is used to report the error on the generated Integration.
KameletBindingIntegrationConditionError KameletBindingConditionType = "IntegrationError"
)
-// KameletBindingPhase --
+// KameletBindingPhase --.
type KameletBindingPhase string
const (
- // KameletBindingKind --
+ // KameletBindingKind --.
KameletBindingKind string = "KameletBinding"
- // KameletBindingPhaseNone --
+ // KameletBindingPhaseNone --.
KameletBindingPhaseNone KameletBindingPhase = ""
- // KameletBindingPhaseCreating --
+ // KameletBindingPhaseCreating --.
KameletBindingPhaseCreating KameletBindingPhase = "Creating"
- // KameletBindingPhaseError --
+ // KameletBindingPhaseError --.
KameletBindingPhaseError KameletBindingPhase = "Error"
- // KameletBindingPhaseReady --
+ // KameletBindingPhaseReady --.
KameletBindingPhaseReady KameletBindingPhase = "Ready"
)
// +kubebuilder:object:root=true
-// KameletBindingList contains a list of KameletBinding
+// KameletBindingList contains a list of KameletBinding.
type KameletBindingList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
diff --git a/pkg/apis/camel/v1alpha1/kamelet_binding_types_support.go b/pkg/apis/camel/v1alpha1/kamelet_binding_types_support.go
index bfe3da8b3..a726b6124 100644
--- a/pkg/apis/camel/v1alpha1/kamelet_binding_types_support.go
+++ b/pkg/apis/camel/v1alpha1/kamelet_binding_types_support.go
@@ -29,7 +29,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
-// GetConditions --
+// GetConditions --.
func (in *KameletBindingStatus) GetConditions() []v1.ResourceCondition {
res := make([]v1.ResourceCondition, 0, len(in.Conditions))
for _, c := range in.Conditions {
@@ -38,37 +38,37 @@ func (in *KameletBindingStatus) GetConditions() []v1.ResourceCondition {
return res
}
-// GetType --
+// GetType --.
func (c KameletBindingCondition) GetType() string {
return string(c.Type)
}
-// GetStatus --
+// GetStatus --.
func (c KameletBindingCondition) GetStatus() corev1.ConditionStatus {
return c.Status
}
-// GetLastUpdateTime --
+// GetLastUpdateTime --.
func (c KameletBindingCondition) GetLastUpdateTime() metav1.Time {
return c.LastUpdateTime
}
-// GetLastTransitionTime --
+// GetLastTransitionTime --.
func (c KameletBindingCondition) GetLastTransitionTime() metav1.Time {
return c.LastTransitionTime
}
-// GetReason --
+// GetReason --.
func (c KameletBindingCondition) GetReason() string {
return c.Reason
}
-// GetMessage --
+// GetMessage --.
func (c KameletBindingCondition) GetMessage() string {
return c.Message
}
-// SetOperatorID sets the given operator id as an annotation
+// SetOperatorID sets the given operator id as an annotation.
func (in *KameletBinding) SetOperatorID(operatorID string) {
v1.SetAnnotation(&in.ObjectMeta, v1.OperatorIDAnnotation, operatorID)
}
@@ -84,7 +84,7 @@ func (in *KameletBindingStatus) GetCondition(condType KameletBindingConditionTyp
return nil
}
-// SetCondition --
+// SetCondition --.
func (in *KameletBindingStatus) SetCondition(condType KameletBindingConditionType, status corev1.ConditionStatus, reason string, message string) {
in.SetConditions(KameletBindingCondition{
Type: condType,
@@ -96,7 +96,7 @@ func (in *KameletBindingStatus) SetCondition(condType KameletBindingConditionTyp
})
}
-// SetErrorCondition --
+// SetErrorCondition --.
func (in *KameletBindingStatus) SetErrorCondition(condType KameletBindingConditionType, reason string, err error) {
in.SetConditions(KameletBindingCondition{
Type: condType,
@@ -148,7 +148,7 @@ func (in *KameletBindingStatus) RemoveCondition(condType KameletBindingCondition
in.Conditions = newConditions
}
-// GetPropertyMap returns the EndpointProperties as map
+// GetPropertyMap returns the EndpointProperties as map.
func (p *EndpointProperties) GetPropertyMap() (map[string]string, error) {
if p == nil {
return nil, nil
@@ -171,7 +171,7 @@ func (p *EndpointProperties) GetPropertyMap() (map[string]string, error) {
return stringProps, nil
}
-// NewKameletBinding --
+// NewKameletBinding --.
func NewKameletBinding(namespace string, name string) KameletBinding {
return KameletBinding{
TypeMeta: metav1.TypeMeta{
@@ -185,7 +185,7 @@ func NewKameletBinding(namespace string, name string) KameletBinding {
}
}
-// NewKameletBindingList --
+// NewKameletBindingList --.
func NewKameletBindingList() KameletBindingList {
return KameletBindingList{
TypeMeta: metav1.TypeMeta{
diff --git a/pkg/apis/camel/v1alpha1/kamelet_types.go b/pkg/apis/camel/v1alpha1/kamelet_types.go
index c8b8ff673..d21bff150 100644
--- a/pkg/apis/camel/v1alpha1/kamelet_types.go
+++ b/pkg/apis/camel/v1alpha1/kamelet_types.go
@@ -27,29 +27,29 @@ import (
)
const (
- // AnnotationIcon label used by icons
+ // AnnotationIcon label used by icons.
AnnotationIcon = "camel.apache.org/kamelet.icon"
- // KameletBundledLabel label used by bundling
+ // KameletBundledLabel label used by bundling.
KameletBundledLabel = "camel.apache.org/kamelet.bundled"
- // KameletReadOnlyLabel label used to identify readonly Kamelets
+ // KameletReadOnlyLabel label used to identify readonly Kamelets.
KameletReadOnlyLabel = "camel.apache.org/kamelet.readonly"
- // KameletTypeLabel label used to identify Kamelet type
+ // KameletTypeLabel label used to identify Kamelet type.
KameletTypeLabel = "camel.apache.org/kamelet.type"
- // KameletGroupLabel label used to group Kamelets
+ // KameletGroupLabel label used to group Kamelets.
KameletGroupLabel = "camel.apache.org/kamelet.group"
- // KameletTypeSink type Sink
+ // KameletTypeSink type Sink.
KameletTypeSink = "sink"
- // KameletTypeSource type Source
+ // KameletTypeSource type Source.
KameletTypeSource = "source"
- // KameletTypeAction type Action
+ // KameletTypeAction type Action.
KameletTypeAction = "action"
)
var (
- // reservedKameletNames used to mark reserved names
+ // reservedKameletNames used to mark reserved names.
reservedKameletNames = map[string]bool{"source": true, "sink": true}
- // KameletIDProperty used to identify
+ // KameletIDProperty used to identify.
KameletIDProperty = "id"
)
@@ -60,18 +60,18 @@ var (
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="Phase",type=string,JSONPath=`.status.phase`,description="The Kamelet phase"
-// Kamelet is the Schema for the kamelets API
+// Kamelet is the Schema for the kamelets API.
type Kamelet struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
- // the desired specification
+ // the desired specification.
Spec KameletSpec `json:"spec,omitempty"`
- // the actual status of the resource
+ // the actual status of the resource.
Status KameletStatus `json:"status,omitempty"`
}
-// KameletSpec specifies the configuration required to execute a Kamelet
+// KameletSpec specifies the configuration required to execute a Kamelet.
type KameletSpec struct {
// defines the formal configuration of the Kamelet
Definition *JSONSchemaProps `json:"definition,omitempty"`
@@ -88,9 +88,9 @@ type KameletSpec struct {
Dependencies []string `json:"dependencies,omitempty"`
}
-// Template is an unstructured object representing a Kamelet template in YAML/JSON DSL
+// Template is an unstructured object representing a Kamelet template in YAML/JSON DSL.
type Template struct {
- // an unstructured raw message
+ // an unstructured raw message.
RawMessage `json:",inline"`
}
@@ -98,60 +98,60 @@ type Template struct {
type TypeSlot string
const (
- // TypeSlotIn is used for the input events
+ // TypeSlotIn is used for the input events.
TypeSlotIn TypeSlot = "in"
- // TypeSlotOut is used for the output events
+ // TypeSlotOut is used for the output events.
TypeSlotOut TypeSlot = "out"
- // TypeSlotError is used for the error events
+ // TypeSlotError is used for the error events.
TypeSlotError TypeSlot = "error"
)
// EventTypeSpec represents a specification for an event type
-// Deprecated: In favor of using DataTypeSpec
+// Deprecated: In favor of using DataTypeSpec.
type EventTypeSpec struct {
- // media type as expected for HTTP media types (ie, application/json)
+ // media type as expected for HTTP media types (ie, application/json).
MediaType string `json:"mediaType,omitempty"`
- // the expected schema for the event
+ // the expected schema for the event.
Schema *JSONSchemaProps `json:"schema,omitempty"`
}
-// DataTypesSpec represents the specification for a set of data types
+// DataTypesSpec represents the specification for a set of data types.
type DataTypesSpec struct {
- // the default data type for this Kamelet
+ // the default data type for this Kamelet.
Default string `json:"default,omitempty"`
- // one to many data type specifications
+ // one to many data type specifications.
Types map[string]DataTypeSpec `json:"types,omitempty"`
- // one to many header specifications
+ // one to many header specifications.
Headers map[string]HeaderSpec `json:"headers,omitempty"`
}
-// DataTypeSpec represents the specification for a data type
+// DataTypeSpec represents the specification for a data type.
type DataTypeSpec struct {
- // the data type component scheme
+ // the data type component scheme.
Scheme string `json:"scheme,omitempty"`
- // the data type format name
+ // the data type format name.
Format string `json:"format,omitempty"`
- // optional description
+ // optional description.
Description string `json:"description,omitempty"`
- // media type as expected for HTTP media types (ie, application/json)
+ // media type as expected for HTTP media types (ie, application/json).
MediaType string `json:"mediaType,omitempty"`
- // the list of Camel or Maven dependencies required by the data type
+ // the list of Camel or Maven dependencies required by the data type.
Dependencies []string `json:"dependencies,omitempty"`
- // one to many header specifications
+ // one to many header specifications.
Headers map[string]HeaderSpec `json:"headers,omitempty"`
- // the expected schema for the data type
+ // the expected schema for the data type.
Schema *JSONSchemaProps `json:"schema,omitempty"`
}
-// DataTypeReference references to the specification of a data type by its scheme and format name
+// DataTypeReference references to the specification of a data type by its scheme and format name.
type DataTypeReference struct {
- // the data type component scheme
+ // the data type component scheme.
Scheme string `json:"scheme,omitempty"`
- // the data type format name
+ // the data type format name.
Format string `json:"format,omitempty"`
}
-// HeaderSpec represents the specification for a header used in the Kamelet
+// HeaderSpec represents the specification for a header used in the Kamelet.
type HeaderSpec struct {
Type string `json:"type,omitempty"`
Title string `json:"title,omitempty"`
@@ -160,23 +160,23 @@ type HeaderSpec struct {
Default string `json:"default,omitempty"`
}
-// KameletStatus defines the observed state of Kamelet
+// KameletStatus defines the observed state of Kamelet.
type KameletStatus struct {
// ObservedGeneration is the most recent generation observed for this Kamelet.
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
- // Phase --
+ // Phase --.
Phase KameletPhase `json:"phase,omitempty"`
- // Conditions --
+ // Conditions --.
Conditions []KameletCondition `json:"conditions,omitempty"`
- // Properties --
+ // Properties --.
Properties []KameletProperty `json:"properties,omitempty"`
}
-// KameletProperty specify the behavior of a property in a Kamelet
+// KameletProperty specify the behavior of a property in a Kamelet.
type KameletProperty struct {
- // the name of the property
+ // the name of the property.
Name string `json:"name,omitempty"`
- // the default value of the property (if any)
+ // the default value of the property (if any).
Default string `json:"default,omitempty"`
}
@@ -196,41 +196,41 @@ type KameletCondition struct {
Message string `json:"message,omitempty"`
}
-// KameletConditionType --
+// KameletConditionType --.
type KameletConditionType string
const (
- // KameletConditionReady --
+ // KameletConditionReady --.
KameletConditionReady KameletConditionType = "Ready"
)
const (
- // KameletConditionReasonInvalidName --
+ // KameletConditionReasonInvalidName --.
KameletConditionReasonInvalidName string = "InvalidName"
- // KameletConditionReasonInvalidProperty --
+ // KameletConditionReasonInvalidProperty --.
KameletConditionReasonInvalidProperty string = "InvalidProperty"
- // KameletConditionReasonInvalidTemplate --
+ // KameletConditionReasonInvalidTemplate --.
KameletConditionReasonInvalidTemplate string = "InvalidTemplate"
)
-// KameletPhase --
+// KameletPhase --.
type KameletPhase string
const (
- // KameletKind --
+ // KameletKind --.
KameletKind string = "Kamelet"
- // KameletPhaseNone --
+ // KameletPhaseNone --.
KameletPhaseNone KameletPhase = ""
- // KameletPhaseReady --
+ // KameletPhaseReady --.
KameletPhaseReady KameletPhase = "Ready"
- // KameletPhaseError --
+ // KameletPhaseError --.
KameletPhaseError KameletPhase = "Error"
)
// +kubebuilder:object:root=true
-// KameletList contains a list of Kamelet
+// KameletList contains a list of Kamelet.
type KameletList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
diff --git a/pkg/apis/camel/v1alpha1/kamelet_types_support.go b/pkg/apis/camel/v1alpha1/kamelet_types_support.go
index 746d486f7..e3a855972 100644
--- a/pkg/apis/camel/v1alpha1/kamelet_types_support.go
+++ b/pkg/apis/camel/v1alpha1/kamelet_types_support.go
@@ -27,7 +27,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
-// GetConditions --
+// GetConditions --.
func (in *KameletStatus) GetConditions() []v1.ResourceCondition {
res := make([]v1.ResourceCondition, 0, len(in.Conditions))
for _, c := range in.Conditions {
@@ -36,32 +36,32 @@ func (in *KameletStatus) GetConditions() []v1.ResourceCondition {
return res
}
-// GetType --
+// GetType --.
func (c KameletCondition) GetType() string {
return string(c.Type)
}
-// GetStatus --
+// GetStatus --.
func (c KameletCondition) GetStatus() corev1.ConditionStatus {
return c.Status
}
-// GetLastUpdateTime --
+// GetLastUpdateTime --.
func (c KameletCondition) GetLastUpdateTime() metav1.Time {
return c.LastUpdateTime
}
-// GetLastTransitionTime --
+// GetLastTransitionTime --.
func (c KameletCondition) GetLastTransitionTime() metav1.Time {
return c.LastTransitionTime
}
-// GetReason --
+// GetReason --.
func (c KameletCondition) GetReason() string {
return c.Reason
}
-// GetMessage --
+// GetMessage --.
func (c KameletCondition) GetMessage() string {
return c.Message
}
@@ -77,7 +77,7 @@ func (in *KameletStatus) GetCondition(condType KameletConditionType) *KameletCon
return nil
}
-// SetCondition --
+// SetCondition --.
func (in *KameletStatus) SetCondition(condType KameletConditionType, status corev1.ConditionStatus, reason string, message string) {
in.SetConditions(KameletCondition{
Type: condType,
@@ -89,7 +89,7 @@ func (in *KameletStatus) SetCondition(condType KameletConditionType, status core
})
}
-// SetErrorCondition --
+// SetErrorCondition --.
func (in *KameletStatus) SetErrorCondition(condType KameletConditionType, reason string, err error) {
in.SetConditions(KameletCondition{
Type: condType,
@@ -141,7 +141,7 @@ func (in *KameletStatus) RemoveCondition(condType KameletConditionType) {
in.Conditions = newConditions
}
-// SortedDefinitionPropertiesKeys returns the sorted keys of the Kamelet definition properties
+// SortedDefinitionPropertiesKeys returns the sorted keys of the Kamelet definition properties.
func (k *Kamelet) SortedDefinitionPropertiesKeys() []string {
if k.Spec.Definition == nil {
return []string{}
@@ -153,14 +153,14 @@ func (k *Kamelet) SortedDefinitionPropertiesKeys() []string {
res := make([]string, len(props))
i := 0
for key := range props {
- res[i] = string(key)
+ res[i] = key
i++
}
sort.Strings(res)
return res
}
-// SortedTypesKeys returns the sorted keys of the Kamelet spec types
+// SortedTypesKeys returns the sorted keys of the Kamelet spec types.
func (k *Kamelet) SortedTypesKeys() []TypeSlot {
types := k.Spec.DataTypes
if len(types) == 0 {
@@ -194,7 +194,7 @@ func ValidKameletProperties(kamelet *Kamelet) bool {
return true
}
-// NewKamelet creates a new kamelet
+// NewKamelet creates a new kamelet.
func NewKamelet(namespace string, name string) Kamelet {
return Kamelet{
TypeMeta: metav1.TypeMeta{
@@ -208,7 +208,7 @@ func NewKamelet(namespace string, name string) Kamelet {
}
}
-// NewKameletList creates a new list of kamelets
+// NewKameletList creates a new list of kamelets.
func NewKameletList() KameletList {
return KameletList{
TypeMeta: metav1.TypeMeta{
diff --git a/pkg/apis/camel/v1alpha1/register.go b/pkg/apis/camel/v1alpha1/register.go
index e90d44ad3..b97cbf194 100644
--- a/pkg/apis/camel/v1alpha1/register.go
+++ b/pkg/apis/camel/v1alpha1/register.go
@@ -29,17 +29,17 @@ import (
)
var (
- // SchemeGroupVersion is group version used to register these objects
+ // SchemeGroupVersion is group version used to register these objects.
SchemeGroupVersion = schema.GroupVersion{Group: "camel.apache.org", Version: "v1alpha1"}
- // SchemeBuilder is used to add go types to the GroupVersionKind scheme
+ // SchemeBuilder is used to add go types to the GroupVersionKind scheme.
SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
- // AddToScheme is a shortcut to SchemeBuilder.AddToScheme
+ // AddToScheme is a shortcut to SchemeBuilder.AddToScheme.
AddToScheme = SchemeBuilder.AddToScheme
)
-// Resource takes an unqualified resource and returns a Group qualified GroupResource
+// Resource takes an unqualified resource and returns a Group qualified GroupResource.
func Resource(resource string) schema.GroupResource {
return SchemeGroupVersion.WithResource(resource).GroupResource()
}
diff --git a/pkg/controller/pipe/error_handler_test.go b/pkg/controller/pipe/error_handler_test.go
index c99c24b07..53877e638 100644
--- a/pkg/controller/pipe/error_handler_test.go
+++ b/pkg/controller/pipe/error_handler_test.go
@@ -105,5 +105,5 @@ func TestParseErrorHandlerSinkFail(t *testing.T) {
[]byte(`{"sink": {"ref": {"uri": "someUri"}}}`),
)
assert.NotNil(t, err)
- assert.Equal(t, "Missing endpoint in Error Handler Sink", err.Error())
+ assert.Equal(t, "missing endpoint in Error Handler Sink", err.Error())
}
diff --git a/pkg/kamelet/repository/composite_repository.go b/pkg/kamelet/repository/composite_repository.go
index c3e362daa..2ca6a611d 100644
--- a/pkg/kamelet/repository/composite_repository.go
+++ b/pkg/kamelet/repository/composite_repository.go
@@ -39,18 +39,18 @@ func newCompositeKameletRepository(repositories ...KameletRepository) KameletRep
}
func (c compositeKameletRepository) List(ctx context.Context) ([]string, error) {
- kSet := make(map[string]bool)
+ setOfKeys := make(map[string]bool)
for _, repo := range c.repositories {
lst, err := repo.List(ctx)
if err != nil {
return nil, err
}
for _, kam := range lst {
- kSet[kam] = true
+ setOfKeys[kam] = true
}
}
- res := make([]string, 0, len(kSet))
- for kam := range kSet {
+ res := make([]string, 0, len(setOfKeys))
+ for kam := range setOfKeys {
res = append(res, kam)
}
sort.Strings(res)
diff --git a/pkg/kamelet/repository/empty_repository.go b/pkg/kamelet/repository/empty_repository.go
index ac893448a..d71c88a66 100644
--- a/pkg/kamelet/repository/empty_repository.go
+++ b/pkg/kamelet/repository/empty_repository.go
@@ -30,7 +30,7 @@ func newEmptyKameletRepository() KameletRepository {
return &emptyKameletRepository{}
}
-// Enforce type
+// Enforce type.
var _ KameletRepository = &emptyKameletRepository{}
func (e *emptyKameletRepository) List(_ context.Context) ([]string, error) {
@@ -41,6 +41,6 @@ func (e *emptyKameletRepository) Get(_ context.Context, _ string) (*v1.Kamelet,
return nil, nil
}
-func (c *emptyKameletRepository) String() string {
+func (e *emptyKameletRepository) String() string {
return "Empty[]"
}
diff --git a/pkg/kamelet/repository/github_repository.go b/pkg/kamelet/repository/github_repository.go
index 47bbcf3f1..b26ce3adc 100644
--- a/pkg/kamelet/repository/github_repository.go
+++ b/pkg/kamelet/repository/github_repository.go
@@ -42,12 +42,11 @@ type githubKameletRepository struct {
ref string
}
-func newGithubKameletRepository(owner, repo, path, ref string) KameletRepository {
+func newGithubKameletRepository(ctx context.Context, owner, repo, path, ref string) KameletRepository {
httpClient := &http.Client{}
if token, ok := os.LookupEnv("GITHUB_TOKEN"); ok {
ts := oauth2.StaticTokenSource(&oauth2.Token{AccessToken: token})
- ctx := context.WithValue(context.Background(), oauth2.HTTPClient, httpClient)
- httpClient = oauth2.NewClient(ctx, ts)
+ httpClient = oauth2.NewClient(context.WithValue(ctx, oauth2.HTTPClient, httpClient), ts)
}
return &githubKameletRepository{
@@ -59,7 +58,7 @@ func newGithubKameletRepository(owner, repo, path, ref string) KameletRepository
}
}
-// Enforce type
+// Enforce type.
var _ KameletRepository = &githubKameletRepository{}
func (c *githubKameletRepository) List(ctx context.Context) ([]string, error) {
@@ -121,6 +120,8 @@ func (c *githubKameletRepository) downloadKamelet(ctx context.Context, url strin
if err != nil {
return nil, err
}
+ defer resp.Body.Close()
+
if resp.StatusCode != 200 {
return nil, fmt.Errorf("cannot download file %s: %d %s", url, resp.StatusCode, resp.Status)
}
diff --git a/pkg/kamelet/repository/github_repository_test.go b/pkg/kamelet/repository/github_repository_test.go
index 962d2ed01..9bb53713a 100644
--- a/pkg/kamelet/repository/github_repository_test.go
+++ b/pkg/kamelet/repository/github_repository_test.go
@@ -32,7 +32,7 @@ func TestGithubRepository(t *testing.T) {
}
ctx := context.Background()
- repo := newGithubKameletRepository("apache", "camel-kamelets", "kamelets", "")
+ repo := newGithubKameletRepository(ctx, "apache", "camel-kamelets", "kamelets", "")
list, err := repo.List(ctx)
assert.NoError(t, err)
require.True(t, len(list) > 0)
diff --git a/pkg/kamelet/repository/kubernetes_repository.go b/pkg/kamelet/repository/kubernetes_repository.go
index cb0c5919a..7b14ca9c0 100644
--- a/pkg/kamelet/repository/kubernetes_repository.go
+++ b/pkg/kamelet/repository/kubernetes_repository.go
@@ -40,7 +40,7 @@ func newKubernetesKameletRepository(client versioned.Interface, namespace string
}
}
-// Enforce type
+// Enforce type.
var _ KameletRepository = &kubernetesKameletRepository{}
func (c *kubernetesKameletRepository) List(ctx context.Context) ([]string, error) {
diff --git a/pkg/kamelet/repository/repository.go b/pkg/kamelet/repository/repository.go
index efe60c1a3..b34f94e21 100644
--- a/pkg/kamelet/repository/repository.go
+++ b/pkg/kamelet/repository/repository.go
@@ -28,13 +28,13 @@ import (
)
const (
- // NoneRepository is a marker used to indicate that no repository should be used
+ // NoneRepository is a marker used to indicate that no repository should be used.
NoneRepository = "none"
)
var DefaultRemoteRepository = NoneRepository
-// KameletRepository can be used to obtain a Kamelet definition, looking it up in one or more physical locations
+// KameletRepository can be used to obtain a Kamelet definition, looking it up in one or more physical locations.
type KameletRepository interface {
// List the kamelets available in the repository
@@ -73,7 +73,7 @@ func NewForPlatform(ctx context.Context, client camel.Interface, platform *v1.In
if platform != nil {
repos := getRepositoriesFromPlatform(platform)
for _, repoURI := range repos {
- repoImpl, err := newFromURI(repoURI)
+ repoImpl, err := newFromURI(ctx, repoURI)
if err != nil {
return nil, err
}
@@ -81,7 +81,7 @@ func NewForPlatform(ctx context.Context, client camel.Interface, platform *v1.In
}
} else {
// Add default repo
- defaultRepoImpl, err := newFromURI(DefaultRemoteRepository)
+ defaultRepoImpl, err := newFromURI(ctx, DefaultRemoteRepository)
if err != nil {
return nil, err
}
@@ -94,10 +94,10 @@ func NewForPlatform(ctx context.Context, client camel.Interface, platform *v1.In
// NewStandalone creates a KameletRepository that can be used in cases where there's no connection to a Kubernetes cluster.
// The given uris are used to construct the repositories.
// If the uris parameter is nil, then only the DefaultRemoteRepository will be included.
-func NewStandalone(uris ...string) (KameletRepository, error) {
+func NewStandalone(ctx context.Context, uris ...string) (KameletRepository, error) {
repoImpls := make([]KameletRepository, 0, len(uris)+1)
for _, repoURI := range uris {
- repoImpl, err := newFromURI(repoURI)
+ repoImpl, err := newFromURI(ctx, repoURI)
if err != nil {
return nil, err
}
@@ -106,7 +106,7 @@ func NewStandalone(uris ...string) (KameletRepository, error) {
}
}
if len(repoImpls) == 0 {
- defaultRepoImpl, err := newFromURI(DefaultRemoteRepository)
+ defaultRepoImpl, err := newFromURI(ctx, DefaultRemoteRepository)
if err != nil {
return nil, err
}
@@ -152,7 +152,7 @@ func getRepositoriesFromPlatform(platform *v1.IntegrationPlatform) []string {
return res
}
-func newFromURI(uri string) (KameletRepository, error) {
+func newFromURI(ctx context.Context, uri string) (KameletRepository, error) {
if uri == NoneRepository {
return newEmptyKameletRepository(), nil
} else if strings.HasPrefix(uri, "github:") {
@@ -173,7 +173,7 @@ func newFromURI(uri string) (KameletRepository, error) {
if len(parts) >= 3 {
path = strings.Join(parts[2:], "/")
}
- return newGithubKameletRepository(owner, repo, path, version), nil
+ return newGithubKameletRepository(ctx, owner, repo, path, version), nil
}
return nil, fmt.Errorf("invalid uri: %s", uri)
}
diff --git a/pkg/kamelet/repository/repository_test.go b/pkg/kamelet/repository/repository_test.go
index 33914b6d3..60d419f90 100644
--- a/pkg/kamelet/repository/repository_test.go
+++ b/pkg/kamelet/repository/repository_test.go
@@ -100,7 +100,8 @@ func TestURIParse(t *testing.T) {
}
for i, test := range tests {
t.Run(fmt.Sprintf("%d-%s", i, test.uri), func(t *testing.T) {
- catalog, err := newFromURI(test.uri)
+ ctx := context.Background()
+ catalog, err := newFromURI(ctx, test.uri)
if test.error {
assert.Error(t, err)
} else {