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

Root flags don't seem to work #448

Closed
tullo opened this issue Jan 24, 2019 · 4 comments
Closed

Root flags don't seem to work #448

tullo opened this issue Jan 24, 2019 · 4 comments

Comments

@tullo
Copy link
Contributor

tullo commented Jan 24, 2019

According to docker-app --help it should be possible to use root level flags like --log-level=debug or --debug along with commands.

I tested a few, but they all seem broken atm.

docker-app --help

Usage:	docker-app [OPTIONS] COMMAND

Build and deploy Docker Application Packages.

Options:
  -D, --debug              Enable debug mode
  -H, --host list          Daemon socket(s) to connect to
  -l, --log-level string   Set the logging level ("debug"|"info"|"warn"|"error"|"fatal") (default "info")
      --tls                Use TLS; implied by --tlsverify
      --tlscacert string   Trust certs signed only by this CA (default "/home/anda/.docker/ca.pem")
      --tlscert string     Path to TLS certificate file (default "/home/anda/.docker/cert.pem")
      --tlskey string      Path to TLS key file (default "/home/anda/.docker/key.pem")
      --tlsverify          Use TLS and verify the remote
  -v, --version            Print version information

Description

Steps to reproduce the issue:

docker-app --debug completion
Error: Status: unknown flag: --debug
docker-app --log-level=debug completion
Error: Status: unknown flag: --log-level

Describe the results you received:
Error messages

Describe the results you expected:
Debug output

Output of docker version:

Client:
 Version:           18.09.1
 API version:       1.39
 Go version:        go1.10.6
 Git commit:        4c52b90
 Built:             Wed Jan  9 19:35:31 2019
 OS/Arch:           linux/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          18.09.1
  API version:      1.39 (minimum version 1.12)
  Go version:       go1.10.6
  Git commit:       4c52b90
  Built:            Wed Jan  9 19:02:44 2019
  OS/Arch:          linux/amd64
  Experimental:     false

Output of docker-app version:

Version:      v0.6.0-45-g7bb197d
Git commit:   7bb197d
Built:        Thu Jan 24 13:00:34 2019
OS/Arch:      linux/amd64
Experimental: on
Renderers:    gotemplate, mustache, none, yatee

Output of docker info:

Containers: 0
 Running: 0
 Paused: 0
 Stopped: 0
Images: 67
Server Version: 18.09.1
Storage Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 231
 Dirperm1 Supported: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: bridge host macvlan null overlay
 Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: active
 NodeID: 9k3p09fn8w3xc7axkcmkhvfaa
 Is Manager: true
 ClusterID: 0h5e918ercyf52rr6seldwigb
 Managers: 1
 Nodes: 1
 Default Address Pool: 10.0.0.0/8  
 SubnetSize: 24
 Orchestration:
  Task History Retention Limit: 5
 Raft:
  Snapshot Interval: 10000
  Number of Old Snapshots to Retain: 0
  Heartbeat Tick: 1
  Election Tick: 10
 Dispatcher:
  Heartbeat Period: 5 seconds
 CA Configuration:
  Expiry Duration: 3 months
  Force Rotate: 0
 Autolock Managers: false
 Root Rotation In Progress: false
 Node Address: 192.168.0.126
 Manager Addresses:
  192.168.0.126:2377
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 9754871865f7fe2f4e74d43e2fc7ccd237edcbce
runc version: 96ec2177ae841256168fcf76954f7177af9446eb
init version: fec3683
Security Options:
 apparmor
 seccomp
  Profile: default
Kernel Version: 4.15.0-43-generic
Operating System: Ubuntu 18.04.1 LTS
OSType: linux
Architecture: x86_64
CPUs: 8
Total Memory: 15.55GiB
Name: anda-G750JS
ID: RVWR:ZFB7:TORC:AZFZ:JXQI:EQLX:H6K5:J6V5:FOV2:4WD3:RNFB:KTA4
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Username: tullo
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false
Product License: Community Engine

WARNING: No swap limit support
@ijc
Copy link
Contributor

ijc commented Jan 24, 2019

Thanks for the report, I expect this is due to a missing TraverseChildren: true in the cobra.Command within newRootCommand. Do you fancy testing that and raising a PR?

@tullo
Copy link
Contributor Author

tullo commented Jan 24, 2019

Okay, not sure how to do that. I'll give it try.

@tullo
Copy link
Contributor Author

tullo commented Jan 24, 2019

Figured it out, will send PR

@ijc
Copy link
Contributor

ijc commented Jan 24, 2019

Awesome, thanks!

tullo added a commit to tullo/app that referenced this issue Jan 24, 2019
Closes docker#448

Signed-off-by: Andreas Amstutz <andreasamstutz@gmail.com>
tullo added a commit to tullo/app that referenced this issue Jan 25, 2019
Closes docker#448

Signed-off-by: Andreas Amstutz <andreasamstutz@gmail.com>
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

2 participants