Skip to content

Commit d4d58ff

Browse files
committed
disable annotation validation
Signed-off-by: Sylwester Piskozub <sylwesterpiskozub@gmail.com>
1 parent 0a582a0 commit d4d58ff

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

app/cli/pkg/action/attestation_push.go

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -135,14 +135,16 @@ func (action *AttestationPush) Run(ctx context.Context, attestationID string, ru
135135

136136
// Make sure all the annotation values are now set
137137
// This is in fact validated below but by manually checking we can provide a better error message
138-
for k, v := range craftedAnnotations {
139-
var missingAnnotations []string
140-
if v == "" {
141-
missingAnnotations = append(missingAnnotations, k)
142-
}
143-
144-
if len(missingAnnotations) > 0 {
145-
return nil, fmt.Errorf("annotations %q required", missingAnnotations)
138+
if action.validateAttestation {
139+
for k, v := range craftedAnnotations {
140+
var missingAnnotations []string
141+
if v == "" {
142+
missingAnnotations = append(missingAnnotations, k)
143+
}
144+
145+
if len(missingAnnotations) > 0 {
146+
return nil, fmt.Errorf("annotations %q required", missingAnnotations)
147+
}
146148
}
147149
}
148150
// Set the annotations

0 commit comments

Comments
 (0)