Ресурс docker_plugin
Используйте ресурс аудита Chef InSpec, чтобы проверить плагин Docker.
Синтаксис
Блок ресурса docker_plugin объявляет плагин:
describe docker_plugin('rexray/ebs') do
it { should exist }
its('id') { should_not eq '0ac30b93ad40' }
its('version') { should eq '0.11.1' }
it { should be_enabled }
end
Примеры параметров ресурса
Ресурс позволяет передать идентификатор плагина:
describe docker_plugin(id: plugin_id) do
it { should be_enabled }
end
Свойства
id
Свойство id возвращает полный идентификатор плагина:
describe docker_plugin('cloudstor/aws') do
its('id') { should eq '0ac30b93ad40' }
end
version
Свойство version тестирует значение версии плагина:
describe docker_plugin('cloudstor/aws') do
its('version') { should eq '0.11.0' }
end
Примеры
Проверка плагина Docker
describe docker_plugin('rexray/ebs') do
it { should exist }
its('id') { should_not eq '0ac30b93ad40' }
its('version') { should eq '0.11.1' }
it { should be_enabled }
end
Сопоставители
Полный список доступных сопоставителей можно найти на странице Универсальные сопоставители.
exist
Сопоставитель exist проверяет, доступен ли плагин на узле:
describe docker_plugin('rexray/ebs') do
it { should exist }
end
enabled
Сопоставитель be_enabled проверяет, включен ли плагин
© Chef Software, Inc.
Licensed under the Creative Commons Attribution 3.0 Unported License.
The Chef™ Mark and Chef Logo are either registered trademarks/service marks or trademarks/servicemarks of Chef, in the United States and other countries and are used with Chef Inc's permission.
We are not affiliated with, endorsed or sponsored by Chef Inc.
https://docs.chef.io/inspec/resources/docker_plugin/