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

Fail 'jf docker scan/push/pull' when a wrong flag is provided to the command #2686

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

eranturgeman
Copy link
Contributor

  • All tests have passed. If this feature is not already covered by the tests, new tests have been added.
  • The pull request is targeting the dev branch.
  • The code has been validated to compile successfully by running go vet ./....
  • The code has been formatted properly using go fmt ./....

When a wrong flag is provided to the command it is captured as an argument and therefore is not going through flags validations. This causes the flag to be ignored and without indications on anything wrong.
Since 'jf docker scan/push/pull' expects 2 arguments only: 'docker' + one of the commands, and extra argument indicates wrong usage.
I added a validation on the arguments number to capture this issue

@eranturgeman eranturgeman added safe to test Approve running integration tests on a pull request ignore for release Automatically generated release notes labels Sep 5, 2024
@github-actions github-actions bot removed the safe to test Approve running integration tests on a pull request label Sep 5, 2024
@eyalbe4 eyalbe4 added bug Something isn't working safe to test Approve running integration tests on a pull request and removed ignore for release Automatically generated release notes labels Sep 5, 2024
@github-actions github-actions bot removed the safe to test Approve running integration tests on a pull request label Sep 5, 2024
Copy link
Contributor

@eyalbe4 eyalbe4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eranturgeman,
Will you be able fix the jfrog-cli-security version in the go.mod, to allow the tests to pass?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants