-
Notifications
You must be signed in to change notification settings - Fork 43
Add support for the scanning API #74
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Terrific work 👏 !
As your code was looking really nice, I just pointed a bunch of cosmetic changes so we can make it more legible at some places (specially when dealing with url building, if-elif-else
clauses or suggesting small refactors).
The code as it is looks OK, so feel free to accept all of them, some or none. Nice having you around this repo 👍
I think I have fixed all your comments. |
_client.py has grown too big. Moving SdcMonitor and SdcSecure into separated files.
Make the code pep8 compilant except for line lenght (E501) and for comparisons to none (E711) and bool (E712) using '==' or '!='.
Add image, registries and subscription support. Importing some anchore helper functions from anchore-cli into sdcclient/_anchore.
Travis is failing |
@omer-sd the failure might not be related to the changes in the PR. I'll try to manually restart the build. |
The travis CI error says @davideschiera any luck restarting the build manually? |
@meskio The restarting part was easy, but unfortunately the build is still failing, and it's a configuration issue, nothing related to your changes. I started taking a look at the Travis configuration, but didn't find anything useful yet. If @omer-sd is ok with this, an idea could be merging the PR anyway so that your work goes mainstream (the build should work as expected on dev/master branches), and in the meantime keep troubleshooting the build issue. @omer-sd please let me know. Thanks! |
This is approved. We can merge the code. We will handle the Travis failure internally. |
I have created a new class
SdScanningClient
that exposes most of the secure scanning API. I thought it makes sense to be it's own class, asSdSecureClient
is already pretty big and there are things like policies that exists both in the scanning part and in the secure part. If we want everything inSdSecureClient
I can explore mixins or some inheritage tricks to have all the methods in one while the code is split in several files or just have one big class.I have imported some files from anchore-cli into sdcclient/_anchore to bring all the API calls. At some point it might make sense to refactor all that out into the(I've cleaned it up, there is no anchore code anymore)SdScanningClient
, if you consider that a blocker to merge this pull-req I'm happy to work on that.I have refactor SdMonitorClient and SdSecureClient in it's own files and clean up some pep8 errors, the _client.py file was getting too big.