Sha256: 0db84d0340470e0a93d52b5844fb32990a7261e89d9607fc02a73bd043c24190

Contents?: true

Size: 1.39 KB

Versions: 7

Compression:

Stored size: 1.39 KB

Contents

#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# This helper should be removed when the kitchen-inspec gem has been updated to include these runner options
begin
  require 'kitchen/verifier/inspec'

  # Add runner options for Docker transport for kitchen-inspec gem
  module Kitchen
    module Docker
      module Helpers
        module InspecHelper
          Kitchen::Verifier::Inspec.class_eval do
            def runner_options_for_docker(config_data)
              opts = {
                'backend' => 'docker',
                'logger' => logger,
                'host' => config_data[:container_id],
              }
              logger.debug "Connect to Container: #{opts['host']}"
              opts
            end
          end
        end
      end
    end
  end
rescue LoadError => e
  logger.debug("[Docker] kitchen-inspec gem not found for InSpec verifier. #{e}")
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
kitchen-docker-2.15.0 lib/kitchen/docker/helpers/inspec_helper.rb
kitchen-docker-3.0.0 lib/kitchen/docker/helpers/inspec_helper.rb
kitchen-docker-2.14.0 lib/kitchen/docker/helpers/inspec_helper.rb
kitchen-docker-2.13.0 lib/kitchen/docker/helpers/inspec_helper.rb
kitchen-docker-2.12.0 lib/kitchen/docker/helpers/inspec_helper.rb
kitchen-docker-2.11.0 lib/kitchen/docker/helpers/inspec_helper.rb
kitchen-docker-2.10.0 lib/kitchen/docker/helpers/inspec_helper.rb