Skip to content
This repository was archived by the owner on Dec 9, 2022. It is now read-only.

factor out image serving#39

Merged
simon3z merged 2 commits into
openshift:masterfrom
enoodle:image-server
Apr 6, 2017
Merged

factor out image serving#39
simon3z merged 2 commits into
openshift:masterfrom
enoodle:image-server

Conversation

@enoodle

@enoodle enoodle commented Mar 27, 2017

Copy link
Copy Markdown

resubmitting of simon3z#11

@enoodle

enoodle commented Mar 28, 2017

Copy link
Copy Markdown
Author

@simon3z @pweil- @ilackarms please take a look

@ilackarms

Copy link
Copy Markdown

@enoodle looks good to me

@simon3z

simon3z commented Apr 5, 2017

Copy link
Copy Markdown

cc @aweiteka

@pweil- pweil- left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I like it 👍 Some minor questions

Comment thread pkg/api/types.go
type OpenSCAPMetadata struct {
Status OpenSCAPStatus // Status of the OpenSCAP scan report
ErrorMessage string // Error message from the openscap
ContentTimeStamp string // Timestamp for this data

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Why is this a string? Would there be a benefit to leaving it as Time? If it is because of issues with json marshalling should we take the Kube approach and provide a wrapper (see unversioned.Time in Kube) so we retain the option to perform time based functions on this field?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

TBH it is string because it was string before [1], I didn't go into this that much when I moved these pieces of code around. I agree that it will be nice to have it as Time but I think that changing this should be done in a different PR because the issue is different than the one this PR is about.

[1]https://github.com/openshift/image-inspector/pull/39/files#diff-f5d24f0dc00fe1c3eeda8d22b2e523ebL20

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

ah, ok. Been a while, sorry. I agree that we should leave it for this refactor

Comment thread pkg/inspector/image-inspector_test.go Outdated

for k, v := range tests {
ii := &defaultImageInspector{*v.opts, InspectorMetadata{}}
ii := &defaultImageInspector{*v.opts, iiapi.InspectorMetadata{}, &MockImageServer{}}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

can't you just pass nil here, why the mock? I guess that means the next question is should we test the nil and non nil use case? 😄

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

The tests pass with nil, in [1] we check to see if the image server is defined. I will remove this redundant code for the mock server. It is easy to make again but I don't think it will be needed here anyway.

[1]https://github.com/openshift/image-inspector/pull/39/files#diff-cb14c05f76ccda787aced81d2a624e69R138

@pweil- pweil- left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM

@simon3z simon3z merged commit 89148d8 into openshift:master Apr 6, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants