debian-forge-composer/internal/target/container_target.go
Ygal Blum 3231aabbc0 cloudapi: add support for uploading to a container registry
Worker
------
Add configuration for the default container registry.
Use the default container registry if not provided as part
of the image name.
When using the default registry use the configured values
Return the image url as part of the result.

Composer Worker API
-------------------
Add `ContainerTargetResultOptions` to return the image url

Composer API
------------
Add UploadOptions to allow setting of the image name and tag
Add UploadStatus to return the url of the uploaded image

Co-Developed-By: Christian Kellner <christian@kellner.me>
2022-08-01 21:50:03 +01:00

29 lines
776 B
Go

package target
const TargetNameContainer TargetName = "org.osbuild.container"
type ContainerTargetOptions struct {
Reference string `json:"reference"`
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
TlsVerify *bool `json:"tls_verify,omitempty"`
}
func (ContainerTargetOptions) isTargetOptions() {}
func NewContainerTarget(options *ContainerTargetOptions) *Target {
return newTarget(TargetNameContainer, options)
}
type ContainerTargetResultOptions struct {
URL string `json:"url"`
Digest string `json:"digest"`
}
func (ContainerTargetResultOptions) isTargetResultOptions() {}
func NewContainerTargetResult(options *ContainerTargetResultOptions) *TargetResult {
return newTargetResult(TargetNameContainer, options)
}