Add support for OCI upload provider
Signed-off-by: Roy Golan <rgolan@redhat.com>
This commit is contained in:
parent
d9051c23e6
commit
bee932e222
18 changed files with 495 additions and 4 deletions
30
internal/target/oci_target.go
Normal file
30
internal/target/oci_target.go
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
package target
|
||||
|
||||
type OCITargetOptions struct {
|
||||
User string `json:"user"`
|
||||
Tenancy string `json:"tenancy"`
|
||||
Region string `json:"region"`
|
||||
FileName string `json:"filename"`
|
||||
Fingerprint string `json:"fingerprint"`
|
||||
PrivateKey string `json:"private_key"`
|
||||
Bucket string `json:"bucket"`
|
||||
Namespace string `json:"namespace"`
|
||||
Compartment string `json:"compartment_id"`
|
||||
}
|
||||
|
||||
func (OCITargetOptions) isTargetOptions() {}
|
||||
|
||||
func NewOCITarget(options *OCITargetOptions) *Target {
|
||||
return newTarget("org.osbuild.oci", options)
|
||||
}
|
||||
|
||||
type OCITargetResultOptions struct {
|
||||
Region string `json:"region"`
|
||||
ImageID string `json:"image_id"`
|
||||
}
|
||||
|
||||
func (OCITargetResultOptions) isTargetResultOptions() {}
|
||||
|
||||
func NewOCITargetResult(options *OCITargetResultOptions) *TargetResult {
|
||||
return newTargetResult("org.osbuild.oci", options)
|
||||
}
|
||||
|
|
@ -81,6 +81,8 @@ func UnmarshalTargetOptions(targetName string, rawOptions json.RawMessage) (Targ
|
|||
options = new(KojiTargetOptions)
|
||||
case "org.osbuild.vmware":
|
||||
options = new(VMWareTargetOptions)
|
||||
case "org.osbuild.oci":
|
||||
options = new(OCITargetOptions)
|
||||
default:
|
||||
return nil, errors.New("unexpected target name")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,6 +53,8 @@ func UnmarshalTargetResultOptions(trName string, rawOptions json.RawMessage) (Ta
|
|||
options = new(GCPTargetResultOptions)
|
||||
case "org.osbuild.azure.image":
|
||||
options = new(AzureImageTargetResultOptions)
|
||||
case "org.osbuild.oci":
|
||||
options = new(OCITargetResultOptions)
|
||||
default:
|
||||
return nil, fmt.Errorf("Unexpected target result name: %s", trName)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue