From f992b775359225dbfb7069d7e96419b462b02329 Mon Sep 17 00:00:00 2001 From: Justin Chadwell Date: Thu, 15 Dec 2022 15:39:19 +0000 Subject: [PATCH] buildflags: warn on duplicate attest field Signed-off-by: Justin Chadwell --- util/buildflags/attests.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/util/buildflags/attests.go b/util/buildflags/attests.go index b9aad1a2..ab1b163a 100644 --- a/util/buildflags/attests.go +++ b/util/buildflags/attests.go @@ -29,6 +29,9 @@ func ParseAttests(in []string) (map[string]*string, error) { } k := "attest:" + attestType + if _, ok := out[k]; ok { + return nil, errors.Errorf("duplicate attestation field %s", attestType) + } if enabled { out[k] = &in } else {