upload/koji: add support for uploading to Koji

Introduce a target for Koji and hooked it up in the worker, so if koji
target is specified, the image is uploaded to koji.

[teg: use system kerberos config rather than reading from env]
This commit is contained in:
Ondřej Budai 2020-08-28 13:17:46 +02:00 committed by Tom Gundersen
parent 91b86a1369
commit e7fbf4b660
4 changed files with 103 additions and 0 deletions

View file

@ -0,0 +1,13 @@
package target
type KojiTargetOptions struct {
Filename string `json:"filename"`
UploadDirectory string `json:"upload_directory"`
Server string `json:"server"`
}
func (KojiTargetOptions) isTargetOptions() {}
func NewKojiTarget(options *KojiTargetOptions) *Target {
return newTarget("org.osbuild.koji", options)
}

View file

@ -70,6 +70,8 @@ func UnmarshalTargetOptions(targetName string, rawOptions json.RawMessage) (Targ
options = new(AWSTargetOptions)
case "org.osbuild.local":
options = new(LocalTargetOptions)
case "org.osbuild.koji":
options = new(KojiTargetOptions)
default:
return nil, errors.New("unexpected target name")
}