KuthumiPepple commented on a change in pull request #3153:
URL: https://github.com/apache/camel-k/pull/3153#discussion_r839031769



##########
File path: pkg/cmd/uninstall.go
##########
@@ -209,71 +209,71 @@ func (o *uninstallCmdOptions) 
uninstallClusterWideResources(ctx context.Context,
        if !o.SkipClusterRoleBindings || o.UninstallAll {
                if err := o.uninstallClusterRoleBindings(ctx, c); err != nil {
                        if k8serrors.IsForbidden(err) {
-                               return createActionNotAuthorizedError()
+                               return createActionNotAuthorizedError(cmd)
                        }
                        return err
                }
-               fmt.Printf("Camel K Cluster Role Bindings removed from 
cluster\n")
+               fmt.Fprintf(cmd.OutOrStdout(), "Camel K Cluster Role Bindings 
removed from cluster\n")
        }
 
        if !o.SkipClusterRoles || o.UninstallAll {
                if err := o.uninstallClusterRoles(ctx, c); err != nil {
                        if k8serrors.IsForbidden(err) {
-                               return createActionNotAuthorizedError()
+                               return createActionNotAuthorizedError(cmd)
                        }
                        return err
                }
-               fmt.Printf("Camel K Cluster Roles removed from cluster\n")
+               fmt.Fprintf(cmd.OutOrStdout(), "Camel K Cluster Roles removed 
from cluster\n")
        }
 
        return nil
 }
 
-func (o *uninstallCmdOptions) uninstallNamespaceRoles(ctx context.Context, c 
client.Client) error {
+func (o *uninstallCmdOptions) uninstallNamespaceRoles(cmd *cobra.Command, ctx 
context.Context, c client.Client) error {
        if !o.SkipRoleBindings {
                if err := o.uninstallRoleBindings(ctx, c); err != nil {
                        return err
                }
-               fmt.Printf("Camel K Role Bindings removed from namespace %s\n", 
o.Namespace)
+               fmt.Fprintf(cmd.OutOrStdout(), "Camel K Role Bindings removed 
from namespace %s\n", o.Namespace)
        }
 
        if !o.SkipRoles {
                if err := o.uninstallRoles(ctx, c); err != nil {
                        return err
                }
-               fmt.Printf("Camel K Roles removed from namespace %s\n", 
o.Namespace)
+               fmt.Fprintf(cmd.OutOrStdout(), "Camel K Roles removed from 
namespace %s\n", o.Namespace)
        }
 
        if !o.SkipServiceAccounts {
                if err := o.uninstallServiceAccounts(ctx, c); err != nil {
                        return err
                }
-               fmt.Printf("Camel K Service Accounts removed from namespace 
%s\n", o.Namespace)
+               fmt.Fprintf(cmd.OutOrStdout(), "Camel K Service Accounts 
removed from namespace %s\n", o.Namespace)
        }
 
        return nil
 }
 
-func (o *uninstallCmdOptions) uninstallNamespaceResources(ctx context.Context, 
c client.Client) error {
+func (o *uninstallCmdOptions) uninstallNamespaceResources(cmd *cobra.Command, 
ctx context.Context, c client.Client) error {
        if !o.SkipConfigMaps {
                if err := o.uninstallConfigMaps(ctx, c); err != nil {
                        return err
                }
-               fmt.Printf("Camel K Config Maps removed from namespace %s\n", 
o.Namespace)
+               fmt.Fprintf(cmd.OutOrStdout(), "Camel K Config Maps removed 
from namespace %s\n", o.Namespace)
        }
 
        if !o.SkipRegistrySecret {
                if err := o.uninstallRegistrySecret(ctx, c); err != nil {
                        return err
                }
-               fmt.Printf("Camel K Registry Secret removed from namespace 
%s\n", o.Namespace)
+               fmt.Fprintf(cmd.OutOrStdout(), "Camel K Registry Secret removed 
from namespace %s\n", o.Namespace)

Review comment:
       Done




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to