Skip to content

Commit

Permalink
Merge pull request #108 from zeari/add_project_id_to_volume_claims
Browse files Browse the repository at this point in the history
Save persistent volume claim to project relation
  • Loading branch information
simon3z authored Sep 15, 2017
2 parents 38015ad + 78a5870 commit eea3322
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ def get_persistent_volume_claims(inventory)
process_collection(inventory["persistent_volume_claim"], key) { |n| parse_persistent_volume_claim(n) }
@data[key].each do |pvc|
@data_index.store_path(key, :by_namespace_and_name, pvc[:namespace], pvc[:name], pvc)
pvc[:project] = @data_index.fetch_path(path_for_entity("namespace"), :by_name, pvc[:namespace])
end
end

Expand Down Expand Up @@ -371,6 +372,7 @@ def get_persistent_volume_claims_graph(inv)

inv["persistent_volume_claim"].each do |pvc|
h = parse_persistent_volume_claim(pvc)
h[:container_project] = lazy_find_project(:name => h[:namespace])

collection.build(h)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,8 @@ def assert_specific_persistent_volume_claim
:phase => "Bound",
:capacity => {:storage => 10.gigabytes},
)
expect(@bound_pvc.container_project.name).to eq("openshift-infra")

pv = PersistentVolume.find_by(:name => "metrics-volume")
cv = ContainerVolume.find_by(:name => "cassandra-data", :type => "ContainerVolume")
expect(@bound_pvc.container_volumes).to contain_exactly(pv, cv)
Expand Down

0 comments on commit eea3322

Please sign in to comment.