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 scanner client #270

Merged
merged 4 commits into from
Apr 13, 2022
Merged

⭐️ add scanner client #270

merged 4 commits into from
Apr 13, 2022

Conversation

chris-rock
Copy link
Member

add a simple http client for the mondoo scanner

@chris-rock chris-rock force-pushed the chris-rock/scanner-client branch from d2e8832 to 4b03d08 Compare April 12, 2022 09:29
"net/http"
"time"

"github.com/pkg/errors"
Copy link
Member

Choose a reason for hiding this comment

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

could we get rid of this dependency? The repo has been archived and is not maintained. There are other projects that are also actively working on using whatever is available in the standard errors package and rewrite whatever is not (e.g. Wrap doesn't exist in the standard pkg).

Some references:
prometheus-operator/prometheus-operator#4682
thanos-io/thanos#5176

Copy link
Member

Choose a reason for hiding this comment

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

perhaps it's good to check if we have this dependency in any of the other projects as well

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah, we can remove that, that was an auto-import

pkg/scanner/scanner.go Outdated Show resolved Hide resolved
pkg/scanner/scanner.go Outdated Show resolved Hide resolved
pkg/scanner/scanner.go Outdated Show resolved Hide resolved
pkg/scanner/scanner.go Show resolved Hide resolved
pkg/scanner/scanner.go Outdated Show resolved Hide resolved
pkg/scanner/scanner.go Show resolved Hide resolved
pkg/scanner/scanner_test.go Outdated Show resolved Hide resolved
pkg/scanner/scanner_test.go Outdated Show resolved Hide resolved
@chris-rock
Copy link
Member Author

Thank you for the improvements @joelddiaz, I cannot self-approve, so you have to approve :-)

result := &ScanResult{
Ok: true,
WorstScore: &Score{
Type: uint32(2),
Copy link
Contributor

Choose a reason for hiding this comment

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

What's a type 2? Maybe constify that to make the variable name self-documenting.

@joelddiaz joelddiaz force-pushed the chris-rock/scanner-client branch 2 times, most recently from c5110d8 to 613f764 Compare April 13, 2022 17:57
@joelddiaz
Copy link
Contributor

@imilchev this should be good for a review

Copy link
Member

@imilchev imilchev left a comment

Choose a reason for hiding this comment

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

LGTM

P.S.: I just checked and there are linting errors in the implementation. Might be better to first merge #279 and then re-base. If first this is merged and then the linting, the run on main will fail

chris-rock and others added 3 commits April 13, 2022 15:01
Signed-off-by: Christoph Hartmann <chris@lollyrock.com>
Signed-off-by: Joel Diaz <joel@mondoo.com>
clarify that a '2' is what comes back from a valid scan result

Signed-off-by: Joel Diaz <joel@mondoo.com>
@joelddiaz joelddiaz force-pushed the chris-rock/scanner-client branch from 613f764 to 57f005b Compare April 13, 2022 19:01
Signed-off-by: Joel Diaz <joel@mondoo.com>
@joelddiaz joelddiaz merged commit dae3784 into main Apr 13, 2022
@joelddiaz joelddiaz deleted the chris-rock/scanner-client branch April 13, 2022 20:46
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

Successfully merging this pull request may close these issues.

3 participants