File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed
tests/template_with_values Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -42,12 +42,15 @@ def _helm_template_test_impl(ctx):
4242 args .add ("template" )
4343 args .add (rlocationpath (pkg_info .chart , ctx .workspace_name ))
4444
45+ for values in ctx .files .values :
46+ args .add ("--values" , values )
47+
4548 ctx .actions .write (
4649 output = args_file ,
4750 content = args ,
4851 )
4952
50- runfiles = runfiles .merge (ctx .runfiles ([
53+ runfiles = runfiles .merge (ctx .runfiles (ctx . files . values + [
5154 args_file ,
5255 ctx .executable ._runner ,
5356 toolchain .helm ,
@@ -108,6 +111,10 @@ helm_template_test = rule(
108111 "template_patterns" : attr .string_list_dict (
109112 doc = "A mapping of template paths to regex patterns required to match." ,
110113 ),
114+ "values" : attr .label_list (
115+ doc = "Values files to pass to `helm template --values`." ,
116+ allow_files = [".yml" , ".yaml" ],
117+ ),
111118 "_copier" : attr .label (
112119 cfg = "exec" ,
113120 executable = True ,
Original file line number Diff line number Diff line change @@ -22,4 +22,12 @@ helm_template(
2222helm_template_test (
2323 name = "template_with_values_template_test" ,
2424 chart = ":template_with_values" ,
25+ template_patterns = {
26+ "template-with-values/templates/deployment.yaml" : [
27+ " replicas: 10\\ b" , # overriden by template_values.yaml
28+ ],
29+ },
30+ values = [
31+ ":template_values.yaml" ,
32+ ],
2533)
You can’t perform that action at this time.
0 commit comments