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 a757de4019af4b42120a870a5f251607b1b5e3aa
Author: Kuthumi Pepple <[email protected]>
AuthorDate: Fri Apr 1 16:22:07 2022 +0100

    fix: fix lint errors
---
 e2e/common/build/maven_http_proxy_test.go          |  5 ++--
 e2e/common/kustomize/operator_test.go              |  1 +
 e2e/common/kustomize/setup_test.go                 |  1 +
 e2e/common/traits/route_test.go                    |  6 ++---
 .../service_binding_kamelet_test.go                |  1 +
 e2e/support/test_support.go                        | 10 ++++----
 pkg/apis/camel/v1/zz_generated.defaults.go         |  1 +
 pkg/cmd/bind.go                                    |  4 +--
 pkg/cmd/debug.go                                   |  2 +-
 pkg/cmd/delete.go                                  |  8 +++---
 pkg/cmd/describe_kamelet.go                        |  2 +-
 pkg/cmd/describe_kit.go                            |  2 +-
 pkg/cmd/kamelet_delete.go                          |  2 +-
 pkg/cmd/kit_create.go                              |  8 +++---
 pkg/cmd/kit_delete.go                              |  2 +-
 pkg/cmd/log.go                                     |  2 +-
 pkg/cmd/modeline.go                                |  2 +-
 pkg/cmd/rebuild.go                                 |  2 +-
 pkg/cmd/reset.go                                   |  6 ++---
 pkg/cmd/run.go                                     |  6 ++---
 pkg/cmd/run_help.go                                |  6 ++---
 pkg/cmd/uninstall.go                               | 30 +++++++++++-----------
 pkg/cmd/util_commands.go                           |  2 +-
 pkg/cmd/util_containerization.go                   |  6 ++---
 pkg/cmd/util_dependencies.go                       |  4 +--
 pkg/cmd/util_sources.go                            |  2 +-
 pkg/cmd/version.go                                 |  4 +--
 pkg/util/tar/util_compress.go                      |  4 +--
 28 files changed, 66 insertions(+), 65 deletions(-)

diff --git a/e2e/common/build/maven_http_proxy_test.go 
b/e2e/common/build/maven_http_proxy_test.go
index 81b8099ed..9a6e35eb6 100644
--- a/e2e/common/build/maven_http_proxy_test.go
+++ b/e2e/common/build/maven_http_proxy_test.go
@@ -150,11 +150,11 @@ func TestMavenProxy(t *testing.T) {
                permission, pErr := kubernetes.CheckPermission(TestContext, 
TestClient(), configv1.GroupName, reflect.TypeOf(configv1.Proxy{}).Name(), "", 
"cluster", "edit")
                olmInstall := pErr == nil && olmErr == nil && inErr == nil && 
olm && installed && permission
                var defaultProxy configv1.Proxy
-               if olmInstall  {
+               if olmInstall {
                        // use OLM autoconfiguration
                        defaultProxy = configv1.Proxy{}
                        key := ctrl.ObjectKey{
-                               Name:      "cluster",
+                               Name: "cluster",
                        }
                        Expect(TestClient().Get(TestContext, key, 
&defaultProxy)).To(Succeed())
 
@@ -166,7 +166,6 @@ func TestMavenProxy(t *testing.T) {
                        // ENV values should be injected by the OLM
                        Expect(Kamel("install", "-n", 
ns).Execute()).To(Succeed())
 
-
                } else {
                        Expect(Kamel("install", "-n", ns,
                                "--operator-env-vars", 
fmt.Sprintf("HTTP_PROXY=http://%s";, hostname),
diff --git a/e2e/common/kustomize/operator_test.go 
b/e2e/common/kustomize/operator_test.go
index ff5a23163..423595cb2 100644
--- a/e2e/common/kustomize/operator_test.go
+++ b/e2e/common/kustomize/operator_test.go
@@ -1,3 +1,4 @@
+//go:build integration
 // +build integration
 
 // To enable compilation of this file in Goland, go to "Settings -> Go -> 
Vendoring & Build Tags -> Custom Tags" and add "integration"
diff --git a/e2e/common/kustomize/setup_test.go 
b/e2e/common/kustomize/setup_test.go
index 5f536d746..fb3c6b414 100644
--- a/e2e/common/kustomize/setup_test.go
+++ b/e2e/common/kustomize/setup_test.go
@@ -1,3 +1,4 @@
+//go:build integration
 // +build integration
 
 // To enable compilation of this file in Goland, go to "Settings -> Go -> 
Vendoring & Build Tags -> Custom Tags" and add "integration"
diff --git a/e2e/common/traits/route_test.go b/e2e/common/traits/route_test.go
index 8df86db0f..08050a1d8 100644
--- a/e2e/common/traits/route_test.go
+++ b/e2e/common/traits/route_test.go
@@ -49,11 +49,11 @@ import (
 )
 
 const (
-       secretName            = "test-certificate"
-       integrationName       = "platform-http-server"
+       secretName      = "test-certificate"
+       integrationName = "platform-http-server"
 )
 
-var waitBeforeHttpRequest = TestTimeoutShort/2
+var waitBeforeHttpRequest = TestTimeoutShort / 2
 
 type keyCertificatePair struct {
        Key         []byte
diff --git a/e2e/service-binding/service_binding_kamelet_test.go 
b/e2e/service-binding/service_binding_kamelet_test.go
index 390c376fc..cc7ba4d99 100644
--- a/e2e/service-binding/service_binding_kamelet_test.go
+++ b/e2e/service-binding/service_binding_kamelet_test.go
@@ -1,3 +1,4 @@
+//go:build integration
 // +build integration
 
 // To enable compilation of this file in Goland, go to "Settings -> Go -> 
Vendoring & Build Tags -> Custom Tags" and add "integration"
diff --git a/e2e/support/test_support.go b/e2e/support/test_support.go
index 83f566251..4f95e83bb 100644
--- a/e2e/support/test_support.go
+++ b/e2e/support/test_support.go
@@ -1693,7 +1693,7 @@ func NumPods(ns string) func() int {
 func WithNewTestNamespace(t *testing.T, doRun func(string)) {
        ns := NewTestNamespace(false)
        defer DeleteTestNamespace(t, ns)
-       defer UserCleanup()
+       defer UserCleanup(t)
 
        InvokeUserTestCode(t, ns.GetName(), doRun)
 }
@@ -1714,12 +1714,12 @@ func WithNewTestNamespaceWithKnativeBroker(t 
*testing.T, doRun func(string)) {
        ns := NewTestNamespace(true)
        defer DeleteTestNamespace(t, ns)
        defer DeleteKnativeBroker(ns)
-       defer UserCleanup()
+       defer UserCleanup(t)
 
        InvokeUserTestCode(t, ns.GetName(), doRun)
 }
 
-func UserCleanup() {
+func UserCleanup(t *testing.T) {
        userCmd := os.Getenv("KAMEL_TEST_CLEANUP")
        if userCmd != "" {
                fmt.Printf("Executing user cleanup command: %s\n", userCmd)
@@ -1728,9 +1728,9 @@ func UserCleanup() {
                command.Stderr = os.Stderr
                command.Stdout = os.Stdout
                if err := command.Run(); err != nil {
-                       fmt.Fprintf(command.Stderr, "An error occurred during 
user cleanup command execution: %v\n", err)
+                       t.Logf("An error occurred during user cleanup command 
execution: %v\n", err)
                } else {
-                       fmt.Fprintf(command.Stdout, "User cleanup command 
completed successfully\n")
+                       t.Logf("User cleanup command completed successfully\n")
                }
        }
 }
diff --git a/pkg/apis/camel/v1/zz_generated.defaults.go 
b/pkg/apis/camel/v1/zz_generated.defaults.go
index 0b0c84e4a..88694caac 100644
--- a/pkg/apis/camel/v1/zz_generated.defaults.go
+++ b/pkg/apis/camel/v1/zz_generated.defaults.go
@@ -1,3 +1,4 @@
+//go:build !ignore_autogenerated
 // +build !ignore_autogenerated
 
 // Code generated by defaulter-gen. DO NOT EDIT.
diff --git a/pkg/cmd/bind.go b/pkg/cmd/bind.go
index c5f1a0f01..0b011ef77 100644
--- a/pkg/cmd/bind.go
+++ b/pkg/cmd/bind.go
@@ -219,9 +219,9 @@ func (o *bindCmdOptions) run(cmd *cobra.Command, args 
[]string) error {
        }
 
        if !existed {
-               fmt.Fprintf(cmd.OutOrStdout(), "kamelet binding \"%s\" 
created\n", name)
+               fmt.Fprintln(cmd.OutOrStdout(), `kamelet binding "`+name+`" 
created`)
        } else {
-               fmt.Fprintf(cmd.OutOrStdout(), "kamelet binding \"%s\" 
updated\n", name)
+               fmt.Fprintln(cmd.OutOrStdout(), `kamelet binding "`+name+`" 
updated`)
        }
        return nil
 }
diff --git a/pkg/cmd/debug.go b/pkg/cmd/debug.go
index 06986c931..209927241 100644
--- a/pkg/cmd/debug.go
+++ b/pkg/cmd/debug.go
@@ -100,7 +100,7 @@ func (o *debugCmdOptions) run(cmd *cobra.Command, args 
[]string) error {
                        // Context canceled
                        return
                }
-               fmt.Fprintf(cmd.OutOrStdout(), "Disabling debug mode on 
integration %q\n", name)
+               fmt.Fprintln(cmd.OutOrStdout(), `Disabling debug mode on 
integration "`+name+`"`)
                it, err := c.Integrations(o.Namespace).Get(o.Context, name, 
metav1.GetOptions{})
                if err != nil {
                        fmt.Fprintln(cmd.ErrOrStderr(), err.Error())
diff --git a/pkg/cmd/delete.go b/pkg/cmd/delete.go
index 509fc4bbe..2fd5aa347 100644
--- a/pkg/cmd/delete.go
+++ b/pkg/cmd/delete.go
@@ -91,7 +91,7 @@ func (command *deleteCmdOptions) run(cmd *cobra.Command, args 
[]string) error {
                                        return err
                                }
                        } else {
-                               err := deleteIntegration(cmd, command.Context, 
c, integration)
+                               err := deleteIntegration(command.Context, cmd, 
c, integration)
                                if err != nil {
                                        return err
                                }
@@ -112,7 +112,7 @@ func (command *deleteCmdOptions) run(cmd *cobra.Command, 
args []string) error {
                }
                for _, integration := range integrationList.Items {
                        integration := integration // pin
-                       err := deleteIntegration(cmd, command.Context, c, 
&integration)
+                       err := deleteIntegration(command.Context, cmd, c, 
&integration)
                        if err != nil {
                                return err
                        }
@@ -139,14 +139,14 @@ func getIntegration(ctx context.Context, c client.Client, 
name string, namespace
        return &answer, nil
 }
 
-func deleteIntegration(cmd *cobra.Command, ctx context.Context, c 
client.Client, integration *v1.Integration) error {
+func deleteIntegration(ctx context.Context, cmd *cobra.Command, c 
client.Client, integration *v1.Integration) error {
        deleted, binding, err := deleteKameletBindingIfExists(ctx, c, 
integration)
        if err != nil {
                return err
        }
        if deleted {
                // Deleting KameletBinding will automatically clean up the 
integration
-               fmt.Fprintln(cmd.OutOrStdout(),"KameletBinding " + binding + " 
deleted")
+               fmt.Fprintln(cmd.OutOrStdout(), "KameletBinding "+binding+" 
deleted")
                return nil
        }
        return c.Delete(ctx, integration)
diff --git a/pkg/cmd/describe_kamelet.go b/pkg/cmd/describe_kamelet.go
index 4edb8ff54..30a37d391 100644
--- a/pkg/cmd/describe_kamelet.go
+++ b/pkg/cmd/describe_kamelet.go
@@ -87,7 +87,7 @@ func (command *describeKameletCommandOptions) run(cmd 
*cobra.Command, args []str
                        fmt.Fprintln(cmd.ErrOrStderr(), err)
                }
        } else {
-               fmt.Fprintf(cmd.OutOrStdout(), "Kamelet '%s' does not 
exist.\n", args[0])
+               fmt.Fprintln(cmd.OutOrStdout(), "Kamelet '"+args[0]+"' does not 
exist.")
        }
 
        return nil
diff --git a/pkg/cmd/describe_kit.go b/pkg/cmd/describe_kit.go
index ff40aea09..0492bf496 100644
--- a/pkg/cmd/describe_kit.go
+++ b/pkg/cmd/describe_kit.go
@@ -86,7 +86,7 @@ func (command *describeKitCommandOptions) run(cmd 
*cobra.Command, args []string)
                        fmt.Fprintln(cmd.ErrOrStderr(), err)
                }
        } else {
-               fmt.Fprintf(cmd.OutOrStdout(), "IntegrationKit '%s' does not 
exist.\n", args[0])
+               fmt.Fprintln(cmd.OutOrStdout(), "IntegrationKit '"+args[0]+"' 
does not exist")
        }
 
        return nil
diff --git a/pkg/cmd/kamelet_delete.go b/pkg/cmd/kamelet_delete.go
index 38a070fa8..36fcc049c 100644
--- a/pkg/cmd/kamelet_delete.go
+++ b/pkg/cmd/kamelet_delete.go
@@ -139,6 +139,6 @@ func (command *kameletDeleteCommandOptions) delete(cmd 
*cobra.Command, name stri
                }
                return fmt.Errorf("error deleting kamelet \"%s\": %w", name, 
err)
        }
-       fmt.Fprintf(cmd.OutOrStdout(), "kamelet \"%s\" has been deleted\n", 
name)
+       fmt.Fprintln(cmd.OutOrStdout(), `kamelet "`+name+`" has been deleted`)
        return nil
 }
diff --git a/pkg/cmd/kit_create.go b/pkg/cmd/kit_create.go
index 3b295843f..146a96282 100644
--- a/pkg/cmd/kit_create.go
+++ b/pkg/cmd/kit_create.go
@@ -94,7 +94,7 @@ func (command *kitCreateCommandOptions) run(cmd 
*cobra.Command, args []string) e
                kv := strings.SplitN(t, "=", 2)
 
                if !util.StringSliceExists(tp, kv[0]) {
-                       fmt.Fprintf(cmd.OutOrStdout(), "Error: %s is not a 
valid trait property\n", t)
+                       fmt.Fprintln(cmd.OutOrStdout(), "Error:", t, "is not a 
valid trait property")
                        return nil
                }
        }
@@ -109,7 +109,7 @@ func (command *kitCreateCommandOptions) run(cmd 
*cobra.Command, args []string) e
                // not a platform one which is supposed to be "read only"
 
                if kit.Labels[v1.IntegrationKitTypeLabel] == 
v1.IntegrationKitTypePlatform {
-                       fmt.Fprintf(cmd.OutOrStdout(), "integration kit \"%s\" 
is not editable\n", kit.Name)
+                       fmt.Fprintln(cmd.OutOrStdout(), `integration kit 
"`+kit.Name+`" is not editable`)
                        return nil
                }
        }
@@ -188,9 +188,9 @@ func (command *kitCreateCommandOptions) run(cmd 
*cobra.Command, args []string) e
        }
 
        if !existed {
-               fmt.Fprintf(cmd.OutOrStdout(), "integration kit \"%s\" 
created\n", kit.Name)
+               fmt.Fprintln(cmd.OutOrStdout(), `integration kit "`+kit.Name+`" 
created`)
        } else {
-               fmt.Fprintf(cmd.OutOrStdout(), "integration kit \"%s\" 
updated\n", kit.Name)
+               fmt.Fprintln(cmd.OutOrStdout(), `integration kit "`+kit.Name+`" 
updated`)
        }
 
        return nil
diff --git a/pkg/cmd/kit_delete.go b/pkg/cmd/kit_delete.go
index 5999ec781..ec1c5ebd1 100644
--- a/pkg/cmd/kit_delete.go
+++ b/pkg/cmd/kit_delete.go
@@ -144,7 +144,7 @@ func (command *kitDeleteCommandOptions) delete(cmd 
*cobra.Command, name string)
                return fmt.Errorf("no integration kit found with name \"%s\"", 
kit.Name)
        }
 
-       fmt.Fprintf(cmd.OutOrStdout(), "integration kit \"%s\" has been 
deleted\n", kit.Name)
+       fmt.Fprintln(cmd.OutOrStdout(), `integration kit "`+kit.Name+`" has 
been deleted`)
 
        return err
 }
diff --git a/pkg/cmd/log.go b/pkg/cmd/log.go
index ceeeeb420..bfa82910c 100644
--- a/pkg/cmd/log.go
+++ b/pkg/cmd/log.go
@@ -128,7 +128,7 @@ func (o *logCmdOptions) run(cmd *cobra.Command, args 
[]string) error {
                        //
                        // Found the running integration so step over to 
scraping its pod log
                        //
-                       fmt.Fprintf(cmd.OutOrStdout(), "Integration '%s' is now 
running. Showing log ...\n", integrationID)
+                       fmt.Fprintln(cmd.OutOrStdout(), "Integration 
'"+integrationID+"' is now running. Showing log ...")
                        if err := k8slog.Print(o.Context, cmd, c, &integration, 
cmd.OutOrStdout()); err != nil {
                                return false, err
                        }
diff --git a/pkg/cmd/modeline.go b/pkg/cmd/modeline.go
index 25205dc25..5f16e1819 100644
--- a/pkg/cmd/modeline.go
+++ b/pkg/cmd/modeline.go
@@ -71,7 +71,7 @@ func NewKamelWithModelineCommand(ctx context.Context, osArgs 
[]string) (*cobra.C
        originalFlags := osArgs[1:]
        rootCmd, flags, err := createKamelWithModelineCommand(ctx, 
originalFlags)
        if err != nil {
-               fmt.Fprintf(rootCmd.ErrOrStderr(), "Error: %s\n", err.Error())
+               fmt.Fprintln(rootCmd.ErrOrStderr(), "Error:", err.Error())
                return rootCmd, flags, err
        }
        if len(originalFlags) != len(flags) {
diff --git a/pkg/cmd/rebuild.go b/pkg/cmd/rebuild.go
index e9f5f8b0c..7ea427923 100644
--- a/pkg/cmd/rebuild.go
+++ b/pkg/cmd/rebuild.go
@@ -69,7 +69,7 @@ func (o *rebuildCmdOptions) rebuild(cmd *cobra.Command, args 
[]string) error {
                return err
        }
 
-       fmt.Fprintf(cmd.OutOrStdout(),"%d integrations have been rebuilt\n", 
len(integrations))
+       fmt.Fprintln(cmd.OutOrStdout(), len(integrations), "integrations have 
been rebuilt")
        return nil
 }
 
diff --git a/pkg/cmd/reset.go b/pkg/cmd/reset.go
index 22239e621..562652bcd 100644
--- a/pkg/cmd/reset.go
+++ b/pkg/cmd/reset.go
@@ -67,7 +67,7 @@ func (o *resetCmdOptions) reset(cmd *cobra.Command, _ 
[]string) {
                        fmt.Fprint(cmd.ErrOrStderr(), err)
                        return
                }
-               fmt.Fprintf(cmd.OutOrStdout(), "%d kamelet bindings deleted 
from namespace %s\n", n, o.Namespace)
+               fmt.Fprintln(cmd.OutOrStdout(), n, "kamelet bindings deleted 
from namespace", o.Namespace)
        }
 
        if !o.SkipIntegrations {
@@ -75,7 +75,7 @@ func (o *resetCmdOptions) reset(cmd *cobra.Command, _ 
[]string) {
                        fmt.Fprint(cmd.ErrOrStderr(), err)
                        return
                }
-               fmt.Fprintf(cmd.OutOrStdout(), "%d integrations deleted from 
namespace %s\n", n, o.Namespace)
+               fmt.Fprintln(cmd.OutOrStdout(), n, "integrations deleted from 
namespace", o.Namespace)
        }
 
        if !o.SkipKits {
@@ -83,7 +83,7 @@ func (o *resetCmdOptions) reset(cmd *cobra.Command, _ 
[]string) {
                        fmt.Fprint(cmd.ErrOrStderr(), err)
                        return
                }
-               fmt.Fprintf(cmd.OutOrStdout(), "%d integration kits deleted 
from namespace %s\n", n, o.Namespace)
+               fmt.Fprintln(cmd.OutOrStdout(), n, "integration kits deleted 
from namespace", o.Namespace)
        }
 
        if err = o.resetIntegrationPlatform(c); err != nil {
diff --git a/pkg/cmd/run.go b/pkg/cmd/run.go
index 37592b856..4f6a73612 100644
--- a/pkg/cmd/run.go
+++ b/pkg/cmd/run.go
@@ -287,7 +287,7 @@ func (o *runCmdOptions) run(cmd *cobra.Command, args 
[]string) error {
                                // Context canceled
                                return
                        }
-                       fmt.Fprintf(cmd.OutOrStdout(), "Run integration 
terminating\n")
+                       fmt.Fprintln(cmd.OutOrStdout(), "Run integration 
terminating")
                        err := DeleteIntegration(o.Context, c, 
integration.Name, integration.Namespace)
                        if err != nil {
                                fmt.Fprintln(cmd.ErrOrStderr(), err)
@@ -615,10 +615,10 @@ func (o *runCmdOptions) createOrUpdateIntegration(cmd 
*cobra.Command, c client.C
 
        if existing == nil {
                err = c.Create(o.Context, integration)
-               fmt.Fprintf(cmd.OutOrStdout(), "Integration \"%s\" created\n", 
name)
+               fmt.Fprintln(cmd.OutOrStdout(), `Integration "`+name+`" 
created`)
        } else {
                err = c.Patch(o.Context, integration, 
ctrl.MergeFromWithOptions(existing, ctrl.MergeFromWithOptimisticLock{}))
-               fmt.Fprintf(cmd.OutOrStdout(), "Integration \"%s\" updated\n", 
name)
+               fmt.Fprintln(cmd.OutOrStdout(), `Integration "`+name+`" 
updated`)
        }
 
        if err != nil {
diff --git a/pkg/cmd/run_help.go b/pkg/cmd/run_help.go
index da91f36f3..c2d54a011 100644
--- a/pkg/cmd/run_help.go
+++ b/pkg/cmd/run_help.go
@@ -49,16 +49,14 @@ func parseConfigAndGenCm(ctx context.Context, cmd 
*cobra.Command, c client.Clien
        case resource.StorageTypeConfigmap:
                cm := kubernetes.LookupConfigmap(ctx, c, integration.Namespace, 
config.Name())
                if cm == nil {
-                       fmt.Fprintf(cmd.ErrOrStderr(), "Warn: %s Configmap not 
found in %s namespace, make sure to provide it before the Integration can 
run\n",
-                               config.Name(), integration.Namespace)
+                       fmt.Fprintln(cmd.ErrOrStderr(), "Warn:", config.Name(), 
"Configmap not found in", integration.Namespace, "namespace, make sure to 
provide it before the Integration can run")
                } else if config.ContentType() != resource.ContentTypeData && 
cm.BinaryData != nil {
                        return nil, fmt.Errorf("you cannot provide a binary 
config, use a text file instead")
                }
        case resource.StorageTypeSecret:
                secret := kubernetes.LookupSecret(ctx, c, 
integration.Namespace, config.Name())
                if secret == nil {
-                       fmt.Fprintf(cmd.ErrOrStderr(), "Warn: %s Secret not 
found in %s namespace, make sure to provide it before the Integration can 
run\n",
-                               config.Name(), integration.Namespace)
+                       fmt.Fprintln(cmd.ErrOrStderr(), "Warn:", config.Name(), 
"Secret not found in", integration.Namespace, "namespace, make sure to provide 
it before the Integration can run")
                }
        case resource.StorageTypeFile:
                // Don't allow a binary non compressed resource
diff --git a/pkg/cmd/uninstall.go b/pkg/cmd/uninstall.go
index c68ecb036..34ace318f 100644
--- a/pkg/cmd/uninstall.go
+++ b/pkg/cmd/uninstall.go
@@ -143,7 +143,7 @@ func (o *uninstallCmdOptions) uninstall(cmd *cobra.Command, 
_ []string) error {
                fmt.Fprintf(cmd.OutOrStdout(), "Camel K Integration Platform 
removed from namespace %s\n", o.Namespace)
        }
 
-       if err = o.uninstallNamespaceResources(cmd, o.Context, c); err != nil {
+       if err = o.uninstallNamespaceResources(o.Context, cmd, c); err != nil {
                return err
        }
 
@@ -155,11 +155,11 @@ func (o *uninstallCmdOptions) uninstall(cmd 
*cobra.Command, _ []string) error {
                        fmt.Fprintf(cmd.OutOrStdout(), "Camel K Operator 
removed from namespace %s\n", o.Namespace)
                }
 
-               if err = o.uninstallNamespaceRoles(cmd, o.Context, c); err != 
nil {
+               if err = o.uninstallNamespaceRoles(o.Context, cmd, c); err != 
nil {
                        return err
                }
 
-               if err = o.uninstallClusterWideResources(cmd, o.Context, c, 
o.Namespace); err != nil {
+               if err = o.uninstallClusterWideResources(o.Context, cmd, c, 
o.Namespace); err != nil {
                        return err
                }
 
@@ -186,7 +186,7 @@ func (o *uninstallCmdOptions) uninstallOperator(ctx 
context.Context, c client.Cl
        return nil
 }
 
-func (o *uninstallCmdOptions) uninstallClusterWideResources(cmd 
*cobra.Command, ctx context.Context, c client.Client, namespace string) error {
+func (o *uninstallCmdOptions) uninstallClusterWideResources(ctx 
context.Context, cmd *cobra.Command, c client.Client, namespace string) error {
        if !o.SkipCrd || o.UninstallAll {
                if err := o.uninstallCrd(ctx, c); err != nil {
                        if k8serrors.IsForbidden(err) {
@@ -194,7 +194,7 @@ func (o *uninstallCmdOptions) 
uninstallClusterWideResources(cmd *cobra.Command,
                        }
                        return err
                }
-               fmt.Fprintf(cmd.OutOrStdout(), "Camel K Custom Resource 
Definitions removed from cluster\n")
+               fmt.Fprintln(cmd.OutOrStdout(), "Camel K Custom Resource 
Definitions removed from cluster")
        }
 
        if err := o.removeSubjectFromClusterRoleBindings(ctx, c, namespace); 
err != nil {
@@ -213,7 +213,7 @@ func (o *uninstallCmdOptions) 
uninstallClusterWideResources(cmd *cobra.Command,
                        }
                        return err
                }
-               fmt.Fprintf(cmd.OutOrStdout(), "Camel K Cluster Role Bindings 
removed from cluster\n")
+               fmt.Fprintln(cmd.OutOrStdout(), "Camel K Cluster Role Bindings 
removed from cluster")
        }
 
        if !o.SkipClusterRoles || o.UninstallAll {
@@ -223,57 +223,57 @@ func (o *uninstallCmdOptions) 
uninstallClusterWideResources(cmd *cobra.Command,
                        }
                        return err
                }
-               fmt.Fprintf(cmd.OutOrStdout(), "Camel K Cluster Roles removed 
from cluster\n")
+               fmt.Fprintln(cmd.OutOrStdout(), "Camel K Cluster Roles removed 
from cluster")
        }
 
        return nil
 }
 
-func (o *uninstallCmdOptions) uninstallNamespaceRoles(cmd *cobra.Command, ctx 
context.Context, c client.Client) error {
+func (o *uninstallCmdOptions) uninstallNamespaceRoles(ctx context.Context, cmd 
*cobra.Command, c client.Client) error {
        if !o.SkipRoleBindings {
                if err := o.uninstallRoleBindings(ctx, c); err != nil {
                        return err
                }
-               fmt.Fprintf(cmd.OutOrStdout(), "Camel K Role Bindings removed 
from namespace %s\n", o.Namespace)
+               fmt.Fprintln(cmd.OutOrStdout(), "Camel K Role Bindings removed 
from namespace", o.Namespace)
        }
 
        if !o.SkipRoles {
                if err := o.uninstallRoles(ctx, c); err != nil {
                        return err
                }
-               fmt.Fprintf(cmd.OutOrStdout(), "Camel K Roles removed from 
namespace %s\n", o.Namespace)
+               fmt.Fprintln(cmd.OutOrStdout(), "Camel K Roles removed from 
namespace", o.Namespace)
        }
 
        if !o.SkipServiceAccounts {
                if err := o.uninstallServiceAccounts(ctx, c); err != nil {
                        return err
                }
-               fmt.Fprintf(cmd.OutOrStdout(), "Camel K Service Accounts 
removed from namespace %s\n", o.Namespace)
+               fmt.Fprintln(cmd.OutOrStdout(), "Camel K Service Accounts 
removed from namespace", o.Namespace)
        }
 
        return nil
 }
 
-func (o *uninstallCmdOptions) uninstallNamespaceResources(cmd *cobra.Command, 
ctx context.Context, c client.Client) error {
+func (o *uninstallCmdOptions) uninstallNamespaceResources(ctx context.Context, 
cmd *cobra.Command, c client.Client) error {
        if !o.SkipConfigMaps {
                if err := o.uninstallConfigMaps(ctx, c); err != nil {
                        return err
                }
-               fmt.Fprintf(cmd.OutOrStdout(), "Camel K Config Maps removed 
from namespace %s\n", o.Namespace)
+               fmt.Fprintln(cmd.OutOrStdout(), "Camel K Config Maps removed 
from namespace", o.Namespace)
        }
 
        if !o.SkipRegistrySecret {
                if err := o.uninstallRegistrySecret(ctx, c); err != nil {
                        return err
                }
-               fmt.Fprintf(cmd.OutOrStdout(), "Camel K Registry Secret removed 
from namespace %s\n", o.Namespace)
+               fmt.Fprintln(cmd.OutOrStdout(), "Camel K Registry Secret 
removed from namespace", o.Namespace)
        }
 
        if !o.SkipKamelets {
                if err := o.uninstallKamelets(ctx, c); err != nil {
                        return err
                }
-               fmt.Fprintf(cmd.OutOrStdout(), "Camel K platform Kamelets 
removed from namespace %s\n", o.Namespace)
+               fmt.Fprintln(cmd.OutOrStdout(), "Camel K platform Kamelets 
removed from namespace", o.Namespace)
        }
 
        return nil
diff --git a/pkg/cmd/util_commands.go b/pkg/cmd/util_commands.go
index 3ef33a477..794f49e33 100644
--- a/pkg/cmd/util_commands.go
+++ b/pkg/cmd/util_commands.go
@@ -108,7 +108,7 @@ func RunLocalIntegrationRunCommand(ctx context.Context, 
properties []string, dep
        }
 
        // Output command we are about to run.
-       fmt.Fprintf(cmd.Stdout, "Executing: %s\n", strings.Join(cmd.Args, " "))
+       fmt.Fprintln(cmd.Stdout, "Executing:", strings.Join(cmd.Args, " "))
 
        // Run integration locally.
        err = cmd.Run()
diff --git a/pkg/cmd/util_containerization.go b/pkg/cmd/util_containerization.go
index c5a637efe..ec1c2e932 100644
--- a/pkg/cmd/util_containerization.go
+++ b/pkg/cmd/util_containerization.go
@@ -99,7 +99,7 @@ func createAndBuildBaseImage(ctx context.Context, stdout, 
stderr io.Writer) erro
        cmd.Stderr = stderr
 
        // Output executed command.
-       fmt.Fprintf(cmd.Stdout, "Executing: %s\n", strings.Join(cmd.Args, " "))
+       fmt.Fprintln(cmd.Stdout, "Executing:", strings.Join(cmd.Args, " "))
 
        // Run the command.
        if err := cmd.Run(); err != nil {
@@ -196,7 +196,7 @@ func createAndBuildIntegrationImage(ctx context.Context, 
containerRegistry strin
        cmd.Stdout = stdout
 
        // Output executed command.
-       fmt.Fprintf(cmd.Stdout, "Executing: %s\n", strings.Join(cmd.Args, " "))
+       fmt.Fprintln(cmd.Stdout, "Executing:", strings.Join(cmd.Args, " "))
 
        // Run the command.
        if err := cmd.Run(); err != nil {
@@ -229,7 +229,7 @@ func runIntegrationImage(ctx context.Context, image string, 
stdout, stderr io.Wr
        cmd.Stdout = stdout
 
        // Output executed command.
-       fmt.Fprintf(cmd.Stdout, "Executing: %s\n", strings.Join(cmd.Args, " "))
+       fmt.Fprintln(cmd.Stdout, "Executing:", strings.Join(cmd.Args, " "))
 
        // Run the command.
        if err := cmd.Run(); err != nil {
diff --git a/pkg/cmd/util_dependencies.go b/pkg/cmd/util_dependencies.go
index 8110caff3..5a9c865ff 100644
--- a/pkg/cmd/util_dependencies.go
+++ b/pkg/cmd/util_dependencies.go
@@ -241,7 +241,7 @@ func outputDependencies(dependencies []string, format 
string, cmd *cobra.Command
                // Print output in text form
                fmt.Fprintln(cmd.OutOrStdout(), "dependencies:")
                for _, dep := range dependencies {
-                       fmt.Fprintf(cmd.OutOrStdout(), "%v\n", dep)
+                       fmt.Fprintln(cmd.OutOrStdout(), dep)
                }
        }
 
@@ -261,7 +261,7 @@ func printDependencies(format string, dependencies 
[]string, cmd *cobra.Command)
                if err != nil {
                        return err
                }
-               fmt.Fprint(cmd.OutOrStdout(),string(data))
+               fmt.Fprint(cmd.OutOrStdout(), string(data))
        default:
                return errors.New("unknown output format: " + format)
        }
diff --git a/pkg/cmd/util_sources.go b/pkg/cmd/util_sources.go
index 388a93f02..991bf9eab 100644
--- a/pkg/cmd/util_sources.go
+++ b/pkg/cmd/util_sources.go
@@ -91,7 +91,7 @@ func ResolveSources(ctx context.Context, locations []string, 
compress bool, cmd
                                        ts := 
oauth2.StaticTokenSource(&oauth2.Token{AccessToken: token})
                                        tc = oauth2.NewClient(ctx, ts)
 
-                                       
fmt.Fprintln(cmd.OutOrStdout(),"GITHUB_TOKEN env var detected, using it for 
GitHub APIs authentication")
+                                       fmt.Fprintln(cmd.OutOrStdout(), 
"GITHUB_TOKEN env var detected, using it for GitHub APIs authentication")
                                }
 
                                gc := github.NewClient(tc)
diff --git a/pkg/cmd/version.go b/pkg/cmd/version.go
index 309d84dd1..011d6eddb 100644
--- a/pkg/cmd/version.go
+++ b/pkg/cmd/version.go
@@ -174,12 +174,12 @@ func operatorVersion(ctx context.Context, c 
client.Client, namespace string) (st
 func compatibleVersions(aVersion, bVersion string, cmd *cobra.Command) bool {
        a, err := semver.NewVersion(aVersion)
        if err != nil {
-               fmt.Fprintf(cmd.ErrOrStderr(), "Could not parse %s (error: 
%s)\n", a, err)
+               fmt.Fprintln(cmd.ErrOrStderr(), "Could not parse '"+aVersion+"' 
(error:", err.Error()+")")
                return false
        }
        b, err := semver.NewVersion(bVersion)
        if err != nil {
-               fmt.Fprintf(cmd.ErrOrStderr(), "Could not parse %s (error: 
%s)\n", b, err)
+               fmt.Fprintln(cmd.ErrOrStderr(), "Could not parse '"+bVersion+"' 
(error:", err.Error()+")")
                return false
        }
        // We consider compatible when major and minor are equals
diff --git a/pkg/util/tar/util_compress.go b/pkg/util/tar/util_compress.go
index 136f6fcb7..3388d124a 100644
--- a/pkg/util/tar/util_compress.go
+++ b/pkg/util/tar/util_compress.go
@@ -30,13 +30,13 @@ import (
 func CreateTarFile(fileNames []string, archiveName string, cmd *cobra.Command) 
{
        out, err := os.Create(archiveName)
        if err != nil {
-               fmt.Fprintf(cmd.ErrOrStderr(), "Error writing archive: %v", err)
+               fmt.Fprintln(cmd.ErrOrStderr(), "Error writing archive:", 
err.Error())
        }
        defer out.Close()
 
        err = createArchiveFile(fileNames, out)
        if err != nil {
-               fmt.Fprintf(cmd.ErrOrStderr(), "Error writing archive: %v", err)
+               fmt.Fprintln(cmd.ErrOrStderr(), "Error writing archive:", 
err.Error())
        }
 }
 

Reply via email to