Skip to content

Commit 59c0f0b

Browse files
committed
Merge branch '784-riverbed-download'
Signed-off-by: Ben Hale <[email protected]>
2 parents 380fabd + 40cdefd commit 59c0f0b

File tree

3 files changed

+6
-24
lines changed

3 files changed

+6
-24
lines changed

docs/framework-riverbed_appinternals_agent.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,7 @@ The framework can be configured by modifying the [`config/riverbed_appinternals_
5252
**NOTE**
5353

5454
If the Riverbed Service Broker's version is greater than or equal to 10.20, the buildpack will instead download Riverbed AppInternals agent from Riverbed Service Broker and will fall back to using `repository_root` in [`config/riverbed_appinternals_agent.yml`][] only if Service Broker failed to serve the Agent artifact.
55+
56+
**NOTE**
57+
58+
If the Rivered verstion is 10.21.9 or later, the buildpack will load the profiler normally, instead of from the Service Broker. This allows for creating multiple offline buildpacks containing different versions.

lib/java_buildpack/framework/riverbed_appinternals_agent.rb

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -18,30 +18,17 @@
1818
require 'fileutils'
1919
require 'java_buildpack/component/versioned_dependency_component'
2020
require 'java_buildpack/framework'
21+
2122
module JavaBuildpack
2223
module Framework
2324

2425
# Encapsulates the functionality for running the Riverbed Appinternals Agent support.
2526
class RiverbedAppinternalsAgent < JavaBuildpack::Component::VersionedDependencyComponent
2627

27-
# Creates an instance
28-
#
29-
# @param [Hash] context a collection of utilities used the component
30-
def initialize(context)
31-
super(context)
32-
@uri = download_url(credentials, @uri)
33-
end
34-
3528
# (see JavaBuildpack::Component::BaseComponent#compile)
3629
def compile
37-
JavaBuildpack::Util::Cache::InternetAvailability.instance.available(
38-
true, 'Downloading from Riverbed AppInternals Service Broker'
39-
) do
40-
download_zip(false, @droplet.sandbox, @component_name)
41-
end
30+
download_zip(false, @droplet.sandbox, @component_name)
4231
@droplet.copy_resources
43-
rescue StandardError => e
44-
raise "Riverbed AppInternals download failed: #{e}"
4532
end
4633

4734
# (see JavaBuildpack::Component::BaseComponent#release)
@@ -69,8 +56,6 @@ def supports?
6956

7057
private
7158

72-
PROFILERURL = 'profilerUrlLinux'
73-
7459
FILTER = /appinternals/.freeze
7560

7661
private_constant :FILTER
@@ -107,10 +92,6 @@ def rvbd_moniker(credentials)
10792
credentials['rvbd_moniker'] || @configuration['rvbd_moniker']
10893
end
10994

110-
def download_url(credentials, default_url)
111-
(credentials[PROFILERURL] unless credentials.nil?) || default_url
112-
end
113-
11495
end
11596
end
11697
end

spec/java_buildpack/framework/riverbed_appinternals_agent_spec.rb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@
3131
before do
3232
allow(services).to receive(:one_service?).with(/appinternals/).and_return(true)
3333

34-
allow(services).to receive(:find_service).and_return('credentials' => { 'profilerUrlLinux' =>
35-
'http://testfoobar/profiler.zip' })
36-
3734
allow(application_cache).to receive(:get).with('http://testfoobar/profiler.zip')
3835
.and_yield(Pathname.new('spec/fixtures/'\
3936
'stub-riverbed-appinternals-agent.zip').open, false)

0 commit comments

Comments
 (0)