KuthumiPepple commented on a change in pull request #3153:
URL: https://github.com/apache/camel-k/pull/3153#discussion_r839056414
##########
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 {
Review comment:
fixed
##########
File path: pkg/cmd/util_dependencies.go
##########
@@ -230,37 +231,37 @@ func createCamelCatalog(ctx context.Context)
(*camel.RuntimeCatalog, error) {
return catalog, nil
}
-func outputDependencies(dependencies []string, format string) error {
+func outputDependencies(dependencies []string, format string, cmd
*cobra.Command) error {
if format != "" {
- err := printDependencies(format, dependencies)
+ err := printDependencies(format, dependencies, cmd)
if err != nil {
return err
}
} else {
// Print output in text form
- fmt.Println("dependencies:")
+ fmt.Fprintln(cmd.OutOrStdout(), "dependencies:")
for _, dep := range dependencies {
- fmt.Printf("%v\n", dep)
+ fmt.Fprintf(cmd.OutOrStdout(), "%v\n", dep)
}
}
return nil
}
-func printDependencies(format string, dependencies []string) error {
+func printDependencies(format string, dependencies []string, cmd
*cobra.Command) error {
switch format {
case "yaml":
data, err := util.DependenciesToYAML(dependencies)
if err != nil {
return err
}
- fmt.Print(string(data))
+ fmt.Fprint(cmd.OutOrStdout(), string(data))
case "json":
data, err := util.DependenciesToJSON(dependencies)
if err != nil {
return err
}
- fmt.Print(string(data))
+ fmt.Fprint(cmd.OutOrStdout(),string(data))
Review comment:
fixed
--
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]