github.com/emc-advanced-dev/unik@v0.0.0-20190717152701-a58d3e8e33b7/pkg/providers/virtualbox/push_image.go (about)

     1  package virtualbox
     2  
     3  import (
     4  	"github.com/sirupsen/logrus"
     5  	"github.com/emc-advanced-dev/pkg/errors"
     6  	"github.com/solo-io/unik/pkg/providers/common"
     7  	"github.com/solo-io/unik/pkg/types"
     8  )
     9  
    10  func (p *VirtualboxProvider) PushImage(params types.PushImagePararms) error {
    11  	image, err := p.GetImage(params.ImageName)
    12  	if err != nil {
    13  		return errors.New("finding image for "+params.ImageName, err)
    14  	}
    15  	if err := common.PushImage(params.Config, image, getImagePath(image.Name)); err != nil {
    16  		return errors.New("pushing image "+image.Name, err)
    17  	}
    18  	logrus.Infof("pushed image %v to %v", image.Name, params.Config.URL)
    19  	return nil
    20  }