Skip to content

Commit 90e2dcf

Browse files
authored
Prune a few dependencies from ./pkg/oci (#1085)
Signed-off-by: Matt Moore <[email protected]>
1 parent eed3e12 commit 90e2dcf

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

pkg/oci/static/options.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
package static
1717

1818
import (
19-
"github.com/go-openapi/swag"
19+
"encoding/json"
20+
2021
"github.com/google/go-containerregistry/pkg/v1/types"
2122
"github.com/sigstore/cosign/pkg/oci"
2223
ctypes "github.com/sigstore/cosign/pkg/types"
@@ -51,7 +52,7 @@ func makeOptions(opts ...Option) (*options, error) {
5152
}
5253

5354
if o.Bundle != nil {
54-
b, err := swag.WriteJSON(o.Bundle)
55+
b, err := json.Marshal(o.Bundle)
5556
if err != nil {
5657
return nil, err
5758
}

pkg/oci/static/signature.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import (
2424
"github.com/google/go-containerregistry/pkg/v1/types"
2525
"github.com/sigstore/cosign/pkg/oci"
2626
"github.com/sigstore/sigstore/pkg/cryptoutils"
27-
"knative.dev/pkg/kmeta"
2827
)
2928

3029
const (
@@ -66,9 +65,12 @@ var _ oci.Signature = (*staticLayer)(nil)
6665

6766
// Annotations implements oci.Signature
6867
func (l *staticLayer) Annotations() (map[string]string, error) {
69-
return kmeta.UnionMaps(l.opts.Annotations, map[string]string{
70-
SignatureAnnotationKey: l.b64sig,
71-
}), nil
68+
m := make(map[string]string, len(l.opts.Annotations)+1)
69+
for k, v := range l.opts.Annotations {
70+
m[k] = v
71+
}
72+
m[SignatureAnnotationKey] = l.b64sig
73+
return m, nil
7274
}
7375

7476
// Payload implements oci.Signature

0 commit comments

Comments
 (0)