-
Notifications
You must be signed in to change notification settings - Fork 63
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
Make sure Container has always the right STI type #177
Make sure Container has always the right STI type #177
Conversation
Make sure Container has always the right STI type. Before, the missing image could cause the STI type is Container, which made metrics capture fail. Fixes BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1517676
Checked commit Ladas@561dba9 with ruby 2.3.3, rubocop 0.47.1, haml-lint 0.20.0, and yamllint 1.10.0 |
cc @simon3z |
@moolitayer PTAL |
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.
great find 👍 🏅
gaprindashvili/? |
@cben should be g-release, or even more? |
On second thoughts, I think on fine and older, before ContainerDefinition merge into Container, there is no bug. And on gaprindashvili and master, the BZ symptom is not very severe, if it only happens to very new containers (though inventory may be stale, we might already get some metrics by time we collect). |
@Ladas thanks for the fix. |
I agree, this is a new issue. either way if it does pop up we have @Ladas manual fix in https://bugzilla.redhat.com/show_bug.cgi?id=1517676 |
@moolitayer @cben hm, could you guys do that magic with manual editing VCRs? In our VCR data, we do not have Container without image. |
I'd like to avoid manual editing, but I'm right now working on rerecording a VCR, I'll try to add such container (eg. a ~~bad image url should reliably result in container without status~~).
|
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.
Great Catch LGTM!
@Ladas refresh_parser_spec.rb does not use VCR and would be enough, thanks |
@cben not sure if refresh_parser_spec.rb is good for this? I see you use it mainly for 'it will be parsed good'. While in other providers, this is more of refresher_spec makes sure the right STI type is always there. (also in other providers, we are not setting the type in parser, unless there are sub STI types) |
@cben @moolitayer is it ok to just merge this to deal with the blocker BZ? Then @cben would cover this later with his VCR specs? Including this data combination example. |
Ok with me, FWIW
|
@Ladas why not add a refresh_parser_spec for the case that went wrong here? we use it as general unit tests related to all things parsing, STI and others. let's reiterate on that if needed |
@moolitayer looking at the refresh_parser_spec, you use that mainly for making sure the data are parsed correctly. For this case it's better to have VCR spec, testing the scenarios with missing and present image of a pod, leading to correct data. At least that is what we do in other providers. :-) Since @cben will be adding those VCR specs, I think we can leave it on that? |
@Ladas It would be good to test in VCR specs as an integration test for the complete refresh and in refresh_parser_spec as a unit test - we already check several type attributes in that class. We used to have a requirement at some point to have both types of specs for each new entity. |
…_right_sti_type Make sure Container has always the right STI type (cherry picked from commit cc36180) https://bugzilla.redhat.com/show_bug.cgi?id=1524630
Gaprindashvili backport details:
|
@Ladas, does this need a data migration? P.S. found stable way to reproduce missing containerStatuses — a Pending pod — https://bugzilla.redhat.com/show_bug.cgi?id=1524630#c9 |
@cben yeah. We do not update :type in refresh, for some reason. At this point, we should document a rails c fix, since it's too late for a migration. |
Make sure Container has always the right STI type. Before, the
missing image could cause the STI type is Container, which
made metrics capture fail.
Fixes BZ:
https://bugzilla.redhat.com/show_bug.cgi?id=1517676