internal/target: add OCI object storage target
Uploads an OCI image to OCI object storage, and generates a pre-authenticated request for the object, which can be used to import it into custom images.
This commit is contained in:
parent
7259deea3a
commit
067366ed6a
7 changed files with 144 additions and 9 deletions
|
|
@ -39,11 +39,16 @@ var uploadCmd = &cobra.Command{
|
|||
}
|
||||
defer file.Close()
|
||||
|
||||
imageID, err := uploader.Upload(objectName, bucketName, bucketNamespace, file, compartment, fileName)
|
||||
err = uploader.Upload(objectName, bucketName, bucketNamespace, file)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to upload the image: %v", err)
|
||||
}
|
||||
|
||||
imageID, err := uploader.CreateImage(objectName, bucketName, bucketNamespace, compartment, fileName)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to create the image from storage object: %v", err)
|
||||
}
|
||||
|
||||
fmt.Printf("Image %s was uploaded and created successfully\n", imageID)
|
||||
return nil
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue