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 Pod to PersistentVolume relationship #15023

Merged
merged 2 commits into from
Sep 1, 2017

Conversation

nimrodshn
Copy link
Contributor

Currently we do not show which PersisentVolumes a given Pod is using -
In this PR we work towards supplying that information to the user.

cc: @zakiva @simon3z @kbrock

BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1435235

@nimrodshn
Copy link
Contributor Author

@miq-bot add_label wip, providers/containers

@nimrodshn
Copy link
Contributor Author

@zeari PTAL.

@nimrodshn nimrodshn force-pushed the add_pv_to_node_realtionship branch from f4e10e1 to 31ae27a Compare May 8, 2017 11:31
@nimrodshn
Copy link
Contributor Author

Added tests.

@nimrodshn nimrodshn force-pushed the add_pv_to_node_realtionship branch from 39f684e to 7f012f2 Compare May 8, 2017 12:00
@nimrodshn
Copy link
Contributor Author

nimrodshn commented May 9, 2017

@simon3z Will upload a PR for the UI soon.
This is the opposite direction of the following PR: #14231

Copy link
Member

@kbrock kbrock left a comment

Choose a reason for hiding this comment

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

looks good - just the one question

@@ -26,6 +26,8 @@ class ContainerGroup < ApplicationRecord
belongs_to :old_container_project, :foreign_key => "old_container_project_id", :class_name => 'ContainerProject'
belongs_to :container_build_pod
has_many :container_volumes, :as => :parent, :dependent => :destroy
has_many :persistent_volume_claim, :through => :container_volumes
has_many :persistent_volumes, -> { where(:type=>'PersistentVolume') }, :through => :persistent_volume_claim, :source => :container_volumes
Copy link
Member

Choose a reason for hiding this comment

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

is this our :type or is it the type over in :persisted_volume_claim?

Copy link
Member

Choose a reason for hiding this comment

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

maybe add a test for claim?

Copy link
Contributor Author

@nimrodshn nimrodshn May 10, 2017

Choose a reason for hiding this comment

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

is this our :type or is it the type over in :persisted_volume_claim?

@kbrock what do you mean by "our :type" vs "type over in :persistent_volume_claim?
Will add a test 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@kbrock added tests for pvc relationship.

Copy link
Member

Choose a reason for hiding this comment

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

Do we even need the where? I don't see any descendants of PersistentVolume

@nimrodshn nimrodshn force-pushed the add_pv_to_node_realtionship branch 2 times, most recently from 58fa178 to e91ccfd Compare May 15, 2017 12:46
@chessbyte
Copy link
Member

@nimrodshn @simon3z what is the status of this PR?

@nimrodshn
Copy link
Contributor Author

nimrodshn commented Jul 5, 2017

@chessbyte It's still WIP, I'm working on the UI. might need to refactor this PR.

@nimrodshn
Copy link
Contributor Author

nimrodshn commented Jul 30, 2017

@zeari FYI

@simon3z
Copy link
Contributor

simon3z commented Aug 1, 2017

@nimrodshn what is missing to make this final? (Remove WIP, etc.)

@nimrodshn
Copy link
Contributor Author

nimrodshn commented Aug 1, 2017

@simon3z This part is done. I'm just stuck on some terrible bug in the UI 😢 (ManageIQ/manageiq-ui-classic#1774) , should I remove the WIP on this and continue work on the UI seperatly?.

@simon3z
Copy link
Contributor

simon3z commented Aug 1, 2017

should I remove the WIP on this and continue work on the UI seperatly?

@nimrodshn yes please, get this reviewed properly (cc @moolitayer @zeari @zakiva) and remove the WIP. Thanks.

@nimrodshn nimrodshn changed the title [WIP] Add Pod to PersistentVolume relationship Add Pod to PersistentVolume relationship Aug 1, 2017
@nimrodshn
Copy link
Contributor Author

@zakiva PTAL

@miq-bot miq-bot removed the wip label Aug 1, 2017
@zeari
Copy link

zeari commented Aug 3, 2017

@nimrodshn
(I think i asked you this but:) Are the volumes necessarily distinct? Can we get the same volume twice through different claims?

expect(group.persistent_volume_claim.count).to eq(1)
expect(group.persistent_volumes.first.name).to eq("persistent_volume")
expect(group.persistent_volumes.count).to eq(1)
end
Copy link

Choose a reason for hiding this comment

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

Since this is a one to many relationship i would expect the tests to have at least one more PV and to check that group.persistent_volumes contains both.

@zakiva Is there room for any 'play' from the provider side? like having claim without a PV or a claim for more than one PV?

refactoring tests

refactored tests

refactored tests

refactored some tests
@miq-bot
Copy link
Member

miq-bot commented Aug 3, 2017

Checked commits nimrodshn/manageiq@d56e359~...be8ab10 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0
2 files checked, 0 offenses detected
Everything looks fine. 🏆

@nimrodshn
Copy link
Contributor Author

nimrodshn commented Aug 3, 2017

@zeari AFAIK we do not address the case of one persistent volume bounded to two different persistent volume claims. @zakiva keep me honest.

Copy link

@zeari zeari left a comment

Choose a reason for hiding this comment

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

@zeari AFAIK we do not address the case of one persistent volume bounded to two different persistent volume claims. @zakiva keep me honest.

If there arent any interesting cases with PVs then this is fine. 👍

@simon3z
Copy link
Contributor

simon3z commented Aug 3, 2017

@zeari AFAIK we do not address the case of one persistent volume bounded to two different persistent volume claims. @zakiva keep me honest.

If there arent any interesting cases with PVs then this is fine.

@zeari right now I can't think of a reason to report more than once the same PV in a ContainerGroup. Is it needed for Chargeback? (I don't think we need to account it twice) Let me know if I am missing something.

LGTM 👍 ready for merge

@miq-bot assign kbrock
cc @kbrock

@miq-bot miq-bot assigned kbrock and unassigned simon3z Aug 3, 2017
@nimrodshn
Copy link
Contributor Author

@blomquisg please review/merge. 😇

@nimrodshn
Copy link
Contributor Author

@chessbyte this has been reviewed and waiting to be merged by core team.

@simon3z
Copy link
Contributor

simon3z commented Aug 28, 2017

@moolitayer 25 days of inactivity here is a little to much, can you add this to the list of the PRs pending review from core?
cc @chessbyte @blomquisg @kbrock

@moolitayer
Copy link

@simon3z Added

@Fryguy Fryguy merged commit b5d744c into ManageIQ:master Sep 1, 2017
@Fryguy Fryguy added this to the Sprint 68 Ending Sep 4, 2017 milestone Sep 1, 2017
@Fryguy Fryguy assigned Fryguy and unassigned kbrock Sep 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants