2021-09-29 12:18:57 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
require_relative '../../test_helper'
|
|
|
|
|
|
|
|
class Test < ChartTest
|
|
|
|
@@chart = Chart.new('charts/library/common-test')
|
|
|
|
|
|
|
|
describe @@chart.name do
|
|
|
|
describe 'addon::promtail' do
|
|
|
|
it 'defaults to disabled' do
|
|
|
|
deployment = chart.resources(kind: "Deployment").first
|
|
|
|
containers = deployment["spec"]["template"]["spec"]["containers"]
|
|
|
|
promtailContainer = containers.find{ |c| c["name"] == "promtail" }
|
|
|
|
|
|
|
|
assert_nil(promtailContainer)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'promtail can be enabled' do
|
|
|
|
values = {
|
|
|
|
addons: {
|
|
|
|
promtail: {
|
2021-09-29 13:10:26 +00:00
|
|
|
enabled: true
|
2021-09-29 12:18:57 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
chart.value values
|
|
|
|
deployment = chart.resources(kind: "Deployment").first
|
|
|
|
containers = deployment["spec"]["template"]["spec"]["containers"]
|
|
|
|
promtailContainer = containers.find{ |c| c["name"] == "promtail" }
|
|
|
|
|
|
|
|
refute_nil(promtailContainer)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|