You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by pc...@apache.org on 2023/08/24 08:49:22 UTC

[camel-k] 01/02: fix(ci): lint errors

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

commit f9a86542eaf5fe2936f5209dcf0736ce2a4689f3
Author: Pasquale Congiusti <pa...@gmail.com>
AuthorDate: Wed Aug 23 14:28:37 2023 +0200

    fix(ci): lint errors
---
 pkg/controller/integration/integration_controller.go |  2 +-
 pkg/trait/mount.go                                   |  4 ++--
 pkg/util/digest/digest.go                            |  2 +-
 pkg/util/resource/config.go                          | 11 -----------
 4 files changed, 4 insertions(+), 15 deletions(-)

diff --git a/pkg/controller/integration/integration_controller.go b/pkg/controller/integration/integration_controller.go
index c4013d382..1a879d8cc 100644
--- a/pkg/controller/integration/integration_controller.go
+++ b/pkg/controller/integration/integration_controller.go
@@ -351,7 +351,7 @@ func add(ctx context.Context, mgr manager.Manager, c client.Client, r reconcile.
 
 				return integrationPlatformEnqueueRequestsFromMapFunc(ctx, c, p)
 			})).
-		// Watch for Configmaps or Secret used in the Integrations for updates.
+		// Watch for Configmaps or Secret used in the Integrations for updates
 		Watches(&source.Kind{Type: &corev1.ConfigMap{}},
 			handler.EnqueueRequestsFromMapFunc(func(a ctrl.Object) []reconcile.Request {
 				cm, ok := a.(*corev1.ConfigMap)
diff --git a/pkg/trait/mount.go b/pkg/trait/mount.go
index eaf58a9c3..815d01f2e 100644
--- a/pkg/trait/mount.go
+++ b/pkg/trait/mount.go
@@ -116,7 +116,7 @@ func (t *mountTrait) Apply(e *Environment) error {
 		// Volumes declared in the Integration resources
 		e.configureVolumesAndMounts(volumes, &container.VolumeMounts)
 		// Volumes declared in the trait config/resource options
-		err := t.configureVolumesAndMounts(e, volumes, &container.VolumeMounts)
+		err := t.configureVolumesAndMounts(volumes, &container.VolumeMounts)
 		if err != nil {
 			return err
 		}
@@ -125,7 +125,7 @@ func (t *mountTrait) Apply(e *Environment) error {
 	return nil
 }
 
-func (t *mountTrait) configureVolumesAndMounts(e *Environment, vols *[]corev1.Volume, mnts *[]corev1.VolumeMount) error {
+func (t *mountTrait) configureVolumesAndMounts(vols *[]corev1.Volume, mnts *[]corev1.VolumeMount) error {
 	for _, c := range t.Configs {
 		if conf, parseErr := utilResource.ParseConfig(c); parseErr == nil {
 			t.mountResource(vols, mnts, conf)
diff --git a/pkg/util/digest/digest.go b/pkg/util/digest/digest.go
index ed5e8331d..4965aedd9 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"
 )
 
diff --git a/pkg/util/resource/config.go b/pkg/util/resource/config.go
index 8f52444ea..87fe5afba 100644
--- a/pkg/util/resource/config.go
+++ b/pkg/util/resource/config.go
@@ -18,7 +18,6 @@ limitations under the License.
 package resource
 
 import (
-	"crypto/sha1" // nolint: gosec
 	"fmt"
 	"regexp"
 	"strings"
@@ -175,13 +174,3 @@ func parse(item string, contentType ContentType) (*Config, error) {
 
 	return newConfig(cot, contentType, value), nil
 }
-
-func hashFrom(contents ...[]byte) string {
-	// SHA1 because we need to limit the length to less than 64 chars
-	hash := sha1.New() // nolint: gosec
-	for _, c := range contents {
-		hash.Write(c)
-	}
-
-	return fmt.Sprintf("%x", hash.Sum(nil))
-}