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:
parent
91b86a1369
commit
e7fbf4b660
4 changed files with 103 additions and 0 deletions
13
internal/target/koji_target.go
Normal file
13
internal/target/koji_target.go
Normal 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)
|
||||
}
|
||||
|
|
@ -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")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue