lib/liberty_buildpack/container/services_manager.rb
def find_service_plugin_by_tags(service_data)
      candidates = Set.new
      @config.each do |key, value|
        filter = value['service_filter']
        next if filter.nil?
        filter = Regexp.new(filter) unless filter.is_a?(Regexp)
        service_data.each do |service|
          if !service['tags'].nil? && service['tags'].any? { |tag| tag =~ filter }
            candidates.add(key)
          end
        end
      end
      candidates.to_a
    end
#-----------------------------------
# find the service type by checking the tags against filter defined by the plugin
#-----------------------------------
find the service type by checking the tags against filter defined by the plugin
find the service type by checking the tags against filter defined by the plugin
def find_service_plugin_by_tags(service_data)
      candidates = Set.new
      @config.each do |key, value|
        filter = value['service_filter']
        next if filter.nil?
        filter = Regexp.new(filter) unless filter.is_a?(Regexp)
        service_data.each do |service|
          if !service['tags'].nil? && service['tags'].any? { |tag| tag =~ filter }
            candidates.add(key)
          end
        end
      end
      candidates.to_a
    end
def find_service_plugin_by_tags ( service_data ) candidates = Set . new @config . each do | key , value | filter = value [ 'service_filter' ] next if filter . nil? filter = Regexp . new ( filter ) unless filter . is_a? ( Regexp ) service_data . each do | service | if ! service [ 'tags' ] . nil? && service [ 'tags' ] . any? { | tag | tag =~ filter } candidates . add ( key ) end end end candidates . to_a end
find the service type by checking the tags against filter defined by the plugin
find the service type by checking the tags against filter defined by the plugin
service_data