Skip to content

Commit c455f27

Browse files
authored
Check for credentials keys as logical OR
Fix check for credential keys: was connection_string AND instrumentation_key instead of logical OR
1 parent 39b156c commit c455f27

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/java_buildpack/framework/azure_application_insights_agent.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def compile
3333

3434
# (see JavaBuildpack::Component::BaseComponent#release)
3535
def release
36-
credentials = @application.services.find_service(FILTER, CONNECTION_STRING, INSTRUMENTATION_KEY)['credentials']
36+
credentials = @application.services.find_service(FILTER, [CONNECTION_STRING, INSTRUMENTATION_KEY])['credentials']
3737

3838
if credentials.key?(CONNECTION_STRING)
3939
@droplet.java_opts.add_system_property('applicationinsights.connection.string',
@@ -54,7 +54,7 @@ def release
5454

5555
# (see JavaBuildpack::Component::VersionedDependencyComponent#supports?)
5656
def supports?
57-
@application.services.one_service?(FILTER, CONNECTION_STRING, INSTRUMENTATION_KEY)
57+
@application.services.one_service?(FILTER, [CONNECTION_STRING, INSTRUMENTATION_KEY])
5858
end
5959

6060
FILTER = /azure-application-insights/.freeze

0 commit comments

Comments
 (0)