diff --git a/pkg/apis/camel/v1/build_types.go b/pkg/apis/camel/v1/build_types.go index e928c66c9a..f3087cf54c 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,13 +73,13 @@ 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. @@ -100,7 +100,7 @@ type BuilderTask struct { 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 MavenSpec `json:",inline"` @@ -110,7 +110,7 @@ type MavenBuildSpec struct { 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 ContextDir string `json:"contextDir,omitempty"` @@ -122,7 +122,7 @@ type PublishTask struct { 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"` @@ -134,7 +134,7 @@ type BuildahTask struct { 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"` @@ -146,7 +146,7 @@ type KanikoTask struct { 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 Enabled *bool `json:"enabled,omitempty"` @@ -154,13 +154,13 @@ type KanikoTaskCache struct { 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,7 +178,7 @@ 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"` @@ -206,33 +206,33 @@ type BuildStatus struct { 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 cf23a23df1..d93a08bce5 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,14 +50,14 @@ 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 Runtime RuntimeSpec `json:"runtime" yaml:"runtime"` @@ -79,15 +79,15 @@ type CamelCatalogStatus struct { 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,15 +107,15 @@ 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) ID string `json:"id" yaml:"id"` @@ -129,13 +129,13 @@ type CamelScheme struct { 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 Dependencies []CamelArtifactDependency `json:"dependencies,omitempty" yaml:"dependencies,omitempty"` } -// CamelArtifactExclusion represents an exclusion clause +// CamelArtifactExclusion represents an exclusion clause. type CamelArtifactExclusion struct { // Maven Group GroupID string `json:"groupId" yaml:"groupId"` @@ -143,7 +143,7 @@ type CamelArtifactExclusion struct { ArtifactID string `json:"artifactId" yaml:"artifactId"` } -// CamelArtifactDependency represent a maven's dependency +// CamelArtifactDependency represent a maven's dependency. type CamelArtifactDependency struct { // the maven dependency MavenArtifact `json:",inline" yaml:",inline"` @@ -151,7 +151,7 @@ type CamelArtifactDependency struct { 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 CamelArtifactDependency `json:",inline" yaml:",inline"` @@ -167,7 +167,7 @@ type CamelArtifact struct { 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 MavenArtifact `json:",inline" yaml:",inline"` diff --git a/pkg/apis/camel/v1/camelcatalog_types_support.go b/pkg/apis/camel/v1/camelcatalog_types_support.go index 347e666d95..ddc597c6bf 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 0f3e2c8a3c..6647c9e839 100644 --- a/pkg/apis/camel/v1/common_types.go +++ b/pkg/apis/camel/v1/common_types.go @@ -25,17 +25,17 @@ 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"` @@ -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,14 +94,14 @@ 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"` @@ -109,7 +109,7 @@ type ConfigurationSpec struct { 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) ID string `json:"id" yaml:"id"` @@ -121,7 +121,7 @@ type Artifact struct { 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 Reason string `json:"reason"` @@ -131,7 +131,7 @@ type Failure struct { 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 int `json:"attempt"` @@ -142,24 +142,24 @@ type FailureRecovery struct { 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 Affinity *trait.AffinityTrait `property:"affinity" json:"affinity,omitempty"` @@ -245,7 +245,7 @@ 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) 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,7 +302,7 @@ 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"` @@ -319,52 +319,52 @@ type RuntimeSpec struct { } // Capability is a particular feature which requires a well known set of dependencies -// which are specified in the runtime catalog +// which are specified in the runtime catalog. type Capability struct { Dependencies []MavenArtifact `json:"dependencies" yaml:"dependencies"` } const ( - // ServiceTypeUser service user type label marker + // ServiceTypeUser service user type label marker. ServiceTypeUser = "user" - // CapabilityAzureKeyVault defines the azure key vault capability + // CapabilityAzureKeyVault defines the azure key vault capability. CapabilityAzureKeyVault = "azure-key-vault" - // CapabilityAwsSecretsManager defines the aws secrets manager capability + // CapabilityAwsSecretsManager defines the aws secrets manager capability. CapabilityAwsSecretsManager = "aws-secrets-manager" - // CapabilityCircuitBreaker defines the circuit breaker capability + // CapabilityCircuitBreaker defines the circuit breaker capability. CapabilityCircuitBreaker = "circuit-breaker" - // CapabilityCron defines the cron execution capability + // CapabilityCron defines the cron execution capability. CapabilityCron = "cron" - // CapabilityGcpSecretManager defines the gcp secret manager capability + // CapabilityGcpSecretManager defines the gcp secret manager capability. CapabilityGcpSecretManager = "gcp-secret-manager" - // CapabilityHashicorpVault defines the Hashicorp Vault capability + // CapabilityHashicorpVault defines the Hashicorp Vault capability. CapabilityHashicorpVault = "hashicorp-vault" - // CapabilityHealth defines the health monitoring capability + // CapabilityHealth defines the health monitoring capability. CapabilityHealth = "health" - // CapabilityJolokia -- + // CapabilityJolokia --. CapabilityJolokia = "jolokia" - // CapabilityKnative -- + // CapabilityKnative --. CapabilityKnative = "knative" - // CapabilityMaster defines the master capability + // CapabilityMaster defines the master capability. CapabilityMaster = "master" - // CapabilityPrometheus -- + // CapabilityPrometheus --. CapabilityPrometheus = "prometheus" - // CapabilityRest defines the REST API service exposure capability + // CapabilityRest defines the REST API service exposure capability. CapabilityRest = "rest" - // CapabilityResumeKafka defines the resume capability + // CapabilityResumeKafka defines the resume capability. CapabilityResumeKafka = "resume-kafka" - // CapabilityPlatformHTTP defines the http service exposure capability + // CapabilityPlatformHTTP defines the http service exposure capability. CapabilityPlatformHTTP = "platform-http" - // CapabilityTelemetry defines the telemetry (opentelemetry) capability + // CapabilityTelemetry defines the telemetry (opentelemetry) capability. CapabilityTelemetry = "telemetry" - // CapabilityTracing defines the tracing (opentracing) capability + // CapabilityTracing defines the tracing (opentracing) capability. CapabilityTracing = "tracing" ) // +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 @@ -374,20 +374,20 @@ 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 DataSpec `json:",inline"` @@ -405,19 +405,19 @@ type SourceSpec struct { 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 Name string `json:"name,omitempty"` @@ -437,29 +437,29 @@ type DataSpec struct { 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 029d4ba67c..e2476b7fc5 100644 --- a/pkg/apis/camel/v1/common_types_support.go +++ b/pkg/apis/camel/v1/common_types_support.go @@ -118,7 +118,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/v1/error_handler_types.go b/pkg/apis/camel/v1/error_handler_types.go index 14a3721cde..49b93d20d6 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 c7bd7d0b0a..1be6b789b5 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,7 +134,7 @@ 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") diff --git a/pkg/apis/camel/v1/integration_types.go b/pkg/apis/camel/v1/integration_types.go index 1aa7be8853..86cf7a1aea 100644 --- a/pkg/apis/camel/v1/integration_types.go +++ b/pkg/apis/camel/v1/integration_types.go @@ -39,7 +39,7 @@ 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"` @@ -81,7 +81,7 @@ 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"` @@ -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,13 +272,13 @@ 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 Spec PodSpec `json:"spec,omitempty"` } -// PodSpec defines a group of Kubernetes resources +// PodSpec defines a group of Kubernetes resources. type PodSpec struct { // Volumes Volumes []corev1.Volume `json:"volumes,omitempty" patchStrategy:"merge,retainKeys" patchMergeKey:"name" protobuf:"bytes,1,rep,name=volumes"` diff --git a/pkg/apis/camel/v1/integration_types_support.go b/pkg/apis/camel/v1/integration_types_support.go index d74145b7e9..f144b3496f 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) } diff --git a/pkg/apis/camel/v1/integrationkit_types.go b/pkg/apis/camel/v1/integrationkit_types.go index abe34684f6..561217f31f 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 87d7667be8..7ee0c0328d 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 d877373588..0a0d3a131f 100644 --- a/pkg/apis/camel/v1/integrationplatform_types.go +++ b/pkg/apis/camel/v1/integrationplatform_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 -// 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) Cluster IntegrationPlatformCluster `json:"cluster,omitempty"` @@ -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 599f40ef70..c421bbfbb2 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 9d224b8fd2..074d4c290a 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,7 +56,7 @@ 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"` @@ -67,7 +67,7 @@ type Kamelet struct { 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"` @@ -84,7 +84,7 @@ 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 RawMessage `json:",inline"` @@ -94,16 +94,16 @@ 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) MediaType string `json:"mediaType,omitempty"` @@ -111,7 +111,7 @@ type EventTypeSpec struct { 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 Default string `json:"default,omitempty"` @@ -121,7 +121,7 @@ type DataTypesSpec struct { 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 Scheme string `json:"scheme,omitempty"` @@ -139,7 +139,7 @@ type DataTypeSpec struct { 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 Scheme string `json:"scheme,omitempty"` @@ -147,7 +147,7 @@ type DataTypeReference struct { 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,7 +168,7 @@ 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 Name string `json:"name,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 c918a84ebc..0b21fb26b8 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{} @@ -157,7 +157,7 @@ func (k *Kamelet) SortedDefinitionPropertiesKeys() []string { 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 5ed1ad2144..c8625b8c49 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 c14f386399..1becb3ef8f 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 66101d2026..c9a1386d0f 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"` @@ -54,7 +54,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"` @@ -68,7 +68,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"` @@ -81,7 +81,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 03498586ef..369e8626f0 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,26 +73,26 @@ 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"` @@ -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 cc1a46bdf5..ecdbb88cd7 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 @@ -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 9c45f9fb3f..42a0410961 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 1d83d2081e..aadd4f3935 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 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/v1alpha1/error_handler_types_support.go b/pkg/apis/camel/v1alpha1/error_handler_types_support.go index 09cf74826d..d3bde1fac1 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,7 +136,7 @@ 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") diff --git a/pkg/apis/camel/v1alpha1/jsonschema_types.go b/pkg/apis/camel/v1alpha1/jsonschema_types.go index c36a05bc5b..0f86ba0ca1 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 c4ba4c53ec..e4696a9d33 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,7 +66,7 @@ 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 *corev1.ObjectReference `json:"ref,omitempty"` @@ -81,26 +81,26 @@ 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"` @@ -132,36 +132,36 @@ type KameletBindingCondition struct { 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 bfe3da8b34..a726b6124c 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 c8b8ff6739..7f1865527f 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,7 +60,7 @@ 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"` @@ -71,7 +71,7 @@ type Kamelet struct { 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,7 +88,7 @@ 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 RawMessage `json:",inline"` @@ -98,16 +98,16 @@ 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) MediaType string `json:"mediaType,omitempty"` @@ -115,7 +115,7 @@ type EventTypeSpec struct { 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 Default string `json:"default,omitempty"` @@ -125,7 +125,7 @@ type DataTypesSpec struct { 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 Scheme string `json:"scheme,omitempty"` @@ -143,7 +143,7 @@ type DataTypeSpec struct { 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 Scheme string `json:"scheme,omitempty"` @@ -151,7 +151,7 @@ type DataTypeReference struct { 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,7 +160,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"` @@ -172,7 +172,7 @@ 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 Name string `json:"name,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 746d486f7f..84b6a8b357 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{} @@ -160,7 +160,7 @@ func (k *Kamelet) SortedDefinitionPropertiesKeys() []string { 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 e90d44ad3b..b97cbf194a 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/kamelet/repository/empty_repository.go b/pkg/kamelet/repository/empty_repository.go index ac893448a9..eb8a4e571f 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) { diff --git a/pkg/kamelet/repository/github_repository.go b/pkg/kamelet/repository/github_repository.go index 47bbcf3f11..408dbb29a3 100644 --- a/pkg/kamelet/repository/github_repository.go +++ b/pkg/kamelet/repository/github_repository.go @@ -59,7 +59,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) { diff --git a/pkg/kamelet/repository/kubernetes_repository.go b/pkg/kamelet/repository/kubernetes_repository.go index cb0c5919ae..7b14ca9c04 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 efe60c1a36..07c5460459 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 diff --git a/pkg/util/digest/digest.go b/pkg/util/digest/digest.go index ed5e8331d8..4e6d5c830d 100644 --- a/pkg/util/digest/digest.go +++ b/pkg/util/digest/digest.go @@ -40,7 +40,7 @@ import ( ) const ( - // IntegrationDigestEnvVar -- + // IntegrationDigestEnvVar --. IntegrationDigestEnvVar = "CAMEL_K_DIGEST" )