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:
Sanne Raymaekers 2023-09-05 12:22:53 +02:00
parent 7259deea3a
commit 067366ed6a
7 changed files with 144 additions and 9 deletions

View file

@ -87,6 +87,8 @@ func (target *Target) UnmarshalJSON(data []byte) error {
options = new(VMWareTargetOptions)
case TargetNameOCI:
options = new(OCITargetOptions)
case TargetNameOCIObjectStorage:
options = new(OCIObjectStorageTargetOptions)
case TargetNameContainer:
options = new(ContainerTargetOptions)
case TargetNameWorkerServer:
@ -246,6 +248,18 @@ func (target Target) MarshalJSON() ([]byte, error) {
}
rawOptions, err = json.Marshal(compat)
case *OCIObjectStorageTargetOptions:
type compatOptionsType struct {
*OCIObjectStorageTargetOptions
// Deprecated: `Filename` is now set in the target itself as `ExportFilename`, not in its options.
Filename string `json:"filename"`
}
compat := compatOptionsType{
OCIObjectStorageTargetOptions: t,
Filename: target.OsbuildArtifact.ExportFilename,
}
rawOptions, err = json.Marshal(compat)
case *ContainerTargetOptions:
type compatOptionsType struct {
*ContainerTargetOptions