cloudapi: rename gpg_key field to gpgkey

Oh no, we made a mistake here: Both our json repositories and repo files in
/etc/yum.repos.d have the GPG key in a field named `gpgkey`. Unfortunately,
cloudapi uses a field named `gpg_key`. One consequence of this issue is that
our api.sh test is meant to pass GPG keys in the compose request but since
it's using a bad field name (`gpgkey`), the key is actually not used.

I've decided to fix this in cloudapi: The `gpg_key` field is now renamed to
`gpgkey`. This is a breaking change but no one is using this API anyway so
we think it's better to do this now than introducing weird backward
compatible hacks.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
This commit is contained in:
Ondřej Budai 2022-03-25 10:04:42 +01:00 committed by Ondřej Budai
parent 80af9cac98
commit af44202b1c
4 changed files with 117 additions and 87 deletions

View file

@ -3,10 +3,11 @@ package v2
import (
"testing"
"github.com/osbuild/osbuild-composer/internal/common"
"github.com/osbuild/osbuild-composer/internal/rpmmd"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/osbuild/osbuild-composer/internal/common"
"github.com/osbuild/osbuild-composer/internal/rpmmd"
)
func TestSplitExtension(t *testing.T) {
@ -129,7 +130,7 @@ func TestRepoConfigConversion(t *testing.T) {
repo: Repository{
Baseurl: common.StringToPtr("http://base.url"),
CheckGpg: common.BoolToPtr(true),
GpgKey: common.StringToPtr("some-kind-of-key"),
Gpgkey: common.StringToPtr("some-kind-of-key"),
IgnoreSsl: common.BoolToPtr(false),
Metalink: nil,
Mirrorlist: nil,
@ -153,7 +154,7 @@ func TestRepoConfigConversion(t *testing.T) {
repo: Repository{
Baseurl: common.StringToPtr("http://base.url"),
CheckGpg: nil,
GpgKey: nil,
Gpgkey: nil,
IgnoreSsl: common.BoolToPtr(true),
Metalink: common.StringToPtr("http://example.org/metalink"),
Mirrorlist: common.StringToPtr("http://example.org/mirrorlist"),
@ -177,7 +178,7 @@ func TestRepoConfigConversion(t *testing.T) {
repo: Repository{
Baseurl: nil,
CheckGpg: nil,
GpgKey: nil,
Gpgkey: nil,
IgnoreSsl: common.BoolToPtr(true),
Metalink: common.StringToPtr("http://example.org/metalink"),
Mirrorlist: common.StringToPtr("http://example.org/mirrorlist"),
@ -201,7 +202,7 @@ func TestRepoConfigConversion(t *testing.T) {
repo: Repository{
Baseurl: nil,
CheckGpg: nil,
GpgKey: nil,
Gpgkey: nil,
IgnoreSsl: common.BoolToPtr(true),
Metalink: common.StringToPtr("http://example.org/metalink"),
Mirrorlist: nil,
@ -233,7 +234,7 @@ func TestRepoConfigConversion(t *testing.T) {
noURL := Repository{
Baseurl: nil,
CheckGpg: nil,
GpgKey: nil,
Gpgkey: nil,
IgnoreSsl: nil,
Metalink: nil,
Mirrorlist: nil,