remove the --with-prov option

Signed-off-by: Josh Dolitsky <josh@dolit.ski>
pull/9782/head
Josh Dolitsky 4 years ago
parent eba63beab1
commit 35fdc688cd
No known key found for this signature in database
GPG Key ID: B2B93673243A65FB

@ -57,8 +57,5 @@ func newPushCmd(cfg *action.Configuration, out io.Writer) *cobra.Command {
},
}
f := cmd.Flags()
f.BoolVar(&client.WithProv, "with-prov", false, "upload .prov file")
return cmd
}

@ -30,7 +30,6 @@ import (
// It provides the implementation of 'helm push'.
type Push struct {
Settings *cli.EnvSettings
WithProv bool
cfg *action.Configuration
}
@ -60,9 +59,7 @@ func (p *Push) Run(chartRef string, remote string) (string, error) {
c := uploader.ChartUploader{
Out: &out,
Pushers: pusher.All(p.Settings),
Options: []pusher.Option{
pusher.WithProvenance(p.WithProv),
},
Options: []pusher.Option{},
}
if strings.HasPrefix(remote, "oci://") {

@ -18,6 +18,7 @@ package pusher
import (
"fmt"
"io/ioutil"
"os"
"path"
"strings"
@ -52,10 +53,9 @@ func (pusher *OCIPusher) push(chartRef, href string) error {
}
var pushOpts []registry.PushOption
var provBytes []byte
if pusher.opts.withProv {
provRef := fmt.Sprintf("%s.prov", chartRef)
provBytes, err = ioutil.ReadFile(provRef)
provRef := fmt.Sprintf("%s.prov", chartRef)
if _, err := os.Stat(provRef); err == nil {
provBytes, err := ioutil.ReadFile(provRef)
if err != nil {
return err
}

@ -27,7 +27,6 @@ import (
//
// Pushers may or may not ignore these parameters as they are passed in.
type options struct {
withProv bool
registryClient *registry.Client
}
@ -42,13 +41,6 @@ func WithRegistryClient(client *registry.Client) Option {
}
}
// WithProvenance sets the withProv option.
func WithProvenance(withProv bool) Option {
return func(opts *options) {
opts.withProv = withProv
}
}
// Pusher is an interface to support upload to the specified URL.
type Pusher interface {
// Push file content by url string

Loading…
Cancel
Save