Skip to content

Commit

Permalink
Merge pull request #48 from puerco/upload-option
Browse files Browse the repository at this point in the history
Make attaching image signature optional
  • Loading branch information
k8s-ci-robot authored Mar 5, 2022
2 parents 74b9e1f + fb27378 commit 68edce1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion sign/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,12 @@ type Options struct {
// Defaults to 3 minutes
Timeout time.Duration

AllowInsecure bool
AllowInsecure bool

// AttachSignature tells the signer to attach or not the new
// signature to its image
AttachSignature bool

OutputSignaturePath string
OutputCertificatePath string
Annotations map[string]interface{}
Expand Down Expand Up @@ -66,6 +71,7 @@ func Default() *Options {
Timeout: 3 * time.Minute,
PassFunc: generate.GetPass,
EnableTokenProviders: true,
AttachSignature: true,
}
}

Expand Down
2 changes: 1 addition & 1 deletion sign/sign.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ func (s *Signer) SignImage(reference string) (*SignedObject, error) {
}

if err := s.impl.SignImageInternal(ctx, ko, regOpts,
s.options.Annotations, images, "", true, outputSignature,
s.options.Annotations, images, "", s.options.AttachSignature, outputSignature,
outputCertificate, "", true, false, "",
); err != nil {
return nil, errors.Wrapf(err, "sign reference: %s", reference)
Expand Down

0 comments on commit 68edce1

Please sign in to comment.