upload/vmware: document uploadImage function

This commit is contained in:
Jozef Mikovic 2021-01-26 10:30:04 +01:00 committed by Tom Gundersen
parent d497bc3b83
commit 0597ac48a7
2 changed files with 4 additions and 3 deletions

View file

@ -36,7 +36,9 @@ func OpenAsStreamOptimizedVmdk(imagePath string) (*os.File, error) {
return f, err
}
func UploadImage(creds Credentials, imagePath, imageName string) error {
// UploadImage is a function that uploads a stream optimized vmdk image to vSphere
// uploaded image will be present in a directory of the same name
func UploadImage(creds Credentials, imagePath string) error {
args := []string{
"import.vmdk",
fmt.Sprintf("-u=%s:%s@%s", creds.Username, creds.Password, creds.Host),
@ -45,7 +47,6 @@ func UploadImage(creds Credentials, imagePath, imageName string) error {
fmt.Sprintf("-dc=%s", creds.Datacenter),
fmt.Sprintf("-ds=%s", creds.Datastore),
imagePath,
imageName,
}
retcode := cli.Run(args)