Skip to content

Commit 5d3f74e

Browse files
dabelendaevgeni
authored andcommitted
Allow to pass the whole alloy config as Sensitive
1 parent a13a4af commit 5d3f74e

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

manifests/config.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# @api private
44
class grafana_alloy::config (
5-
Optional[String[1]] $config = undef,
5+
Optional[Variant[String[1],Sensitive[String[1]]]] $config = undef,
66
) {
77
assert_private()
88

manifests/init.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# The contents of the configuration file, if any
55
# @param manage_package_repo Installs the package repositories
66
class grafana_alloy (
7-
Optional[String[1]] $config = undef,
7+
Optional[Variant[String[1], Sensitive[String[1]]]] $config = undef,
88
Boolean $manage_package_repo = true,
99
) {
1010
if $grafana_alloy::manage_package_repo {

spec/classes/grafana_alloy_spec.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@
2626
it { is_expected.to compile.with_all_deps }
2727
it { is_expected.to contain_file('/etc/alloy/config.alloy').with_content('my config without managing repo') }
2828
end
29+
30+
context 'with sensitive configuration' do
31+
let(:params) { super().merge(config: sensitive('my config')) }
32+
33+
it { is_expected.to compile.with_all_deps }
34+
it { is_expected.to contain_file('/etc/alloy/config.alloy').with_content(sensitive('my config')) }
35+
end
2936
end
3037
end
3138
end

0 commit comments

Comments
 (0)