Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prune a few dependencies from ./pkg/oci #1085

Merged
merged 1 commit into from
Nov 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions pkg/oci/static/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
package static

import (
"github.com/go-openapi/swag"
"encoding/json"

"github.com/google/go-containerregistry/pkg/v1/types"
"github.com/sigstore/cosign/pkg/oci"
ctypes "github.com/sigstore/cosign/pkg/types"
Expand Down Expand Up @@ -51,7 +52,7 @@ func makeOptions(opts ...Option) (*options, error) {
}

if o.Bundle != nil {
b, err := swag.WriteJSON(o.Bundle)
b, err := json.Marshal(o.Bundle)
if err != nil {
return nil, err
}
Expand Down
10 changes: 6 additions & 4 deletions pkg/oci/static/signature.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import (
"github.com/google/go-containerregistry/pkg/v1/types"
"github.com/sigstore/cosign/pkg/oci"
"github.com/sigstore/sigstore/pkg/cryptoutils"
"knative.dev/pkg/kmeta"
)

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

// Annotations implements oci.Signature
func (l *staticLayer) Annotations() (map[string]string, error) {
return kmeta.UnionMaps(l.opts.Annotations, map[string]string{
SignatureAnnotationKey: l.b64sig,
}), nil
m := make(map[string]string, len(l.opts.Annotations)+1)
for k, v := range l.opts.Annotations {
m[k] = v
}
m[SignatureAnnotationKey] = l.b64sig
return m, nil
}

// Payload implements oci.Signature
Expand Down