This is an automated email from the ASF dual-hosted git repository.
pcongiusti pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git
The following commit(s) were added to refs/heads/main by this push:
new c4f221593 chore(deps): golang 1.24
c4f221593 is described below
commit c4f221593c3e623cd3b75459e990c5cb750b55c6
Author: Pasquale Congiusti <[email protected]>
AuthorDate: Mon Feb 24 18:03:33 2025 +0100
chore(deps): golang 1.24
---
e2e/advanced/builder_test.go | 4 ++--
e2e/support/test_support.go | 2 +-
go.mod | 2 +-
pkg/apis/camel/v1/build_types_support.go | 22 ++++++++++----------
pkg/apis/camel/v1/camelcatalog_types_support.go | 14 ++++++-------
pkg/apis/camel/v1/common_types.go | 2 +-
pkg/apis/camel/v1/error_handler_types_support.go | 24 +++++++++++-----------
pkg/apis/camel/v1/integration_types_support.go | 16 +++++++--------
pkg/apis/camel/v1/integrationkit_types_support.go | 16 +++++++--------
.../camel/v1/integrationplatform_types_support.go | 18 ++++++++--------
.../camel/v1/integrationprofile_types_support.go | 18 ++++++++--------
pkg/apis/camel/v1/kamelet_types_support.go | 14 ++++++-------
pkg/apis/camel/v1/pipe_types_support.go | 14 ++++++-------
pkg/apis/camel/v1/trait/base.go | 2 +-
pkg/builder/project.go | 2 +-
pkg/cmd/source/source.go | 2 +-
pkg/controller/pipe/error_handler.go | 6 +++---
pkg/controller/pipe/error_handler_test.go | 20 ++++++++++++------
pkg/kamelet/repository/composite_repository.go | 4 ++--
pkg/util/source/inspector.go | 4 ++--
script/Makefile | 2 +-
21 files changed, 108 insertions(+), 100 deletions(-)
diff --git a/e2e/advanced/builder_test.go b/e2e/advanced/builder_test.go
index faf0e6bee..3b33c58ad 100644
--- a/e2e/advanced/builder_test.go
+++ b/e2e/advanced/builder_test.go
@@ -139,7 +139,7 @@ func newMavenProfileConfigMap(ns, name, key string)
*corev1.ConfigMap {
Data: map[string]string{
key: fmt.Sprintf(`
<profile>
- <id>` + key + `</id>
+ <id>%s</id>
<build>
<plugins>
<plugin>
@@ -157,7 +157,7 @@ func newMavenProfileConfigMap(ns, name, key string)
*corev1.ConfigMap {
</plugins>
</build>
</profile>
-`,
+`, key,
),
},
}
diff --git a/e2e/support/test_support.go b/e2e/support/test_support.go
index 8df8f8f68..f457e3e62 100644
--- a/e2e/support/test_support.go
+++ b/e2e/support/test_support.go
@@ -520,7 +520,7 @@ func StructuredLogs(t *testing.T, ctx context.Context, ns,
podName string, optio
continue
} else {
msg := fmt.Sprintf("Unable to parse structured
content: %s", t)
- log.Errorf(err, msg)
+ log.Error(err, msg)
return nil, fmt.Errorf("%s %w\n", msg, err)
}
}
diff --git a/go.mod b/go.mod
index 7589a143a..cf4aa05c8 100644
--- a/go.mod
+++ b/go.mod
@@ -1,6 +1,6 @@
module github.com/apache/camel-k/v2
-go 1.23
+go 1.24
require (
github.com/Masterminds/semver v1.5.0
diff --git a/pkg/apis/camel/v1/build_types_support.go
b/pkg/apis/camel/v1/build_types_support.go
index 029498902..1dc4d638c 100644
--- a/pkg/apis/camel/v1/build_types_support.go
+++ b/pkg/apis/camel/v1/build_types_support.go
@@ -207,41 +207,41 @@ func (in *BuildStatus) RemoveCondition(condType
BuildConditionType) {
in.Conditions = newConditions
}
-var _ ResourceCondition = BuildCondition{}
+var _ ResourceCondition = &BuildCondition{}
func (in *BuildStatus) GetConditions() []ResourceCondition {
res := make([]ResourceCondition, 0, len(in.Conditions))
for _, c := range in.Conditions {
- res = append(res, c)
+ res = append(res, &c)
}
return res
}
-func (c BuildCondition) GetType() string {
+func (c *BuildCondition) GetType() string {
return string(c.Type)
}
-func (c BuildCondition) GetStatus() corev1.ConditionStatus {
+func (c *BuildCondition) GetStatus() corev1.ConditionStatus {
return c.Status
}
-func (c BuildCondition) GetLastUpdateTime() metav1.Time {
+func (c *BuildCondition) GetLastUpdateTime() metav1.Time {
return c.LastUpdateTime
}
-func (c BuildCondition) GetLastTransitionTime() metav1.Time {
+func (c *BuildCondition) GetLastTransitionTime() metav1.Time {
return c.LastTransitionTime
}
-func (c BuildCondition) GetReason() string {
+func (c *BuildCondition) GetReason() string {
return c.Reason
}
-func (c BuildCondition) GetMessage() string {
+func (c *BuildCondition) GetMessage() string {
return c.Message
}
-func (bl BuildList) HasRunningBuilds() bool {
+func (bl *BuildList) HasRunningBuilds() bool {
for _, b := range bl.Items {
if b.Status.Phase == BuildPhasePending || b.Status.Phase ==
BuildPhaseRunning {
return true
@@ -251,7 +251,7 @@ func (bl BuildList) HasRunningBuilds() bool {
return false
}
-func (bl BuildList) HasScheduledBuildsBefore(build *Build) (bool, *Build) {
+func (bl *BuildList) HasScheduledBuildsBefore(build *Build) (bool, *Build) {
for _, b := range bl.Items {
if b.Name == build.Name {
continue
@@ -268,7 +268,7 @@ func (bl BuildList) HasScheduledBuildsBefore(build *Build)
(bool, *Build) {
// HasMatchingBuild visit all items in the list of builds and search for a
scheduled build that matches the given build's dependencies.
// It returns the first matching build found regardless it may have any one
more appropriate.
-func (bl BuildList) HasMatchingBuild(build *Build) (bool, *Build) {
+func (bl *BuildList) HasMatchingBuild(build *Build) (bool, *Build) {
required := build.BuilderDependencies()
if len(required) == 0 {
return false, nil
diff --git a/pkg/apis/camel/v1/camelcatalog_types_support.go
b/pkg/apis/camel/v1/camelcatalog_types_support.go
index 97c8808d5..fe995a70d 100644
--- a/pkg/apis/camel/v1/camelcatalog_types_support.go
+++ b/pkg/apis/camel/v1/camelcatalog_types_support.go
@@ -64,32 +64,32 @@ func NewCamelCatalogList() CamelCatalogList {
}
// GetType --.
-func (c CamelCatalogCondition) GetType() string {
+func (c *CamelCatalogCondition) GetType() string {
return string(c.Type)
}
// GetStatus --.
-func (c CamelCatalogCondition) GetStatus() corev1.ConditionStatus {
+func (c *CamelCatalogCondition) GetStatus() corev1.ConditionStatus {
return c.Status
}
// GetLastUpdateTime --.
-func (c CamelCatalogCondition) GetLastUpdateTime() metav1.Time {
+func (c *CamelCatalogCondition) GetLastUpdateTime() metav1.Time {
return c.LastUpdateTime
}
// GetLastTransitionTime --.
-func (c CamelCatalogCondition) GetLastTransitionTime() metav1.Time {
+func (c *CamelCatalogCondition) GetLastTransitionTime() metav1.Time {
return c.LastTransitionTime
}
// GetReason --.
-func (c CamelCatalogCondition) GetReason() string {
+func (c *CamelCatalogCondition) GetReason() string {
return c.Reason
}
// GetMessage --.
-func (c CamelCatalogCondition) GetMessage() string {
+func (c *CamelCatalogCondition) GetMessage() string {
return c.Message
}
@@ -97,7 +97,7 @@ func (c CamelCatalogCondition) GetMessage() string {
func (in *CamelCatalogStatus) GetConditions() []ResourceCondition {
res := make([]ResourceCondition, 0, len(in.Conditions))
for _, c := range in.Conditions {
- res = append(res, c)
+ res = append(res, &c)
}
return res
}
diff --git a/pkg/apis/camel/v1/common_types.go
b/pkg/apis/camel/v1/common_types.go
index 87e621b75..1acb0759f 100644
--- a/pkg/apis/camel/v1/common_types.go
+++ b/pkg/apis/camel/v1/common_types.go
@@ -295,7 +295,7 @@ type TraitConfiguration struct {
// +kubebuilder:validation:Type=""
// +kubebuilder:validation:Format=""
// +kubebuilder:pruning:PreserveUnknownFields
-type RawMessage []byte
+type RawMessage []byte //nolint: recvcheck
// +kubebuilder:object:generate=false
diff --git a/pkg/apis/camel/v1/error_handler_types_support.go
b/pkg/apis/camel/v1/error_handler_types_support.go
index d12e76d1f..d17496254 100644
--- a/pkg/apis/camel/v1/error_handler_types_support.go
+++ b/pkg/apis/camel/v1/error_handler_types_support.go
@@ -37,22 +37,22 @@ type baseErrorHandler struct {
}
// Type --.
-func (e baseErrorHandler) Type() ErrorHandlerType {
+func (e *baseErrorHandler) Type() ErrorHandlerType {
return errorHandlerTypeBase
}
// Endpoint --.
-func (e baseErrorHandler) Endpoint() *Endpoint {
+func (e *baseErrorHandler) Endpoint() *Endpoint {
return nil
}
// Configuration --.
-func (e baseErrorHandler) Configuration() (map[string]interface{}, error) {
+func (e *baseErrorHandler) Configuration() (map[string]interface{}, error) {
return nil, nil
}
// Validate --.
-func (e baseErrorHandler) Validate() error {
+func (e *baseErrorHandler) Validate() error {
return nil
}
@@ -62,12 +62,12 @@ type ErrorHandlerNone struct {
}
// Type --.
-func (e ErrorHandlerNone) Type() ErrorHandlerType {
+func (e *ErrorHandlerNone) Type() ErrorHandlerType {
return ErrorHandlerTypeNone
}
// Configuration --.
-func (e ErrorHandlerNone) Configuration() (map[string]interface{}, error) {
+func (e *ErrorHandlerNone) Configuration() (map[string]interface{}, error) {
return map[string]interface{}{}, nil
}
@@ -78,12 +78,12 @@ type ErrorHandlerLog struct {
}
// Type --.
-func (e ErrorHandlerLog) Type() ErrorHandlerType {
+func (e *ErrorHandlerLog) Type() ErrorHandlerType {
return ErrorHandlerTypeLog
}
// Configuration --.
-func (e ErrorHandlerLog) Configuration() (map[string]interface{}, error) {
+func (e *ErrorHandlerLog) Configuration() (map[string]interface{}, error) {
properties, err := e.ErrorHandlerNone.Configuration()
if err != nil {
return nil, err
@@ -106,17 +106,17 @@ type ErrorHandlerSink struct {
}
// Type --.
-func (e ErrorHandlerSink) Type() ErrorHandlerType {
+func (e *ErrorHandlerSink) Type() ErrorHandlerType {
return ErrorHandlerTypeSink
}
// Endpoint --.
-func (e ErrorHandlerSink) Endpoint() *Endpoint {
+func (e *ErrorHandlerSink) Endpoint() *Endpoint {
return e.DLCEndpoint
}
// Configuration --.
-func (e ErrorHandlerSink) Configuration() (map[string]interface{}, error) {
+func (e *ErrorHandlerSink) Configuration() (map[string]interface{}, error) {
properties, err := e.ErrorHandlerLog.Configuration()
if err != nil {
return nil, err
@@ -126,7 +126,7 @@ func (e ErrorHandlerSink) Configuration()
(map[string]interface{}, error) {
}
// Validate --.
-func (e ErrorHandlerSink) Validate() error {
+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_support.go
b/pkg/apis/camel/v1/integration_types_support.go
index 88c50be27..82acb67da 100644
--- a/pkg/apis/camel/v1/integration_types_support.go
+++ b/pkg/apis/camel/v1/integration_types_support.go
@@ -437,37 +437,37 @@ func (in *IntegrationStatus) RemoveCondition(condType
IntegrationConditionType)
in.Conditions = newConditions
}
-var _ ResourceCondition = IntegrationCondition{}
+var _ ResourceCondition = &IntegrationCondition{}
func (in *IntegrationStatus) GetConditions() []ResourceCondition {
res := make([]ResourceCondition, 0, len(in.Conditions))
for _, c := range in.Conditions {
- res = append(res, c)
+ res = append(res, &c)
}
return res
}
-func (c IntegrationCondition) GetType() string {
+func (c *IntegrationCondition) GetType() string {
return string(c.Type)
}
-func (c IntegrationCondition) GetStatus() corev1.ConditionStatus {
+func (c *IntegrationCondition) GetStatus() corev1.ConditionStatus {
return c.Status
}
-func (c IntegrationCondition) GetLastUpdateTime() metav1.Time {
+func (c *IntegrationCondition) GetLastUpdateTime() metav1.Time {
return c.LastUpdateTime
}
-func (c IntegrationCondition) GetLastTransitionTime() metav1.Time {
+func (c *IntegrationCondition) GetLastTransitionTime() metav1.Time {
return c.LastTransitionTime
}
-func (c IntegrationCondition) GetReason() string {
+func (c *IntegrationCondition) GetReason() string {
return c.Reason
}
-func (c IntegrationCondition) GetMessage() string {
+func (c *IntegrationCondition) GetMessage() string {
return c.Message
}
diff --git a/pkg/apis/camel/v1/integrationkit_types_support.go
b/pkg/apis/camel/v1/integrationkit_types_support.go
index ec8e92d5a..717ee9589 100644
--- a/pkg/apis/camel/v1/integrationkit_types_support.go
+++ b/pkg/apis/camel/v1/integrationkit_types_support.go
@@ -199,12 +199,12 @@ func (in *IntegrationKitStatus) RemoveCondition(condType
IntegrationKitCondition
in.Conditions = newConditions
}
-var _ ResourceCondition = IntegrationKitCondition{}
+var _ ResourceCondition = &IntegrationKitCondition{}
func (in *IntegrationKitStatus) GetConditions() []ResourceCondition {
res := make([]ResourceCondition, 0, len(in.Conditions))
for _, c := range in.Conditions {
- res = append(res, c)
+ res = append(res, &c)
}
return res
}
@@ -220,26 +220,26 @@ func (in *IntegrationKitStatus) GetDependenciesPaths()
*sets.Set {
return s
}
-func (c IntegrationKitCondition) GetType() string {
+func (c *IntegrationKitCondition) GetType() string {
return string(c.Type)
}
-func (c IntegrationKitCondition) GetStatus() corev1.ConditionStatus {
+func (c *IntegrationKitCondition) GetStatus() corev1.ConditionStatus {
return c.Status
}
-func (c IntegrationKitCondition) GetLastUpdateTime() metav1.Time {
+func (c *IntegrationKitCondition) GetLastUpdateTime() metav1.Time {
return c.LastUpdateTime
}
-func (c IntegrationKitCondition) GetLastTransitionTime() metav1.Time {
+func (c *IntegrationKitCondition) GetLastTransitionTime() metav1.Time {
return c.LastTransitionTime
}
-func (c IntegrationKitCondition) GetReason() string {
+func (c *IntegrationKitCondition) GetReason() string {
return c.Reason
}
-func (c IntegrationKitCondition) GetMessage() string {
+func (c *IntegrationKitCondition) GetMessage() string {
return c.Message
}
diff --git a/pkg/apis/camel/v1/integrationplatform_types_support.go
b/pkg/apis/camel/v1/integrationplatform_types_support.go
index d4569863a..a12723ee2 100644
--- a/pkg/apis/camel/v1/integrationplatform_types_support.go
+++ b/pkg/apis/camel/v1/integrationplatform_types_support.go
@@ -172,50 +172,50 @@ func (in *IntegrationPlatformStatus)
RemoveCondition(condType IntegrationPlatfor
}
// GetTimeout returns the specified duration or a default one.
-func (b IntegrationPlatformBuildSpec) GetTimeout() metav1.Duration {
+func (b *IntegrationPlatformBuildSpec) GetTimeout() metav1.Duration {
if b.Timeout == nil {
return metav1.Duration{}
}
return *b.Timeout
}
-var _ ResourceCondition = IntegrationPlatformCondition{}
+var _ ResourceCondition = &IntegrationPlatformCondition{}
// GetConditions --.
func (in *IntegrationPlatformStatus) GetConditions() []ResourceCondition {
res := make([]ResourceCondition, 0, len(in.Conditions))
for _, c := range in.Conditions {
- res = append(res, c)
+ res = append(res, &c)
}
return res
}
// GetType --.
-func (c IntegrationPlatformCondition) GetType() string {
+func (c *IntegrationPlatformCondition) GetType() string {
return string(c.Type)
}
// GetStatus --.
-func (c IntegrationPlatformCondition) GetStatus() corev1.ConditionStatus {
+func (c *IntegrationPlatformCondition) GetStatus() corev1.ConditionStatus {
return c.Status
}
// GetLastUpdateTime --.
-func (c IntegrationPlatformCondition) GetLastUpdateTime() metav1.Time {
+func (c *IntegrationPlatformCondition) GetLastUpdateTime() metav1.Time {
return c.LastUpdateTime
}
// GetLastTransitionTime --.
-func (c IntegrationPlatformCondition) GetLastTransitionTime() metav1.Time {
+func (c *IntegrationPlatformCondition) GetLastTransitionTime() metav1.Time {
return c.LastTransitionTime
}
// GetReason --.
-func (c IntegrationPlatformCondition) GetReason() string {
+func (c *IntegrationPlatformCondition) GetReason() string {
return c.Reason
}
// GetMessage --.
-func (c IntegrationPlatformCondition) GetMessage() string {
+func (c *IntegrationPlatformCondition) GetMessage() string {
return c.Message
}
diff --git a/pkg/apis/camel/v1/integrationprofile_types_support.go
b/pkg/apis/camel/v1/integrationprofile_types_support.go
index 6ae13b994..9ea29fb27 100644
--- a/pkg/apis/camel/v1/integrationprofile_types_support.go
+++ b/pkg/apis/camel/v1/integrationprofile_types_support.go
@@ -132,50 +132,50 @@ func (in *IntegrationProfileStatus)
RemoveCondition(condType IntegrationProfileC
}
// GetTimeout returns the specified duration or a default one.
-func (b IntegrationProfileBuildSpec) GetTimeout() metav1.Duration {
+func (b *IntegrationProfileBuildSpec) GetTimeout() metav1.Duration {
if b.Timeout == nil {
return metav1.Duration{}
}
return *b.Timeout
}
-var _ ResourceCondition = IntegrationProfileCondition{}
+var _ ResourceCondition = &IntegrationProfileCondition{}
// GetConditions --.
func (in *IntegrationProfileStatus) GetConditions() []ResourceCondition {
res := make([]ResourceCondition, 0, len(in.Conditions))
for _, c := range in.Conditions {
- res = append(res, c)
+ res = append(res, &c)
}
return res
}
// GetType --.
-func (c IntegrationProfileCondition) GetType() string {
+func (c *IntegrationProfileCondition) GetType() string {
return string(c.Type)
}
// GetStatus --.
-func (c IntegrationProfileCondition) GetStatus() corev1.ConditionStatus {
+func (c *IntegrationProfileCondition) GetStatus() corev1.ConditionStatus {
return c.Status
}
// GetLastUpdateTime --.
-func (c IntegrationProfileCondition) GetLastUpdateTime() metav1.Time {
+func (c *IntegrationProfileCondition) GetLastUpdateTime() metav1.Time {
return c.LastUpdateTime
}
// GetLastTransitionTime --.
-func (c IntegrationProfileCondition) GetLastTransitionTime() metav1.Time {
+func (c *IntegrationProfileCondition) GetLastTransitionTime() metav1.Time {
return c.LastTransitionTime
}
// GetReason --.
-func (c IntegrationProfileCondition) GetReason() string {
+func (c *IntegrationProfileCondition) GetReason() string {
return c.Reason
}
// GetMessage --.
-func (c IntegrationProfileCondition) GetMessage() string {
+func (c *IntegrationProfileCondition) GetMessage() string {
return c.Message
}
diff --git a/pkg/apis/camel/v1/kamelet_types_support.go
b/pkg/apis/camel/v1/kamelet_types_support.go
index aa19fc2b9..bbcc42a5d 100644
--- a/pkg/apis/camel/v1/kamelet_types_support.go
+++ b/pkg/apis/camel/v1/kamelet_types_support.go
@@ -29,38 +29,38 @@ import (
func (in *KameletStatus) GetConditions() []ResourceCondition {
res := make([]ResourceCondition, 0, len(in.Conditions))
for _, c := range in.Conditions {
- res = append(res, c)
+ res = append(res, &c)
}
return res
}
// GetType --.
-func (c KameletCondition) GetType() string {
+func (c *KameletCondition) GetType() string {
return string(c.Type)
}
// GetStatus --.
-func (c KameletCondition) GetStatus() corev1.ConditionStatus {
+func (c *KameletCondition) GetStatus() corev1.ConditionStatus {
return c.Status
}
// GetLastUpdateTime --.
-func (c KameletCondition) GetLastUpdateTime() metav1.Time {
+func (c *KameletCondition) GetLastUpdateTime() metav1.Time {
return c.LastUpdateTime
}
// GetLastTransitionTime --.
-func (c KameletCondition) GetLastTransitionTime() metav1.Time {
+func (c *KameletCondition) GetLastTransitionTime() metav1.Time {
return c.LastTransitionTime
}
// GetReason --.
-func (c KameletCondition) GetReason() string {
+func (c *KameletCondition) GetReason() string {
return c.Reason
}
// GetMessage --.
-func (c KameletCondition) GetMessage() string {
+func (c *KameletCondition) GetMessage() string {
return c.Message
}
diff --git a/pkg/apis/camel/v1/pipe_types_support.go
b/pkg/apis/camel/v1/pipe_types_support.go
index f5f855b06..328bd3123 100644
--- a/pkg/apis/camel/v1/pipe_types_support.go
+++ b/pkg/apis/camel/v1/pipe_types_support.go
@@ -31,38 +31,38 @@ import (
func (in *PipeStatus) GetConditions() []ResourceCondition {
res := make([]ResourceCondition, 0, len(in.Conditions))
for _, c := range in.Conditions {
- res = append(res, c)
+ res = append(res, &c)
}
return res
}
// GetType --.
-func (c PipeCondition) GetType() string {
+func (c *PipeCondition) GetType() string {
return string(c.Type)
}
// GetStatus --.
-func (c PipeCondition) GetStatus() corev1.ConditionStatus {
+func (c *PipeCondition) GetStatus() corev1.ConditionStatus {
return c.Status
}
// GetLastUpdateTime --.
-func (c PipeCondition) GetLastUpdateTime() metav1.Time {
+func (c *PipeCondition) GetLastUpdateTime() metav1.Time {
return c.LastUpdateTime
}
// GetLastTransitionTime --.
-func (c PipeCondition) GetLastTransitionTime() metav1.Time {
+func (c *PipeCondition) GetLastTransitionTime() metav1.Time {
return c.LastTransitionTime
}
// GetReason --.
-func (c PipeCondition) GetReason() string {
+func (c *PipeCondition) GetReason() string {
return c.Reason
}
// GetMessage --.
-func (c PipeCondition) GetMessage() string {
+func (c *PipeCondition) GetMessage() string {
return c.Message
}
diff --git a/pkg/apis/camel/v1/trait/base.go b/pkg/apis/camel/v1/trait/base.go
index c4d62042d..8f5fdd23e 100644
--- a/pkg/apis/camel/v1/trait/base.go
+++ b/pkg/apis/camel/v1/trait/base.go
@@ -47,4 +47,4 @@ type Configuration struct {
// +kubebuilder:validation:Format=""
// +kubebuilder:pruning:PreserveUnknownFields
// Deprecated: for backward compatibility.
-type RawMessage []byte
+type RawMessage []byte //nolint: recvcheck
diff --git a/pkg/builder/project.go b/pkg/builder/project.go
index 84a39735c..d82550810 100644
--- a/pkg/builder/project.go
+++ b/pkg/builder/project.go
@@ -130,7 +130,7 @@ func generateProjectSettings(ctx *builderContext) error {
}
func injectServersIntoMavenSettings(settings string, servers []v1.Server)
string {
- if servers == nil || len(servers) < 1 {
+ if len(servers) < 1 {
return settings
}
newSettings, i := getServerTagIndex(settings)
diff --git a/pkg/cmd/source/source.go b/pkg/cmd/source/source.go
index 7a22cb21a..c9dce0df4 100644
--- a/pkg/cmd/source/source.go
+++ b/pkg/cmd/source/source.go
@@ -84,7 +84,7 @@ func (s *Source) setContent(content []byte) error {
return nil
}
-func (s Source) IsYaml() bool {
+func (s *Source) IsYaml() bool {
return strings.HasSuffix(s.Name, ".yaml") || strings.HasSuffix(s.Name,
".yml")
}
diff --git a/pkg/controller/pipe/error_handler.go
b/pkg/controller/pipe/error_handler.go
index a03ed4f30..b1db983a5 100644
--- a/pkg/controller/pipe/error_handler.go
+++ b/pkg/controller/pipe/error_handler.go
@@ -37,7 +37,7 @@ func maybeErrorHandler(errHandlConf *v1.ErrorHandlerSpec,
bindingContext binding
var errorHandlerBinding *bindings.Binding
- errorHandlerSpec, err := parseErrorHandler(errHandlConf.RawMessage)
+ errorHandlerSpec, err := parseErrorHandler(&errHandlConf.RawMessage)
if err != nil {
return nil, fmt.Errorf("could not parse error handler: %w", err)
}
@@ -69,9 +69,9 @@ func maybeErrorHandler(errHandlConf *v1.ErrorHandlerSpec,
bindingContext binding
return errorHandlerBinding, nil
}
-func parseErrorHandler(rawMessage v1.RawMessage) (v1.ErrorHandler, error) {
+func parseErrorHandler(rawMessage *v1.RawMessage) (v1.ErrorHandler, error) {
var properties map[v1.ErrorHandlerType]v1.RawMessage
- err := json.Unmarshal(rawMessage, &properties)
+ err := json.Unmarshal(*rawMessage, &properties)
if err != nil {
return nil, err
}
diff --git a/pkg/controller/pipe/error_handler_test.go
b/pkg/controller/pipe/error_handler_test.go
index 9ec0f1984..1231e454e 100644
--- a/pkg/controller/pipe/error_handler_test.go
+++ b/pkg/controller/pipe/error_handler_test.go
@@ -26,8 +26,9 @@ import (
)
func TestParseErrorHandlerNoneDoesSucceed(t *testing.T) {
+ cnt := v1.RawMessage([]byte(`{"none": null}`))
noErrorHandler, err := parseErrorHandler(
- []byte(`{"none": null}`),
+ &cnt,
)
require.NoError(t, err)
assert.Equal(t, v1.ErrorHandlerTypeNone, noErrorHandler.Type())
@@ -36,8 +37,9 @@ func TestParseErrorHandlerNoneDoesSucceed(t *testing.T) {
}
func TestParseErrorHandlerLogDoesSucceed(t *testing.T) {
+ cnt := v1.RawMessage([]byte(`{"log": null}`))
logErrorHandler, err := parseErrorHandler(
- []byte(`{"log": null}`),
+ &cnt,
)
require.NoError(t, err)
assert.Equal(t, v1.ErrorHandlerTypeLog, logErrorHandler.Type())
@@ -46,8 +48,9 @@ func TestParseErrorHandlerLogDoesSucceed(t *testing.T) {
}
func TestParseErrorHandlerLogWithParametersDoesSucceed(t *testing.T) {
+ cnt := v1.RawMessage([]byte(`{"log": {"parameters": {"param1":
"value1", "param2": "value2"}}}`))
logErrorHandler, err := parseErrorHandler(
- []byte(`{"log": {"parameters": {"param1": "value1", "param2":
"value2"}}}`),
+ &cnt,
)
require.NoError(t, err)
assert.Equal(t, v1.ErrorHandlerTypeLog, logErrorHandler.Type())
@@ -56,8 +59,9 @@ func TestParseErrorHandlerLogWithParametersDoesSucceed(t
*testing.T) {
}
func TestParseErrorHandlerSinkDoesSucceed(t *testing.T) {
+ cnt := v1.RawMessage([]byte(`{"sink": {"endpoint": {"uri":
"someUri"}}}`))
sinkErrorHandler, err := parseErrorHandler(
- []byte(`{"sink": {"endpoint": {"uri": "someUri"}}}`),
+ &cnt,
)
require.NoError(t, err)
assert.NotNil(t, sinkErrorHandler)
@@ -68,7 +72,7 @@ func TestParseErrorHandlerSinkDoesSucceed(t *testing.T) {
}
func TestParseErrorHandlerSinkWithParametersDoesSucceed(t *testing.T) {
- sinkErrorHandler, err := parseErrorHandler(
+ cnt := v1.RawMessage(
[]byte(`{
"sink": {
"endpoint": {
@@ -79,6 +83,9 @@ func TestParseErrorHandlerSinkWithParametersDoesSucceed(t
*testing.T) {
}
}`),
)
+ sinkErrorHandler, err := parseErrorHandler(
+ &cnt,
+ )
require.NoError(t, err)
assert.NotNil(t, sinkErrorHandler)
assert.Equal(t, v1.ErrorHandlerTypeSink, sinkErrorHandler.Type())
@@ -88,8 +95,9 @@ func TestParseErrorHandlerSinkWithParametersDoesSucceed(t
*testing.T) {
}
func TestParseErrorHandlerSinkFail(t *testing.T) {
+ cnt := v1.RawMessage([]byte(`{"sink": {"ref": {"uri": "someUri"}}}`))
_, err := parseErrorHandler(
- []byte(`{"sink": {"ref": {"uri": "someUri"}}}`),
+ &cnt,
)
require.Error(t, err)
assert.Equal(t, "missing endpoint in Error Handler Sink", err.Error())
diff --git a/pkg/kamelet/repository/composite_repository.go
b/pkg/kamelet/repository/composite_repository.go
index c3e362daa..6646b67b5 100644
--- a/pkg/kamelet/repository/composite_repository.go
+++ b/pkg/kamelet/repository/composite_repository.go
@@ -38,7 +38,7 @@ func newCompositeKameletRepository(repositories
...KameletRepository) KameletRep
}
}
-func (c compositeKameletRepository) List(ctx context.Context) ([]string,
error) {
+func (c *compositeKameletRepository) List(ctx context.Context) ([]string,
error) {
kSet := make(map[string]bool)
for _, repo := range c.repositories {
lst, err := repo.List(ctx)
@@ -57,7 +57,7 @@ func (c compositeKameletRepository) List(ctx context.Context)
([]string, error)
return res, nil
}
-func (c compositeKameletRepository) Get(ctx context.Context, name string)
(*v1.Kamelet, error) {
+func (c *compositeKameletRepository) Get(ctx context.Context, name string)
(*v1.Kamelet, error) {
for _, repo := range c.repositories {
kam, err := repo.Get(ctx, name)
if kam != nil || err != nil {
diff --git a/pkg/util/source/inspector.go b/pkg/util/source/inspector.go
index 101fbd91e..f73d7cb25 100644
--- a/pkg/util/source/inspector.go
+++ b/pkg/util/source/inspector.go
@@ -241,11 +241,11 @@ type baseInspector struct {
catalog *camel.RuntimeCatalog
}
-func (i baseInspector) Extract(v1.SourceSpec, *Metadata) error {
+func (i *baseInspector) Extract(v1.SourceSpec, *Metadata) error {
return nil
}
-func (i baseInspector) ReplaceFromURI(source *v1.SourceSpec, newFromURI
string) (bool, error) {
+func (i *baseInspector) ReplaceFromURI(source *v1.SourceSpec, newFromURI
string) (bool, error) {
return false, nil
}
diff --git a/script/Makefile b/script/Makefile
index b2c4bf70d..fb45f34c9 100644
--- a/script/Makefile
+++ b/script/Makefile
@@ -40,7 +40,7 @@ LINTER ?= $(LOCALBIN)/golangci-lint
DEADCODE ?= $(LOCALBIN)/deadcode
GOVULNCHECK ?= $(LOCALBIN)/govulncheck
GOIMPORT ?= $(LOCALBIN)/goimports
-LINTER_VERSION ?= v1.61.0
+LINTER_VERSION ?= v1.64.5
GOVULNCHECK_VERSION ?= latest
LINT_GOGC ?= 20
LINT_DEADLINE ?= 10m