Skip to content

Commit

Permalink
allows sharing of packages across releases when the original packages…
Browse files Browse the repository at this point in the history
… does not have source

[#101733112]
https://www.pivotaltracker.com/story/show/101733112

Signed-off-by: Nader Ziada <nziada@pivotal.io>
  • Loading branch information
sukhil-suresh committed Aug 24, 2015
1 parent 76401f4 commit 07ce131
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
10 changes: 7 additions & 3 deletions bosh-director/lib/bosh/director/jobs/update_release.rb
Original file line number Diff line number Diff line change
Expand Up @@ -235,9 +235,13 @@ def process_packages(release_dir)
# We found a package with the same fingerprint but different
# (release, name, version) tuple, so we need to make a copy
# of the package blob and create a new db entry for it
package = packages.first
package_meta["blobstore_id"] = package.blobstore_id
package_meta["sha1"] = package.sha1
packages.each do |package|
unless package.blobstore_id.nil?
package_meta["blobstore_id"] = package.blobstore_id
package_meta["sha1"] = package.sha1
break
end
end
new_packages << package_meta
end
end
Expand Down
10 changes: 8 additions & 2 deletions spec/integration/release/upload_release_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,14 @@
}.to raise_error(RuntimeError, /Error 30012: package pkg_2\/e7f5b11c43476d74b2d12129b93cba584943e8d3 not part of previous upload of release test_release\/1/)

end

it "allows sharing of packages across releases when the original packages does not have source" do
bosh_runner.run("upload stemcell #{spec_asset('light-bosh-stemcell-3001-aws-xen-hvm-centos-7-go_agent.tgz')}")
bosh_runner.run("upload release #{spec_asset('compiled_releases/release-test_release-1-on-centos-7-stemcell-3001.tgz')}")
output = bosh_runner.run("upload release #{spec_asset('compiled_releases/test_release/releases/release_with_shared_blobs/release_with_shared_blobs-1.tgz')}")
expect(output).to include("Started creating new packages > pkg_1/16b4c8ef1574b3f98303307caad40227c208371f. Done")
expect(output).to include("Started release has been created > release_with_shared_blobs/1. Done")
end
end

describe 'uploading compiled releases' do
Expand Down Expand Up @@ -355,7 +363,5 @@
output = bosh_runner.run("upload release #{spec_asset('compiled_releases/test_release/releases/test_release/test_release-4-same-packages-as-1.tgz')}")
expect(output).to include("Release uploaded")
end


end
end

0 comments on commit 07ce131

Please sign in to comment.