diff --git a/cmd/osbuild-composer-cli-tests/main_test.go b/cmd/osbuild-composer-cli-tests/main_test.go index 563784189..5946fc1e5 100644 --- a/cmd/osbuild-composer-cli-tests/main_test.go +++ b/cmd/osbuild-composer-cli-tests/main_test.go @@ -1,4 +1,4 @@ -// +build integration +//go:build integration package main @@ -171,7 +171,7 @@ type = "yum-baseurl" proxy = "https://proxy-url/" check_ssl = true check_gpg = true -gpgkey_urls = ["https://url/path/to/gpg-key"] +gpgkeys = ["https://url/path/to/gpg-key"] `)) require.NoError(t, err) diff --git a/internal/client/source_test.go b/internal/client/source_test.go index 516f29161..df0db0314 100644 --- a/internal/client/source_test.go +++ b/internal/client/source_test.go @@ -25,7 +25,7 @@ func TestPOSTJSONSourceV0(t *testing.T) { "proxy": "https://proxy-url/", "check_ssl": true, "check_gpg": true, - "gpgkey_urls": ["https://url/path/to/gpg-key"] + "gpgkeys": ["https://url/path/to/gpg-key"] }` source = strings.Replace(source, "REPO-PATH", testState.repoDir, 1) @@ -62,7 +62,7 @@ func TestPOSTInvalidJSONSourceV0(t *testing.T) { "proxy": "https://proxy-url/", "check_ssl": true, "check_gpg": true, - "gpgkey_urls": ["https://url/path/to/gpg-key"] + "gpgkeys": ["https://url/path/to/gpg-key"] }` resp, err := PostJSONSourceV0(testState.socket, source) @@ -81,7 +81,7 @@ func TestPOSTInvalidJSONSourceV1(t *testing.T) { "proxy": "https://proxy-url/", "check_ssl": true, "check_gpg": true, - "gpgkey_urls": ["https://url/path/to/gpg-key"] + "gpgkeys": ["https://url/path/to/gpg-key"] }` resp, err := PostJSONSourceV1(testState.socket, source) @@ -103,7 +103,7 @@ func TestPOSTSystemJSONSourceV0(t *testing.T) { "proxy": "https://proxy-url/", "check_ssl": true, "check_gpg": true, - "gpgkey_urls": ["https://url/path/to/gpg-key"] + "gpgkeys": ["https://url/path/to/gpg-key"] }` for _, repoName := range []string{"test-system-repo", "fedora", "baseos"} { @@ -137,7 +137,7 @@ func TestPOSTSystemJSONSourceV1(t *testing.T) { "proxy": "https://proxy-url/", "check_ssl": true, "check_gpg": true, - "gpgkey_urls": ["https://url/path/to/gpg-key"] + "gpgkeys": ["https://url/path/to/gpg-key"] }` for _, repoName := range []string{"test-system-repo", "fedora", "baseos"} { @@ -165,7 +165,7 @@ func TestPOSTTOMLSourceV0(t *testing.T) { proxy = "https://proxy-url/" check_ssl = true check_gpg = true - gpgkey_urls = ["https://url/path/to/gpg-key"] + gpgkeys = ["https://url/path/to/gpg-key"] ` source = strings.Replace(source, "REPO-PATH", testState.repoDir, 1) @@ -188,7 +188,7 @@ func TestPOSTTOMLSourceV1(t *testing.T) { proxy = "https://proxy-url/" check_ssl = true check_gpg = true - gpgkey_urls = ["https://url/path/to/gpg-key"] + gpgkeys = ["https://url/path/to/gpg-key"] ` source = strings.Replace(source, "REPO-PATH", testState.repoDir, 1) @@ -225,7 +225,7 @@ func TestPOSTInvalidTOMLSourceV0(t *testing.T) { proxy = "https://proxy-url/" check_ssl = true check_gpg = true - gpgkey_urls = ["https://url/path/to/gpg-key"] + gpgkeys = ["https://url/path/to/gpg-key"] ` resp, err := PostTOMLSourceV0(testState.socket, source) @@ -244,7 +244,7 @@ func TestPOSTInvalidTOMLSourceV1(t *testing.T) { proxy = "https://proxy-url/" check_ssl = true check_gpg = true - gpgkey_urls = ["https://url/path/to/gpg-key"] + gpgkeys = ["https://url/path/to/gpg-key"] ` resp, err := PostTOMLSourceV1(testState.socket, source) @@ -263,7 +263,7 @@ func TestPOSTWrongTOMLSourceV0(t *testing.T) { proxy = "https://proxy-url/" check_ssl = true check_gpg = true - gpgkey_urls = ["https://url/path/to/gpg-key"] + gpgkeys = ["https://url/path/to/gpg-key"] ` resp, err := PostTOMLSourceV0(testState.socket, source) @@ -283,7 +283,7 @@ func TestPOSTWrongTOMLSourceV1(t *testing.T) { proxy = "https://proxy-url/" check_ssl = true check_gpg = true - gpgkey_urls = ["https://url/path/to/gpg-key"] + gpgkeys = ["https://url/path/to/gpg-key"] ` resp, err := PostTOMLSourceV1(testState.socket, source) @@ -304,7 +304,7 @@ func TestPOSTTOMLSystemSourceV0(t *testing.T) { proxy = "https://proxy-url/" check_ssl = true check_gpg = true - gpgkey_urls = ["https://url/path/to/gpg-key"] + gpgkeys = ["https://url/path/to/gpg-key"] ` source = strings.Replace(source, "REPO-PATH", testState.repoDir, 1) for _, repoName := range []string{"test-system-repo", "fedora", "baseos"} { @@ -337,7 +337,7 @@ func TestPOSTTOMLSystemSourceV1(t *testing.T) { proxy = "https://proxy-url/" check_ssl = true check_gpg = true - gpgkey_urls = ["https://url/path/to/gpg-key"] + gpgkeys = ["https://url/path/to/gpg-key"] ` source = strings.Replace(source, "REPO-PATH", testState.repoDir, 1) for _, repoName := range []string{"test-system-repo", "fedora", "baseos"} { @@ -365,7 +365,7 @@ func TestListSourcesV0(t *testing.T) { "proxy": "https://proxy-url/", "check_ssl": true, "check_gpg": true, - "gpgkey_urls": ["https://url/path/to/gpg-key"] + "gpgkeys": ["https://url/path/to/gpg-key"] }`, `{ "name": "package-repo-2", @@ -374,7 +374,7 @@ func TestListSourcesV0(t *testing.T) { "proxy": "https://proxy-url/", "check_ssl": true, "check_gpg": true, - "gpgkey_urls": ["https://url/path/to/gpg-key"] + "gpgkeys": ["https://url/path/to/gpg-key"] }`} for i := range sources { @@ -412,7 +412,7 @@ func TestListSourcesV1(t *testing.T) { "proxy": "https://proxy-url/", "check_ssl": true, "check_gpg": true, - "gpgkey_urls": ["https://url/path/to/gpg-key"] + "gpgkeys": ["https://url/path/to/gpg-key"] }`, `{ "id": "package-repo-2", @@ -422,7 +422,7 @@ func TestListSourcesV1(t *testing.T) { "proxy": "https://proxy-url/", "check_ssl": true, "check_gpg": true, - "gpgkey_urls": ["https://url/path/to/gpg-key"] + "gpgkeys": ["https://url/path/to/gpg-key"] }`} for i := range sources { @@ -459,7 +459,7 @@ func TestGetSourceInfoV0(t *testing.T) { proxy = "https://proxy-url/" check_ssl = true check_gpg = true - gpgkey_urls = ["https://url/path/to/gpg-key"] + gpgkeys = ["https://url/path/to/gpg-key"] ` source = strings.Replace(source, "REPO-PATH", testState.repoDir, 1) @@ -489,7 +489,7 @@ func TestGetSourceInfoV1(t *testing.T) { proxy = "https://proxy-url/" check_ssl = true check_gpg = true - gpgkey_urls = ["https://url/path/to/gpg-key"] + gpgkeys = ["https://url/path/to/gpg-key"] rhsm = false ` source = strings.Replace(source, "REPO-PATH", testState.repoDir, 1) @@ -560,7 +560,7 @@ func TestDeleteUserDefinedSourcesV0(t *testing.T) { "proxy": "https://proxy-url/", "check_ssl": true, "check_gpg": true, - "gpgkey_urls": ["https://url/path/to/gpg-key"] + "gpgkeys": ["https://url/path/to/gpg-key"] }`, `{ "name": "package-repo-2", @@ -569,7 +569,7 @@ func TestDeleteUserDefinedSourcesV0(t *testing.T) { "proxy": "https://proxy-url/", "check_ssl": true, "check_gpg": true, - "gpgkey_urls": ["https://url/path/to/gpg-key"] + "gpgkeys": ["https://url/path/to/gpg-key"] }`} // verify test starts without user defined sources @@ -601,7 +601,7 @@ func TestDeleteUserDefinedSourcesV1(t *testing.T) { "proxy": "https://proxy-url/", "check_ssl": true, "check_gpg": true, - "gpgkey_urls": ["https://url/path/to/gpg-key"] + "gpgkeys": ["https://url/path/to/gpg-key"] }`, `{ "id": "package-repo-2", @@ -611,7 +611,7 @@ func TestDeleteUserDefinedSourcesV1(t *testing.T) { "proxy": "https://proxy-url/", "check_ssl": true, "check_gpg": true, - "gpgkey_urls": ["https://url/path/to/gpg-key"] + "gpgkeys": ["https://url/path/to/gpg-key"] }`} // verify test starts without user defined sources diff --git a/internal/weldr/json.go b/internal/weldr/json.go index f4fc22edd..5029f37d1 100644 --- a/internal/weldr/json.go +++ b/internal/weldr/json.go @@ -120,7 +120,7 @@ type SourceConfig interface { } // NewSourceConfigV0 converts a store.SourceConfig to a SourceConfigV0 -// The store does not support proxy and gpgkey_urls +// The store does not support proxy and gpgkeys func NewSourceConfigV0(s store.SourceConfig) SourceConfigV0 { var sc SourceConfigV0 @@ -143,7 +143,7 @@ type SourceConfigV0 struct { CheckSSL bool `json:"check_ssl" toml:"check_ssl"` System bool `json:"system" toml:"system"` Proxy string `json:"proxy,omitempty" toml:"proxy,omitempty"` - GPGUrls []string `json:"gpgkey_urls,omitempty" toml:"gpgkey_urls,omitempty"` + GPGKeys []string `json:"gpgkeys,omitempty" toml:"gpgkeys,omitempty"` } // Key return the key, .Name in this case @@ -162,7 +162,7 @@ func (s SourceConfigV0) GetType() string { } // SourceConfig returns a SourceConfig struct populated with the supported variables -// The store does not support proxy and gpgkey_urls +// The store does not support proxy and gpgkeys func (s SourceConfigV0) SourceConfig() (ssc store.SourceConfig) { ssc.Name = s.Name ssc.Type = s.Type @@ -180,7 +180,7 @@ type SourceInfoResponseV0 struct { } // NewSourceConfigV1 converts a store.SourceConfig to a SourceConfigV1 -// The store does not support proxy and gpgkey_urls +// The store does not support proxy and gpgkeys func NewSourceConfigV1(id string, s store.SourceConfig) SourceConfigV1 { var sc SourceConfigV1 @@ -207,7 +207,7 @@ type SourceConfigV1 struct { CheckSSL bool `json:"check_ssl" toml:"check_ssl"` System bool `json:"system" toml:"system"` Proxy string `json:"proxy,omitempty" toml:"proxy,omitempty"` - GPGUrls []string `json:"gpgkey_urls,omitempty" toml:"gpgkey_urls,omitempty"` + GPGKeys []string `json:"gpgkeys,omitempty" toml:"gpgkeys,omitempty"` Distros []string `json:"distros,omitempty" toml:"distros,omitempty"` RHSM bool `json:"rhsm" toml:"rhsm"` } @@ -228,7 +228,7 @@ func (s SourceConfigV1) GetType() string { } // SourceConfig returns a SourceConfig struct populated with the supported variables -// The store does not support proxy and gpgkey_urls +// The store does not support proxy and gpgkeys func (s SourceConfigV1) SourceConfig() (ssc store.SourceConfig) { ssc.Name = s.Name ssc.Type = s.Type