You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by as...@apache.org on 2021/11/24 12:53:00 UTC

[camel-k] 12/19: fix(lint): use interface when possible

This is an automated email from the ASF dual-hosted git repository.

astefanutti pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit 11e3f6439a38dde1c6c77ab46c210249e78712d0
Author: Luca Burgazzoli <lb...@gmail.com>
AuthorDate: Mon Nov 22 23:31:26 2021 +0100

    fix(lint): use interface when possible
---
 pkg/builder/spectrum.go    | 3 ++-
 pkg/cmd/bind.go            | 2 +-
 pkg/cmd/debug.go           | 2 +-
 pkg/cmd/util_content.go    | 2 +-
 pkg/resources/resources.go | 4 ++--
 pkg/util/olm/operator.go   | 4 +++-
 6 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/pkg/builder/spectrum.go b/pkg/builder/spectrum.go
index bb5bfb1..9202e70 100644
--- a/pkg/builder/spectrum.go
+++ b/pkg/builder/spectrum.go
@@ -21,6 +21,7 @@ import (
 	"bufio"
 	"context"
 	"go.uber.org/multierr"
+	"io"
 	"io/ioutil"
 	"os"
 	"path"
@@ -138,7 +139,7 @@ func (t *spectrumTask) Do(ctx context.Context) v1.BuildStatus {
 	return status
 }
 
-func readSpectrumLogs(newStdOut *os.File) {
+func readSpectrumLogs(newStdOut io.Reader) {
 	scanner := bufio.NewScanner(newStdOut)
 
 	for scanner.Scan() {
diff --git a/pkg/cmd/bind.go b/pkg/cmd/bind.go
index 0a1b36e..355f00d 100644
--- a/pkg/cmd/bind.go
+++ b/pkg/cmd/bind.go
@@ -220,7 +220,7 @@ func (o *bindCmdOptions) run(cmd *cobra.Command, args []string) error {
 	return nil
 }
 
-func showOutput(cmd *cobra.Command, binding *v1alpha1.KameletBinding, outputFormat string, scheme *runtime.Scheme) error {
+func showOutput(cmd *cobra.Command, binding *v1alpha1.KameletBinding, outputFormat string, scheme runtime.ObjectTyper) error {
 	printer := printers.NewTypeSetter(scheme)
 	printer.Delegate = &kubernetes.CLIPrinter{
 		Format: outputFormat,
diff --git a/pkg/cmd/debug.go b/pkg/cmd/debug.go
index fd3c3a7..e0702c4 100644
--- a/pkg/cmd/debug.go
+++ b/pkg/cmd/debug.go
@@ -132,7 +132,7 @@ func (o *debugCmdOptions) run(cmd *cobra.Command, args []string) error {
 }
 
 // nolint: unparam
-func (o *debugCmdOptions) toggleDebug(c *camelv1.CamelV1Client, it *v1.Integration, active bool) (*v1.Integration, error) {
+func (o *debugCmdOptions) toggleDebug(c camelv1.IntegrationsGetter, it *v1.Integration, active bool) (*v1.Integration, error) {
 	if it.Spec.Traits == nil {
 		it.Spec.Traits = make(map[string]v1.TraitSpec)
 	}
diff --git a/pkg/cmd/util_content.go b/pkg/cmd/util_content.go
index 9611ae1..0d73610 100644
--- a/pkg/cmd/util_content.go
+++ b/pkg/cmd/util_content.go
@@ -99,7 +99,7 @@ func loadTextContent(source string, base64Compression bool) (string, string, boo
 	return string(content), contentType, false, nil
 }
 
-func loadContentHTTP(u *url.URL) ([]byte, error) {
+func loadContentHTTP(u fmt.Stringer) ([]byte, error) {
 	resp, err := http.Get(u.String())
 	if err != nil {
 		return []byte{}, err
diff --git a/pkg/resources/resources.go b/pkg/resources/resources.go
index f486ed7..c285994 100644
--- a/pkg/resources/resources.go
+++ b/pkg/resources/resources.go
@@ -138,9 +138,9 @@ var assets = func() http.FileSystem {
 		"/crd/bases/camel.apache.org_integrationplatforms.yaml": &vfsgen۰CompressedFileInfo{
 			name:             "camel.apache.org_integrationplatforms.yaml",
 			modTime:          time.Time{},
-			uncompressedSize: 25962,
+			uncompressedSize: 26080,
 
-			compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x5c\xdf\x93\xe2\xb8\xf1\x7f\xe7\xaf\xe8\x5a\x1e\xf6\xae\x6a\x30\x77\xdf\x6f\x52\x49\xc8\x43\x8a\x63\x77\x2b\x64\x76\x67\xa8\x81\xbd\xcb\x3d\x0a\xbb\x01\x1d\xb2\xe4\x48\xf2\xb0\x5c\x2a\xff\x7b\xaa\x25\x1b\xec\xc1\xbf\x98\x99\xab\x24\x77\xd6\xcb\xee\x60\xa9\xd5\xdd\xea\x9f\xf2\x07\x86\x30\x7a\xbd\x31\x18\xc2\x47\x1e\xa2\x34\x18\x81\x55\x60\x77\x08\xd3\x84\x85\x3b\x84\xa5\xda\xd8\x03\xd3\x08\x1f\x54\x2a\x23\x66\xb9\x [...]
+			compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x3c\x4b\x93\xe3\xb6\xd1\x77\xfd\x8a\xae\xd5\x61\xed\xaa\x11\x65\x7f\x8f\x4a\xa2\x1c\x52\xb2\x76\xb7\xa2\xec\xee\xcc\xd4\x4a\x6b\xc7\x47\x88\x6c\x49\xb0\x48\x80\x01\xc0\xd1\xca\xa9\xfc\xf7\x54\x37\x48\x89\x1a\xf1\xa5\x99\x71\x25\xb6\x89\xcb\x8c\x44\xa0\xd1\xef\x07\xd0\xe2\x10\x46\x2f\x37\x06\x43\xf8\x20\x43\x54\x16\x23\x70\x1a\xdc\x16\x61\x9a\x8a\x70\x8b\xb0\xd0\x6b\xb7\x17\x06\xe1\x9d\xce\x54\x24\x9c\xd4\x0a\xbe\x [...]
 		},
 		"/crd/bases/camel.apache.org_integrations.yaml": &vfsgen۰CompressedFileInfo{
 			name:             "camel.apache.org_integrations.yaml",
diff --git a/pkg/util/olm/operator.go b/pkg/util/olm/operator.go
index 23ca3fd..9028dc6 100644
--- a/pkg/util/olm/operator.go
+++ b/pkg/util/olm/operator.go
@@ -27,6 +27,8 @@ import (
 	v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 	"k8s.io/kubectl/pkg/cmd/set/env"
 
+	k8sclient "k8s.io/client-go/kubernetes"
+
 	runtime "sigs.k8s.io/controller-runtime/pkg/client"
 
 	operatorsv1 "github.com/operator-framework/api/pkg/operators/v1"
@@ -344,7 +346,7 @@ func findOperatorGroup(ctx context.Context, client client.Client, namespace stri
 	return nil, nil
 }
 
-func fillDefaults(o Options, client client.Client) (Options, error) {
+func fillDefaults(o Options, client k8sclient.Interface) (Options, error) {
 	if o.OperatorName == "" {
 		o.OperatorName = DefaultOperatorName
 	}