-
Notifications
You must be signed in to change notification settings - Fork 52
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
fix builds namespace matching #33
fix builds namespace matching #33
Conversation
The codeclimate issues are not relevant to this PR. |
@cben please review and check for implications on your current work |
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.
Thanks, especially for the tests 👍 🍾
I prefer this merged first (in case we'll want to backport), I'll rebase #30 on this.
it "handles simple data" do | ||
build_pod = basic_build_pod.dup |
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.
I think you want .deep_dup
(everywhere you .dup
), because you're mutating several levels inside.
Could also use .deep_merge
.
b526366
to
ce779e6
Compare
it "links correct build pods to build configurations in same namespace" do | ||
parse_entities('namespace_1', 'namespace_1') | ||
expect(parser.instance_variable_get('@data')[parser.send(:path_for_entity, "build")].first[:build_config]).to eq( | ||
parser.instance_variable_get('@data')[parser.send(:path_for_entity, "build_config")].first |
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.
I'd hardcode the results of path_for_entity
, both for readability and because I prefer concreteness in tests.
LGTM either way.
ce779e6
to
3c92391
Compare
👍 agree that codeclimate issues are irrelevant to this. |
@enoodle @cben @moolitayer I have the feeling this affects fine/euwe as well. Let's have a BZ. @miq-bot add_label fine/yes |
bc_namespace = build_pod.status.config.try(:namespace) | ||
new_result[:build_config] = @data_index.fetch_path(path_for_entity("build_config"), | ||
:by_namespace_and_name, | ||
bc_namespace, bc_name) |
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.
@enoodle probably we don't need this indentation (you may even keep a single line).
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.
I'm moving & reformatting this line anyway in #30 so doesn't matter.
Checked commit enoodle@3c92391 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 spec/models/manageiq/providers/openshift/container_manager/refresh_parser_spec.rb
|
Fine backport (to manageiq repo) details:
|
This is a bugfix for a problem mentioned here: https://github.com/ManageIQ/manageiq-providers-openshift/pull/30/files#r126438382
BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1469482
cc @cben @moolitayer