MCPcopy Create free account
hub / github.com/conforma/cli / happyValidator

Function happyValidator

cmd/validate/image_test.go:112–146  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

110}
111
112func happyValidator() imageValidationFunc {
113 return func(_ context.Context, component app.SnapshotComponent, _ *app.SnapshotSpec, _ policy.Policy, _ []evaluator.Evaluator, _ bool) (*output.Output, error) {
114 return &output.Output{
115 ImageSignatureCheck: output.VerificationStatus{
116 Passed: true,
117 },
118 ImageAccessibleCheck: output.VerificationStatus{
119 Passed: true,
120 },
121 AttestationSignatureCheck: output.VerificationStatus{
122 Passed: true,
123 },
124 AttestationSyntaxCheck: output.VerificationStatus{
125 Passed: true,
126 },
127 PolicyCheck: []evaluator.Outcome{
128 {
129 FileName: "test.json",
130 Namespace: "test.main",
131 Successes: []evaluator.Result{
132 {
133 Message: "Pass",
134 Metadata: map[string]interface{}{
135 "code": "policy.nice",
136 "title": "Very nice",
137 },
138 },
139 },
140 },
141 },
142 ImageURL: component.ContainerImage,
143 ExitCode: 0,
144 }, nil
145 }
146}
147
148func Test_determineInputSpec(t *testing.T) {
149 cases := []struct {

Calls

no outgoing calls

Tested by

no test coverage detected