2021-05-04 14:10:03 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
FactoryBot.define do
|
|
|
|
factory :helm_file_metadatum, class: 'Packages::Helm::FileMetadatum' do
|
2021-09-14 08:10:35 -04:00
|
|
|
transient do
|
|
|
|
description { nil }
|
|
|
|
end
|
|
|
|
|
2021-05-04 14:10:03 -04:00
|
|
|
package_file { association(:helm_package_file, without_loaded_metadatum: true) }
|
2021-06-25 08:07:44 -04:00
|
|
|
sequence(:channel) { |n| "#{FFaker::Lorem.word}-#{n}" }
|
2021-09-14 08:10:35 -04:00
|
|
|
metadata do
|
2021-11-04 14:09:40 -04:00
|
|
|
{
|
|
|
|
'name': package_file.package.name,
|
|
|
|
'version': package_file.package.version,
|
|
|
|
'apiVersion': 'v2'
|
|
|
|
}.tap do |defaults|
|
2021-09-14 08:10:35 -04:00
|
|
|
defaults['description'] = description if description
|
|
|
|
end
|
|
|
|
end
|
2021-05-04 14:10:03 -04:00
|
|
|
end
|
|
|
|
end
|