|
|
@ -67,11 +67,11 @@ func (pusher *OCIPusher) push(chartRef, href string) error {
|
|
|
|
|
|
|
|
|
|
|
|
var pushOpts []registry.PushOption
|
|
|
|
var pushOpts []registry.PushOption
|
|
|
|
provRef := fmt.Sprintf("%s.prov", chartRef)
|
|
|
|
provRef := fmt.Sprintf("%s.prov", chartRef)
|
|
|
|
if _, err := os.Stat(provRef); err == nil {
|
|
|
|
if provBytes, err := ioutil.ReadFile(provRef); err != nil {
|
|
|
|
provBytes, err := ioutil.ReadFile(provRef)
|
|
|
|
if err != os.ErrNotExist { // ignore error if .prov does not exist
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
return err
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
pushOpts = append(pushOpts, registry.PushOptProvData(provBytes))
|
|
|
|
pushOpts = append(pushOpts, registry.PushOptProvData(provBytes))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -80,13 +80,9 @@ func (pusher *OCIPusher) push(chartRef, href string) error {
|
|
|
|
meta.Metadata.Version)
|
|
|
|
meta.Metadata.Version)
|
|
|
|
|
|
|
|
|
|
|
|
_, err = client.Push(chartBytes, ref, pushOpts...)
|
|
|
|
_, err = client.Push(chartBytes, ref, pushOpts...)
|
|
|
|
if err != nil {
|
|
|
|
|
|
|
|
return err
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return nil
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// NewOCIPusher constructs a valid OCI client as a Pusher
|
|
|
|
// NewOCIPusher constructs a valid OCI client as a Pusher
|
|
|
|
func NewOCIPusher(ops ...Option) (Pusher, error) {
|
|
|
|
func NewOCIPusher(ops ...Option) (Pusher, error) {
|
|
|
|
registryClient, err := registry.NewClient()
|
|
|
|
registryClient, err := registry.NewClient()
|
|
|
|