Skip to content
This repository has been archived by the owner on Nov 5, 2021. It is now read-only.

bug: the --verbose (-b) flag isnt working #49

Open
sanslash332 opened this issue Oct 22, 2020 · 0 comments
Open

bug: the --verbose (-b) flag isnt working #49

sanslash332 opened this issue Oct 22, 2020 · 0 comments

Comments

@sanslash332
Copy link

When you add the --verbose command to your execution, it doesn't display more information comparing with the regular run of the jaas.

Expected Behavior

The idea is that when you add that flag, more information about your run appear on the console; things like that you can found at pkg/swarm/task.go like these:

fmt.Printf("Running.. OK %s\n", taskRequest.Image)
		fmt.Printf("Connected to.. OK %s\n", taskRequest.Networks)
		fmt.Printf("Constraints: %s\n", taskRequest.Constraints)
		

but anything of that are visible on the output.

Current Behavior

If you add the --verbose flag, it works like the regular run.
Saying service created, with the corresponding id and name, the log if --show-log is true, the exit code and the use of auth if you use -a flag.

Possible Solution

Is really a silly bug; if you read the pkg/swarm/task.go, when the programs checks of the --verbose flag, it try to find it on taskRequest.Verbose, like on these lines:

if taskRequest.Verbose {
		fmt.Printf("Running.. OK %s\n", taskRequest.Image)
		fmt.Printf("Connected to.. OK %s\n", taskRequest.Networks)
		fmt.Printf("Constraints: %s\n", taskRequest.Constraints)
		fmt.Printf("envVars: %s\n", taskRequest.EnvVars)
		fmt.Printf("Secrets: %s\n", taskRequest.Secrets)
	}

	

but if you check cmd/run.go, you can notice that the --verbose flag is only setting a local verbose bool; not the taskRequest.verbose flag:

var (
	taskRequest jtypes.TaskRequest
	verbose     bool
)
runCmd.PersistentFlags().BoolVarP(&verbose, "verbose", "b", false, "print verbose debug information")

I don't found anything other change that will be necesary.

Steps to Reproduce (for bugs)

Simply do a run with jaas; one using -b and other not. with the same parameters; you don't see any different.

Context

I want to simply see with more details the things that are happening on the underground, to check errors, and have a more detailed output.

Your Environment

  • Version used: latest git commit.
  • Environment name and version (e.g. Docker 1.13): docker 19.03.13 on local environment, and latest docker binary on the alpine repository on custom images.

This!

I found the issue, but I don't know if affect other parts of the project, so, I preffer to report it instead of end a pull request.
And well, I don't know how to send a pull request here on github jaja 😄
Thanks for all Alexellis!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant