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

Wrong placement of flag in command #72

Closed
nnickie23 opened this issue Nov 24, 2021 · 4 comments · Fixed by #73
Closed

Wrong placement of flag in command #72

nnickie23 opened this issue Nov 24, 2021 · 4 comments · Fixed by #73
Labels

Comments

@nnickie23
Copy link
Contributor

Describe the bug
controls/container_images.rb uses docker history to inspect commands, and the command looks like this:

command("docker --no-trunc history #{id}| grep -e 'update'")

Expected behavior
The output without error is expected. This can be achieved by placing the flag ---no-trunc at the end of command string:

command("docker history #{id} --no-trunc | grep -e 'update'")

Actual behavior
The stdout of running this command is empty because the command has an error:

unknown flag: --no-trunc
...

Example code

command(docker --no-trunc history #{id}| grep -e 'update')

OS / Environment

NAME="Ubuntu"
VERSION="20.04 LTS (Focal Fossa)"

Inspec Version

4.46.13

Baseline Version

1.12.0
@rndmh3ro rndmh3ro added the bug label Nov 24, 2021
@rndmh3ro
Copy link
Member

Thanks for reporting this! Do you want to create a PR to fix it?

@nnickie23
Copy link
Contributor Author

@rndmh3ro yes

@nnickie23
Copy link
Contributor Author

How could I do this?

nnickie23 added a commit to nnickie23/cis-docker-benchmark that referenced this issue Dec 2, 2021
Fix the placement of "--no-trunc" flag of docker command
nnickie23 added a commit to nnickie23/cis-docker-benchmark that referenced this issue Dec 3, 2021
Fix the placement of "--no-trunc" flag of docker command

Signed-off-by: nnickie23 <[email protected]>
@schurzi schurzi linked a pull request Feb 25, 2023 that will close this issue
schurzi added a commit that referenced this issue Feb 25, 2023
* Fix command flag (#72)

Fix the placement of "--no-trunc" flag of docker command

Signed-off-by: nnickie23 <[email protected]>

* use order defined in documentation

Signed-off-by: Martin Schurz <[email protected]>

---------

Signed-off-by: nnickie23 <[email protected]>
Signed-off-by: Martin Schurz <[email protected]>
Co-authored-by: schurzi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants