Skip to content

Commit

Permalink
fix(ci): lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
squakez committed Sep 1, 2023
1 parent dea0159 commit 463c8e4
Show file tree
Hide file tree
Showing 51 changed files with 574 additions and 675 deletions.
2 changes: 1 addition & 1 deletion e2e/support/util/structured_log.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ type LogEntry struct {
// Controller runtime
RequestNamespace string `json:"request-namespace,omitempty"`
RequestName string `json:"request-name,omitempty"`
ApiVersion string `json:"api-version,omitempty"`
APIVersion string `json:"api-version,omitempty"`
Kind string `json:"kind,omitempty"`
// Camel K
Namespace string `json:"ns,omitempty"`
Expand Down
52 changes: 26 additions & 26 deletions pkg/apis/camel/v1/build_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,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.
Expand All @@ -102,7 +102,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"`
Expand All @@ -112,7 +112,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"`
Expand All @@ -124,7 +124,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"`
Expand All @@ -136,7 +136,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"`
Expand All @@ -148,27 +148,27 @@ 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"`
// the PVC used to store the cache
PersistentVolumeClaim string `json:"persistentVolumeClaim,omitempty"`
}

// JibTask is used to configure Jib
// JibTask is used to configure Jib.
type JibTask struct {
BaseTask `json:",inline"`
PublishTask `json:",inline"`
}

// 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
Expand All @@ -177,7 +177,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
Expand All @@ -186,7 +186,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"`
Expand Down Expand Up @@ -214,33 +214,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"
)

Expand All @@ -256,7 +256,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"`
Expand All @@ -267,7 +267,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"`
Expand Down
30 changes: 15 additions & 15 deletions pkg/apis/camel/v1/camelcatalog_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
)

const (
// CamelCatalogKind --
// CamelCatalogKind -- .
CamelCatalogKind string = "CamelCatalog"
)

Expand All @@ -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"`
Expand All @@ -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"
)

Expand All @@ -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"`
Expand All @@ -129,29 +129,29 @@ 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"`
// Maven Artifact
ArtifactID string `json:"artifactId" yaml:"artifactId"`
}

// CamelArtifactDependency represent a maven's dependency
// CamelArtifactDependency represent a maven's dependency.
type CamelArtifactDependency struct {
// the maven dependency
MavenArtifact `json:",inline" yaml:",inline"`
// provide a list of artifacts to exclude for this dependency
Exclusions []CamelArtifactExclusion `json:"exclusions,omitempty" yaml:"exclusions,omitempty"`
}

// CamelArtifact represent the configuration for a feature offered by Camel
// CamelArtifact represent the configuration for a feature offered by Camel.
type CamelArtifact struct {
// Base Camel Artifact dependency
CamelArtifactDependency `json:",inline" yaml:",inline"`
Expand All @@ -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"`
Expand Down
26 changes: 13 additions & 13 deletions pkg/apis/camel/v1/camelcatalog_types_support.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand All @@ -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{
Expand All @@ -53,7 +53,7 @@ func NewCamelCatalogWithSpecs(namespace string, name string, spec CamelCatalogSp
}
}

// NewCamelCatalogList --
// NewCamelCatalogList --.
func NewCamelCatalogList() CamelCatalogList {
return CamelCatalogList{
TypeMeta: metav1.TypeMeta{
Expand All @@ -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 {
Expand All @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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-"):
Expand Down
Loading

0 comments on commit 463c8e4

Please sign in to comment.