2021-06-08 01:23:25 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
FactoryBot.define do
|
|
|
|
factory :helm_file_metadatum, class: 'Packages::Helm::FileMetadatum' do
|
2021-11-11 11:23:49 +05:30
|
|
|
transient do
|
|
|
|
description { nil }
|
|
|
|
end
|
|
|
|
|
2021-06-08 01:23:25 +05:30
|
|
|
package_file { association(:helm_package_file, without_loaded_metadatum: true) }
|
2021-09-30 23:02:18 +05:30
|
|
|
sequence(:channel) { |n| "#{FFaker::Lorem.word}-#{n}" }
|
2021-11-11 11:23:49 +05:30
|
|
|
metadata do
|
2021-12-11 22:18:48 +05:30
|
|
|
{
|
|
|
|
'name': package_file.package.name,
|
|
|
|
'version': package_file.package.version,
|
|
|
|
'apiVersion': 'v2'
|
|
|
|
}.tap do |defaults|
|
2021-11-11 11:23:49 +05:30
|
|
|
defaults['description'] = description if description
|
|
|
|
end
|
|
|
|
end
|
2021-06-08 01:23:25 +05:30
|
|
|
end
|
|
|
|
end
|