Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add flags for sliencing warning and for treating warnings as error #100

Closed
janetkuo opened this issue Aug 11, 2016 · 3 comments
Closed

Add flags for sliencing warning and for treating warnings as error #100

janetkuo opened this issue Aug 11, 2016 · 3 comments

Comments

@janetkuo
Copy link
Member

Users would want to ignore known warnings when writing scripts with kompose. Users would also want to get errors when they try to remove all unsupported fields.

@surajssd
Copy link
Member

I would like to work on this! :)

@surajssd surajssd self-assigned this Aug 17, 2016
@surajssd
Copy link
Member

We can have a global flag -w to suppress all the warnings, but I am not clear of the second thing of "treating warnings as error"?

surajssd added a commit to surajssd/kompose that referenced this issue Aug 17, 2016
Without any option normal warnings
```
$ kompose convert --stdout -f ./script/test/fixtures/ngnix-node-redis/docker-compose.yml >/dev/null
time="2016-08-17T22:20:29+05:30" level=warning msg="Unsupported key build - ignoring"
```

With `-w` flag all warnings suppressed
```
$ kompose -w convert --stdout -f ./script/test/fixtures/ngnix-node-redis/docker-compose.yml >/dev/null
```

With `--verbose` flag all warnings shown
```
$ kompose --verbose convert --stdout -f ./script/test/fixtures/ngnix-node-redis/docker-compose.yml >/dev/null
time="2016-08-17T22:21:43+05:30" level=debug msg="Opening compose files: ./script/test/fixtures/ngnix-node-redis/docker-compose.yml"
time="2016-08-17T22:21:43+05:30" level=debug msg="[0/1] [node2]: Adding "
time="2016-08-17T22:21:43+05:30" level=debug msg="[0/1] [node3]: Adding "
time="2016-08-17T22:21:43+05:30" level=debug msg="[0/3] [redis]: Adding "
time="2016-08-17T22:21:43+05:30" level=debug msg="[0/3] [nginx]: Adding "
time="2016-08-17T22:21:43+05:30" level=warning msg="Unsupported key build - ignoring"
time="2016-08-17T22:21:43+05:30" level=debug msg="[0/5] [node1]: Adding "
```

Fixes kubernetes#100
surajssd added a commit to surajssd/kompose that referenced this issue Aug 18, 2016
Without any option normal warnings
```
$ kompose convert --stdout -f ./script/test/fixtures/ngnix-node-redis/docker-compose.yml >/dev/null
time="2016-08-17T22:20:29+05:30" level=warning msg="Unsupported key build - ignoring"
```

With `-w` flag all warnings suppressed
```
$ kompose -w convert --stdout -f ./script/test/fixtures/ngnix-node-redis/docker-compose.yml >/dev/null
```

With `--verbose` flag all warnings shown
```
$ kompose --verbose convert --stdout -f ./script/test/fixtures/ngnix-node-redis/docker-compose.yml >/dev/null
time="2016-08-17T22:21:43+05:30" level=debug msg="Opening compose files: ./script/test/fixtures/ngnix-node-redis/docker-compose.yml"
time="2016-08-17T22:21:43+05:30" level=debug msg="[0/1] [node2]: Adding "
time="2016-08-17T22:21:43+05:30" level=debug msg="[0/1] [node3]: Adding "
time="2016-08-17T22:21:43+05:30" level=debug msg="[0/3] [redis]: Adding "
time="2016-08-17T22:21:43+05:30" level=debug msg="[0/3] [nginx]: Adding "
time="2016-08-17T22:21:43+05:30" level=warning msg="Unsupported key build - ignoring"
time="2016-08-17T22:21:43+05:30" level=debug msg="[0/5] [node1]: Adding "
```

Fixes kubernetes#100
surajssd added a commit to surajssd/kompose that referenced this issue Aug 18, 2016
Without any option normal warnings
```
$ kompose convert --stdout -f ./script/test/fixtures/ngnix-node-redis/docker-compose.yml >/dev/null
time="2016-08-17T22:20:29+05:30" level=warning msg="Unsupported key build - ignoring"
```

With `-w` flag all warnings suppressed
```
$ kompose -w convert --stdout -f ./script/test/fixtures/ngnix-node-redis/docker-compose.yml >/dev/null
```

With `--verbose` flag all warnings shown
```
$ kompose --verbose convert --stdout -f ./script/test/fixtures/ngnix-node-redis/docker-compose.yml >/dev/null
time="2016-08-17T22:21:43+05:30" level=debug msg="Opening compose files: ./script/test/fixtures/ngnix-node-redis/docker-compose.yml"
time="2016-08-17T22:21:43+05:30" level=debug msg="[0/1] [node2]: Adding "
time="2016-08-17T22:21:43+05:30" level=debug msg="[0/1] [node3]: Adding "
time="2016-08-17T22:21:43+05:30" level=debug msg="[0/3] [redis]: Adding "
time="2016-08-17T22:21:43+05:30" level=debug msg="[0/3] [nginx]: Adding "
time="2016-08-17T22:21:43+05:30" level=warning msg="Unsupported key build - ignoring"
time="2016-08-17T22:21:43+05:30" level=debug msg="[0/5] [node1]: Adding "
```

Fixes kubernetes#100
@janetkuo
Copy link
Member Author

"Treating warnings as errors" means that "I expect myself to fix my config so that I won't see any warnings; but in case I missed anything, please give me error on those warnings".

surajssd added a commit to surajssd/kompose that referenced this issue Aug 24, 2016
Without any option normal warnings
```
$ kompose convert --stdout -f ./script/test/fixtures/ngnix-node-redis/docker-compose.yml >/dev/null
time="2016-08-17T22:20:29+05:30" level=warning msg="Unsupported key build - ignoring"
```

With `--quiet` flag all warnings suppressed
```
$ kompose --quiet convert --stdout -f ./script/test/fixtures/ngnix-node-redis/docker-compose.yml >/dev/null
```

With `--verbose` flag all warnings shown
```
$ kompose --verbose convert --stdout -f ./script/test/fixtures/ngnix-node-redis/docker-compose.yml >/dev/null
time="2016-08-17T22:21:43+05:30" level=debug msg="Opening compose files: ./script/test/fixtures/ngnix-node-redis/docker-compose.yml"
time="2016-08-17T22:21:43+05:30" level=debug msg="[0/1] [node2]: Adding "
time="2016-08-17T22:21:43+05:30" level=debug msg="[0/1] [node3]: Adding "
time="2016-08-17T22:21:43+05:30" level=debug msg="[0/3] [redis]: Adding "
time="2016-08-17T22:21:43+05:30" level=debug msg="[0/3] [nginx]: Adding "
time="2016-08-17T22:21:43+05:30" level=warning msg="Unsupported key build - ignoring"
time="2016-08-17T22:21:43+05:30" level=debug msg="[0/5] [node1]: Adding "
```

Fixes kubernetes#100
surajssd added a commit to surajssd/kompose that referenced this issue Aug 24, 2016
Without any option normal warnings
```
$ kompose convert --stdout -f ./script/test/fixtures/ngnix-node-redis/docker-compose.yml >/dev/null
time="2016-08-17T22:20:29+05:30" level=warning msg="Unsupported key build - ignoring"
```

With `--quiet` flag exits on warning
```
$ kompose --quiet convert --stdout -f ./script/test/fixtures/ngnix-node-redis/docker-compose.yml >/dev/null
Unsupported key build - ignoring
$ echo $?
1
```

With `--verbose` flag all warnings shown
```
$ kompose --verbose convert --stdout -f ./script/test/fixtures/ngnix-node-redis/docker-compose.yml >/dev/null
time="2016-08-17T22:21:43+05:30" level=debug msg="Opening compose files: ./script/test/fixtures/ngnix-node-redis/docker-compose.yml"
time="2016-08-17T22:21:43+05:30" level=debug msg="[0/1] [node2]: Adding "
time="2016-08-17T22:21:43+05:30" level=debug msg="[0/1] [node3]: Adding "
time="2016-08-17T22:21:43+05:30" level=debug msg="[0/3] [redis]: Adding "
time="2016-08-17T22:21:43+05:30" level=debug msg="[0/3] [nginx]: Adding "
time="2016-08-17T22:21:43+05:30" level=warning msg="Unsupported key build - ignoring"
time="2016-08-17T22:21:43+05:30" level=debug msg="[0/5] [node1]: Adding "
```

Fixes kubernetes#100
surajssd added a commit to surajssd/kompose that referenced this issue Sep 7, 2016
Without any option normal warnings
```
$ kompose convert --stdout -f ./script/test/fixtures/ngnix-node-redis/docker-compose.yml >/dev/null
time="2016-08-17T22:20:29+05:30" level=warning msg="Unsupported key build - ignoring"
```

With `--quiet` flag exits on warning
```
$ kompose --quiet convert --stdout -f ./script/test/fixtures/ngnix-node-redis/docker-compose.yml >/dev/null
Unsupported key build - ignoring
$ echo $?
1
```

With `--verbose` flag all warnings shown
```
$ kompose --verbose convert --stdout -f ./script/test/fixtures/ngnix-node-redis/docker-compose.yml >/dev/null
time="2016-08-17T22:21:43+05:30" level=debug msg="Opening compose files: ./script/test/fixtures/ngnix-node-redis/docker-compose.yml"
time="2016-08-17T22:21:43+05:30" level=debug msg="[0/1] [node2]: Adding "
time="2016-08-17T22:21:43+05:30" level=debug msg="[0/1] [node3]: Adding "
time="2016-08-17T22:21:43+05:30" level=debug msg="[0/3] [redis]: Adding "
time="2016-08-17T22:21:43+05:30" level=debug msg="[0/3] [nginx]: Adding "
time="2016-08-17T22:21:43+05:30" level=warning msg="Unsupported key build - ignoring"
time="2016-08-17T22:21:43+05:30" level=debug msg="[0/5] [node1]: Adding "
```

Fixes kubernetes#100
surajssd added a commit to surajssd/kompose that referenced this issue Sep 13, 2016
Without any option normal warnings
```
$ kompose -f ./script/test/fixtures/ngnix-node-redis/docker-compose.yml convert --stdout >/dev/null
time="2016-09-13T10:26:50+05:30" level=warning msg="Unsupported key build - ignoring"
```

With `--quiet` flag all warnings are ignored
```
$ kompose --quiet -f ./script/test/fixtures/ngnix-node-redis/docker-compose.yml convert --stdout >/dev/null
```

With `--error-on-warning` flag errors out on any warning
```
$ kompose --error-on-warning -f ./script/test/fixtures/ngnix-node-redis/docker-compose.yml convert --stdout >/dev/null
Unsupported key build - ignoring
$ echo $?
1
```

With `--verbose` flag all logs shown
```
$ kompose --verbose -f ./script/test/fixtures/ngnix-node-redis/docker-compose.yml convert --stdout >/dev/null
time="2016-09-13T10:28:14+05:30" level=debug msg="Opening compose files: ./script/test/fixtures/ngnix-node-redis/docker-compose.yml"
time="2016-09-13T10:28:14+05:30" level=debug msg="[0/1] [nginx]: Adding "
time="2016-09-13T10:28:14+05:30" level=debug msg="[0/1] [node1]: Adding "
time="2016-09-13T10:28:14+05:30" level=debug msg="[0/3] [node2]: Adding "
time="2016-09-13T10:28:14+05:30" level=debug msg="[0/3] [node3]: Adding "
time="2016-09-13T10:28:14+05:30" level=warning msg="Unsupported key build - ignoring"
time="2016-09-13T10:28:14+05:30" level=debug msg="[0/5] [redis]: Adding "
```

Fixes kubernetes#100
surajssd added a commit to surajssd/kompose that referenced this issue Sep 16, 2016
…obal flags

- `--suppress-warnings` it ignores all warnings.
- `--verbose` displays everything
- `--error-on-warning` with any warning exits displaying error.

Fixes kubernetes#100
cab105 pushed a commit to cab105/kompose that referenced this issue Oct 27, 2016
…obal flags

- `--suppress-warnings` it ignores all warnings.
- `--verbose` displays everything
- `--error-on-warning` with any warning exits displaying error.

Fixes kubernetes#100
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants