File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -102,6 +102,9 @@ make build
102102 kustomize build --enable-alpha-plugins
103103 ` ` `
104104
105+ ** NOTE:** To enable Helm processing when passing a Kustomize directory into the generator, set
106+ the environment variable ` POLICY_GEN_ENABLE_HELM` to ` " true" ` .
107+
105108# ## As a standalone binary
106109
107110In order to bypass Kustomize and run the generator binary directly, change to the directory of PolicyGenerator
@@ -119,7 +122,10 @@ cd examples
119122../PolicyGenerator policyGenerator.yaml
120123` ` `
121124
122- ** NOTE:** To print the trace in the case of an error, you can add the ` --debug` flag to the arguments.
125+ ** NOTE:**
126+ - To print the trace in the case of an error, you can add the ` --debug` flag to the arguments.
127+ - To enable Helm processing when passing a Kustomize directory into the generator, set
128+ the environment variable ` POLICY_GEN_ENABLE_HELM` to ` " true" ` .
123129
124130# # Additional Policy Generator references
125131
Original file line number Diff line number Diff line change @@ -360,7 +360,14 @@ func setNamespaceSelector(
360360
361361// processKustomizeDir runs a provided directory through Kustomize in order to generate the manifests within it.
362362func processKustomizeDir (path string ) ([]map [string ]interface {}, error ) {
363- k := krusty .MakeKustomizer (krusty .MakeDefaultOptions ())
363+ kustomizeOpts := krusty .MakeDefaultOptions ()
364+
365+ if os .Getenv ("POLICY_GEN_ENABLE_HELM" ) == "true" {
366+ kustomizeOpts .PluginConfig .HelmConfig .Enabled = true
367+ kustomizeOpts .PluginConfig .HelmConfig .Command = "helm"
368+ }
369+
370+ k := krusty .MakeKustomizer (kustomizeOpts )
364371
365372 resourceMap , err := k .Run (filesys .MakeFsOnDisk (), path )
366373 if err != nil {
You can’t perform that action at this time.
0 commit comments