runtimeInputAddOpts wraps the runtime inputs as crafter add options, or returns nil when there are none. Defined at package scope so it can name the crafter package type (the Run method shadows it with a local variable).
(runtimeInputs *policies.RuntimeInputs)
| 183 | // returns nil when there are none. Defined at package scope so it can name the |
| 184 | // crafter package type (the Run method shadows it with a local variable). |
| 185 | func runtimeInputAddOpts(runtimeInputs *policies.RuntimeInputs) []crafter.AddOpt { |
| 186 | if runtimeInputs == nil || (len(runtimeInputs.Global) == 0 && len(runtimeInputs.Scoped) == 0) { |
| 187 | return nil |
| 188 | } |
| 189 | return []crafter.AddOpt{crafter.WithRuntimeInputs(runtimeInputs)} |
| 190 | } |
| 191 | |
| 192 | // buildRuntimeInputs reads each policy input file and returns the extracted |
| 193 | // values grouped for the policy engine: unscoped entries under Global and |
no test coverage detected