kojiapi: make repo gpgkey optional

The kojiapi actually shouldn't require it as we need to build images from
unsigned packages.

Fixes #985
This commit is contained in:
Ondřej Budai 2020-10-01 09:36:58 +02:00
parent 315f1afa1d
commit 9fc924fbf4
3 changed files with 5 additions and 4 deletions

View file

@ -53,8 +53,8 @@ type Koji struct {
// Repository defines model for Repository.
type Repository struct {
Baseurl string `json:"baseurl"`
Gpgkey string `json:"gpgkey"`
Baseurl string `json:"baseurl"`
Gpgkey *string `json:"gpgkey,omitempty"`
}
// Status defines model for Status.

View file

@ -176,7 +176,6 @@ components:
type: object
required:
- baseurl
- gpgkey
properties:
baseurl:
type: string

View file

@ -112,7 +112,9 @@ func (h *apiHandlers) PostCompose(ctx echo.Context) error {
repositories := make([]rpmmd.RepoConfig, len(ir.Repositories))
for j, repo := range ir.Repositories {
repositories[j].BaseURL = repo.Baseurl
repositories[j].GPGKey = repo.Gpgkey
if repo.Gpgkey != nil {
repositories[j].GPGKey = *repo.Gpgkey
}
}
bp := &blueprint.Blueprint{}
err = bp.Initialize()