MCPcopy Create free account
hub / github.com/chainloop-dev/chainloop / runtimeInputAddOpts

Function runtimeInputAddOpts

app/cli/pkg/action/attestation_add.go:185–190  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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).
185func 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

Callers 1

RunMethod · 0.85

Calls 1

WithRuntimeInputsFunction · 0.92

Tested by

no test coverage detected