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

factor out image serving #39

Merged
merged 2 commits into from
Apr 6, 2017
Merged

factor out image serving #39

merged 2 commits into from
Apr 6, 2017

Conversation

enoodle
Copy link

@enoodle enoodle commented Mar 27, 2017

resubmitting of simon3z#11

@enoodle
Copy link
Author

enoodle commented Mar 28, 2017

@simon3z @pweil- @ilackarms please take a look

@ilackarms
Copy link

@enoodle looks good to me

@simon3z
Copy link

simon3z commented Apr 5, 2017

cc @aweiteka

Copy link

@pweil- pweil- left a comment

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

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

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
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

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

@@ -143,7 +151,7 @@ func TestGetAuthConfigs(t *testing.T) {
}

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

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
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

Copy link

@pweil- pweil- left a comment

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